Please pardon me, Im new to this group. Im sharing all my info even if Im uncertain if relevant or not. Ive had about 3 days learning Consul and vault.
Problem: Though I know that Vault is supposed to interact with the Consul Client to ensure connectivity to an active node I seem unable to do so. My NETSTATs show port 8600 only open on the Consul Client agents, 8500 is specific to the Consul Server agent. I can configure Vault to go directly to IP:8500 on the Consul Server agents and vault behaves properly. When I point it at
127.0.0.1:8600 it fails to work, and 8500 is not avail (see netstat). At this time I have only configured vault on 1 of the Consul Agent Servers until I figure out the communication issue I am having with my config and understanding. So What am I missing for vault to use the consul "Client" to communicate to the cluster? (details below)
Image of ny basic understanding of the architecture
Stage one:POC: completedI setup a POC that was a single server with Vaul and Consul installed together
Setup MySQL dynamic backend
Setup PKI backend
setup aws key backend
setup MSSQL backend
So I moved onto the HA implementation
Stage two:production base setup first datacenter: in progress
I have 3 Servers configured as Consul "server" agents
I have 3 Servers Configured as Consul "Client" agents which also contain my Vault configurations
6 Ec2 images in total
my OSs are the latest Amazon Linux.
Stage Three; Add in TLS and other security refinements
no progress at this time
Stage Four: Roll out to other datacenters regionally
no progress at this time
Consul-Server-Agent Configuration (config in purple)
Consule Members:Node Address Status Type Build Protocol DC Segment
consul_server1 X.X.49.200:8301 alive server 1.0.0 2 us-east-1 <all>
consul_server2 X.X.51.200:8301 alive server 1.0.0 2 us-east-1 <all>
consul_server3 X.X.52.200:8301 alive server 1.0.0 2 us-east-1 <all>
consul_client-vault1 X.X.48.210:8301 alive client 1.0.0 2 us-east-1 <default>
consul_client-vault2 X.X.49.210:8301 alive client 1.0.0 2 us-east-1 <default>
consul_client-vault3 X.X.51.210:8301 alive client 1.0.0 2 us-east-1 <default>
example of consul "Server" agent (3 Ec2 images, variations are in the join IPs and node)
{
"datacenter": "us-east-1",
"data_dir": "/opt/consul/data/",
"encrypt": "**********************==",
"log_level": "INFO",
"enable_syslog": true,
"node_name": "consul_server01",
"bootstrap": false,
"server": true,
"bootstrap_expect": 3,
"log_level": "INFO",
"enable_syslog": true,
"start_join": ["X.X.51.200", "X.X.52.200"],
"retry_join": ["X.X.51.200:8301", "X.X.52.200:8301"],
"rejoin_after_leave": true,
"retry_interval": "30s"
}
the execution of my init/consul.conf for upstart contains the below for starting the consul "server" agent
exec /usr/local/bin/consul agent \
-config-dir="/opt/consul/server" \
-bind=$BIND \
-client=0.0.0.0 \
${CONSUL_FLAGS} \
>>/var/log/consul.log 2>&1
example of my netstat on my consul server agent server
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 X.X.49.200:8300 0.0.0.0:* LISTEN
tcp 0 0 X.X.49.200:8301 0.0.0.0:* LISTEN
tcp 0 0 X.X.49.200:8302 0.0.0.0:* LISTEN
tcp 0 0 X.X.49.200:8300 X.X.51.200:41777 ESTABLISHED
tcp 0 0 X.X.49.200:8300 X.X.49.200:49263 ESTABLISHED
tcp 0 0 X.X.49.200:48154 X.X.51.210:8301 TIME_WAIT
tcp 0 0 X.X.49.200:8300 X.X.52.200:54321 ESTABLISHED
tcp 0 0 X.X.49.200:49263 X.X.49.200:8300 ESTABLISHED
tcp 0 0 X.X.49.200:46696 X.X.49.210:8301 TIME_WAIT
tcp 0 0 X.X.49.200:8300 X.X.52.200:49831 ESTABLISHED
tcp 0 0 X.X.49.200:49041 X.X.51.200:8300 ESTABLISHED
tcp 0 0 X.X.49.200:8300 X.X.52.200:35723 ESTABLISHED
tcp 0 0 X.X.49.200:8301 X.X.49.210:37380 TIME_WAIT
tcp 0 0 X.X.49.200:8302 X.X.52.200:47048 TIME_WAIT
tcp 0 0 X.X.49.200:55285 X.X.52.200:8300 ESTABLISHED
tcp 0 0 X.X.49.200:8301 X.X.49.210:37382 TIME_WAIT
tcp 0 0 X.X.49.200:8302 X.X.51.200:52958 TIME_WAIT
tcp 0 0 :::58129 :::* LISTEN
tcp 0 0 :::8500 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 :::8600 :::* LISTEN
tcp 0 0 :::111 :::* LISTEN
udp 0 0 X.X.49.200:46998 X.X.48.10:53 ESTABLISHED
udp 0 0 X.X.49.200:47206 X.X.48.10:53 ESTABLISHED
udp 0 0 X.X.49.200:8301 0.0.0.0:*
udp 0 0 X.X.49.200:8302 0.0.0.0:*
udp 0 0 X.X.49.200:123 0.0.0.0:*
udp 0 0 X.X.49.200:49401 X.X.48.10:53 ESTABLISHED
udp 0 0 X.X.49.200:49023 X.X.48.10:53 ESTABLISHED
udp 0 0 :::8600 :::*
udp 0 0 fe80::10dc:8bff:fe8c:641:546 :::*
udp 0 0 :::111 :::*
udp 0 0 :::53914 :::*
udp 0 0 :::884 :::*
VAULT and CONSUL-CLIENT-AGENT configuration (config in blue)Vault is a Cohabitant with Consul "Client" agent. The Vault configuration is below
storage "consul" {
address = "127.0.0.1:8500" (I have swapped out 8600 as well as trying to make a socket connection) path = "vault-us-east-1/"
}
ha_storage "consul" {
check_timeout = "10s"
path = "ha-vault-us-east-1/"
scheme = "http"
}
listener "tcp" {
tls_disable = 1
}
cluster_name = "vault_cluster"
disable_mlock = false
my Consul "Client" config on the consul/client and vault server Im using to test
{
"server": false,
"addresses": {
"http": "0.0.0.0"
},
"ports": {
"http": 8080
},
"datacenter": "us-east-1",
"data_dir": "/opt/consul/data/",
"encrypt": "*************************==",
"log_level": "INFO",
"enable_syslog": true,
"ui": true,
"node_name": "consul_client01",
"start_join": ["X.X.49.200", "X.X.51.200", "X.X.52.200"]
}
This is the netstat on my Vault-Consul/Client Server. Note the absence of the 8500 port.
[ec2-user@ip-172-19-48-210 ~]$ sudo vi netstat.log
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 :::58849 :::* LISTEN
tcp 0 0 :::111 :::* LISTEN
tcp 0 0 :::8080 :::* LISTEN
udp 0 0 X.X.48.210:8301 0.0.0.0:*
udp 0 0 X.X.48.210:123 0.0.0.0:*
udp 0 0 fe80::99:63ff:fe5c:b9f0:546 :::*
udp 0 0 :::111 :::*
udp 0 0 :::47240 :::*
udp 0 0 :::795 :::*
Thank you in advance for educating me on my mistake.
Cheers,
Walker Hutchinson