docker-consul icon indicating copy to clipboard operation
docker-consul copied to clipboard

Docker deployment of services, can not modify the registered address of docker-consul

Open xigang opened this issue 9 years ago • 0 comments

After the start of the service, the consul.wath connection service is rejected.I don't know how to solve it:(

docker-compose.yml

sms:
    build: .
    environment:
        - MICRO_REGISTRY_ADDRESS=consul:8500
    volumes:
        - ./logs/:/sms/logs/
        - ./etc/env_strings.conf:/etc/env_strings.conf
    links:
        - consul
consul:
    command: -server -bootstrap -rejoin
    image: progrium/consul:latest

server log:

Creating sms_consul_1
Creating sms_sms_1
Attaching to sms_consul_1, sms_sms_1
consul_1  | ==> WARNING: Bootstrap mode enabled! Do not enable unless necessary
consul_1  | ==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1
sms_1     | 2016/06/24 02:15:20 Listening on [::]:34066
consul_1  | ==> Starting raft data migration...
sms_1     | 2016/06/24 02:15:20 Broker Listening on [::]:46361
consul_1  | ==> Starting Consul agent...
sms_1     | 2016/06/24 02:15:20 Registering node: sms-7E67AC78
consul_1  | ==> Starting Consul agent RPC...
consul_1  | ==> Consul agent running!
consul_1  |          Node name: '6dd7183da9a7'
consul_1  |         Datacenter: 'dc1'
consul_1  |             Server: true (bootstrap: true)
consul_1  |        Client Addr: 0.0.0.0 (HTTP: 8500, HTTPS: -1, DNS: 53, RPC: 8400)
consul_1  |       Cluster Addr: 192.168.42.2 (LAN: 8301, WAN: 8302)
consul_1  |     Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false
consul_1  |              Atlas: <disabled>
consul_1  |
consul_1  | ==> Log data will now stream in as it occurs:
consul_1  |
consul_1  |     2016/06/24 02:15:20 [INFO] serf: EventMemberJoin: 6dd7183da9a7 192.168.42.2
consul_1  |     2016/06/24 02:15:20 [INFO] serf: EventMemberJoin: 6dd7183da9a7.dc1 192.168.42.2
consul_1  |     2016/06/24 02:15:20 [INFO] raft: Node at 192.168.42.2:8300 [Follower] entering Follower state
consul_1  |     2016/06/24 02:15:20 [INFO] consul: adding server 6dd7183da9a7 (Addr: 192.168.42.2:8300) (DC: dc1)
consul_1  |     2016/06/24 02:15:20 [INFO] consul: adding server 6dd7183da9a7.dc1 (Addr: 192.168.42.2:8300) (DC: dc1)
consul_1  |     2016/06/24 02:15:20 [ERR] agent: failed to sync remote state: No cluster leader
sms_1     | 2016/06/24 02:15:20 consul.watch: Watch (type: services) errored: Get http://127.0.0.1:8500/v1/catalog/services: dial tcp 127.0.0.1:8500: getsockopt: connection refused, retry in 5s

xigang avatar Jun 25 '16 03:06 xigang