hashicorp / consul

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
https://www.consul.io
Other
28.31k stars 4.42k forks source link

registered with client and replicated #6985

Open conansoft opened 4 years ago

conansoft commented 4 years ago

I am just started playing with consul, I have setup a 3 server,1 client cluster, the three servers joined each other, and elected a leader.

I am using this for service discovery, and registered the services by client node,but the services are not forwarded to server by rpc ,they stored on the client node。

In addition, when I am registered the services with one of the follower servers in the cluster.However the data is not getting replicated to other servers in the cluster.

server1: consul agent -server -ui -bind=172.17.3.1 -data-dir /data/consul -node=server1 -client=0.0.0.0 -bootstrap-expect=3 server2: consul agent -server -ui -bind=172.17.3.2 -data-dir /data/consul -node=server2 -client=0.0.0.0 -join 172.17.3.1 server3: consul agent -server -ui -bind=172.17.3.3 -data-dir /data/consul -node=server3 -client=0.0.0.0 -join 172.17.3.1 client: consul agent -ui -bind=172.17.3.4 -data-dir /data/consul -node=client1 -client=0.0.0.0 -join 172.17.3.1

consul members: Node Address Status Type Build Protocol DC Segment server1 172.17.3.1:8301 alive server 1.6.2 2 dc1 server2 172.17.3.2:8301 alive server 1.6.2 2 dc1 server3 172.17.3.3:8301 alive server 1.6.2 2 dc1 client1 172.17.3.4:8301 alive client 1.6.2 2 dc1

like-inspur commented 4 years ago

yes, I also met same error when I register consul with /v1/agent/service/register api, I found registered service just locate some consul server nodes not all server nodes image