2017-12-06 9 views
0

私は領事のサーバをセットアップし、エージェントを2〜3日間すでに接続しようとしています。私はドッカーの作成を使用しています。領事の代理人を領事に繋ぐ

しかし、結合操作を実行した後、エージェントはメッセージ「エージェントは生きていないか到達不能です」を取得します。

はここにログです:

[email protected]:/app# consul agent -join 10.1.30.91 -data-dir=/tmp/consul 
==> Starting Consul agent... 
==> Joining cluster... 
Join completed. Synced with 1 initial agents 
==> Consul agent running! 
Version: 'v1.0.1' 
Node ID: '0e1adf74-462d-45a4-1927-95ed123f1526' 
Node name: 'e33a6127103f' 
Datacenter: 'dc1' (Segment: '') 
Server: false (Bootstrap: false) 
Client Addr: [127.0.0.1] (HTTP: 8500, HTTPS: -1, DNS: 8600) 
Cluster Addr: 172.17.0.2 (LAN: 8301, WAN: 8302) 
Encrypt: Gossip: false, TLS-Outgoing: false, TLS-Incoming: false 
==> Log data will now stream in as it occurs: 
2017/12/06 10:44:43 [INFO] serf: EventMemberJoin: e33a6127103f 172.17.0.2 
2017/12/06 10:44:43 [INFO] agent: Started DNS server 127.0.0.1:8600 (udp) 
2017/12/06 10:44:43 [INFO] agent: Started DNS server 127.0.0.1:8600 (tcp) 
2017/12/06 10:44:43 [INFO] agent: Started HTTP server on 127.0.0.1:8500 (tcp) 
2017/12/06 10:44:43 [INFO] agent: (LAN) joining: [10.1.30.91] 
2017/12/06 10:44:43 [INFO] serf: EventMemberJoin: consul1 172.19.0.2 2017/12/06 10:44:43 [INFO] consul: adding server consul1 (Addr: tcp/172.19.0.2:8300) (DC: dc1) 
2017/12/06 10:44:43 [INFO] agent: (LAN) joined: 1 Err: <nil> 
2017/12/06 10:44:43 [INFO] agent: started state syncer 
2017/12/06 10:44:43 [WARN] manager: No servers available 
2017/12/06 10:44:43 [ERR] agent: failed to sync remote state: No known Consul servers 
2017/12/06 10:44:54 [INFO] memberlist: Suspect consul1 has failed, no acks received 
2017/12/06 10:44:55 [ERR] consul: "Catalog.NodeServices" RPC failed to server 172.19.0.2:8300: rpc error getting client: failed to get conn: dial tcp <nil>->172.19.0.2:8300: i/o timeout 
2017/12/06 10:44:55 [ERR] agent: failed to sync remote state: rpc error getting client: failed to get conn: dial tcp <nil>->172.19.0.2:8300: i/o timeout 
2017/12/06 10:44:58 [INFO] memberlist: Marking consul1 as failed, suspect timeout reached (0 peer confirmations) 
2017/12/06 10:44:58 [INFO] serf: EventMemberFailed: consul1 172.19.0.2 
2017/12/06 10:44:58 [INFO] consul: removing server consul1 (Addr: tcp/172.19.0.2:8300) (DC: dc1) 
2017/12/06 10:45:05 [INFO] memberlist: Suspect consul1 has failed, no acks received 
2017/12/06 10:45:06 [WARN] manager: No servers available 
2017/12/06 10:45:06 [ERR] agent: Coordinate update error: No known Consul servers 
2017/12/06 10:45:12 [WARN] manager: No servers available 
2017/12/06 10:45:12 [ERR] agent: failed to sync remote state: No known Consul servers 
2017/12/06 10:45:13 [INFO] serf: attempting reconnect to consul1 172.19.0.2:8301 
2017/12/06 10:45:28 [WARN] manager: No servers available 
2017/12/06 10:45:28 [ERR] agent: failed to sync remote state: No known Consul servers 
2017/12/06 10:45:32 [WARN] manager: No servers available . ` 

私の設定は次のとおりです。 ドッカ - コンSERVER:

consul1: 
image: "consul.1.0.1" 
container_name: "consul1" 
hostname: "consul1" 
volumes: 
- ./consul/config:/config/ 
ports: 
- "8400:8400" 
- "8500:8500" 
- "8600:53" 
- "8300:8300" 
- "8301:8301" 
command: "agent -config-dir=/config -ui -server -bootstrap-expect 1" 

ヘルプ問題を解決してください。

答えて

0

私はあなたがこの

10.1.30.91を領事サーバ

  • "10.1.30.91 - データ-dirは=を/ tmp /領事-join領事剤" の間違ったIPアドレスを使用して考えますそれはあなたのホストアドレス/バーチャルボックスかもしれないドッキングコンテナーのIPではありません。

    consul-container ipを取得し、consul-agentコマンドに参加するために使用します。領事とエージェントがリンク

    https://dzone.com/articles/service-discovery-with-docker-and-consul-part-1

    に従ってくださいどのように機能するかについての詳細情報については

関連する問題