Consul lab
/ # consul join -wan 10.0.0.4
Successfully joined cluster by contacting 1 nodes.
Add flag -retry-join-wan 10.0.0.4:8204
to consul agent
in dc-1 or add
"retry-join-wan": "10.0.0.4:8204"
to json config file.
https://developer.hashicorp.com/consul/docs/agent/config/config-files#retry_join_wan https://developer.hashicorp.com/consul/docs/agent/config/cli-flags#_retry_join_wan
Important options:
- check members
# consul members -wan
Node Address Status Type Build Protocol DC Partition Segment
63b7c673db46.dc-1 10.0.0.5:8304 alive server 1.18.0 2 dc-1 default <all>
cd001120bb19.dc-main 10.0.0.4:8304 alive server 1.18.0 2 dc-main default <all>
- check consul members (specify http port of consul agent)
# consul members -wan -http-addr http://0.0.0.0:8500
Node Address Status Type Build Protocol DC Partition Segment
63b7c673db46.dc-1 10.0.0.5:8304 alive server 1.18.0 2 dc-1 default <all>
cd001120bb19.dc-main 10.0.0.4:8304 alive server 1.18.0 2 dc-main default <all>
- check via
/v1/catalog
curl http://localhost:8500/v1/catalog/datacenters
curl http://localhost:8500/v1/catalog/nodes?dc=dc-1
curl http://localhost:8500/v1/catalog/nodes?dc=dc-main
https://hub.docker.com/r/hashicorp/consul-replicate https://hub.docker.com/r/hashicorp/consul
- Federation gossip wan
- Consul ali flags
- Consul config files
- federating clusters
- Multi dc consul on k8s
- https://developer.hashicorp.com/consul/docs/k8s/deployment-configurations/multi-cluster
- https://developer.hashicorp.com/consul/docs/k8s/deployment-configurations/multi-cluster/kubernetes
- https://developer.hashicorp.com/consul/docs/k8s/deployment-configurations/multi-cluster/vms-and-kubernetes