etcd cluster搭建不成功

来源:4-1 本章概述和实验环境介绍

Louis0o

2019-04-11

docker-node1容器中:

[vagrant@docker-node1 flask-redis]$ ls
app.py  Dockerfile  etcd-v3.0.12-linux-amd64  etcd-v3.0.12-linux-amd64.tar.gz  multi-host-network.md  nohup.out
[vagrant@docker-node1 flask-redis]$ cd etcd-v3.0.12-linux-amd64/
[vagrant@docker-node1 etcd-v3.0.12-linux-amd64]$ ls
--advertise-client-urls  Documentation  etcdctl            --initial-cluster-token  --listen-peer-urls  README-etcdctl.md  READMEv2-etcdctl.md
docker-node1.etcd        etcd           --initial-cluster  --listen-client-urls     nohup.out           README.md
[vagrant@docker-node1 etcd-v3.0.12-linux-amd64]$ nohup ./etcd --name docker-node1 --initial-advertise-peer-urls http://192.168.205.10:2380 --listen-peer-urls http://192.168.205.10:2380 --listen-client-urls http://192.168.205.10:2379,http://127.0.0.1:2379 --advertise-client-urls http://192.168.205.10:2379 --initial-cluster-token etcd-cluster --initial-cluster docker-node1=http://192.168.205.10:2380,docker-node2=http://192.168.205.11:2380 --initial-cluster-state new&
[1] 6364
[vagrant@docker-node1 etcd-v3.0.12-linux-amd64]$ nohup: ignoring input and appending output to ‘nohup.out’

[1]+  Exit 2                  nohup ./etcd --name docker-node1 --initial-advertise-peer-urls http://192.168.205.10:2380 --listen-peer-urls http://192.168.205.10:2380 --listen-client-urls http://192.168.205.10:2379,http://127.0.0.1:2379 --advertise-client-urls http://192.168.205.10:2379 --initial-cluster-token etcd-cluster --initial-cluster docker-node1=http://192.168.205.10:2380,docker-node2=http://192.168.205.11:2380 --initial-cluster-state new
[vagrant@docker-node1 etcd-v3.0.12-linux-amd64]$ ./etcdctl cluster-health
cluster may be unhealthy: failed to list members
Error:  client: etcd cluster is unavailable or misconfigured
error #0: dial tcp 127.0.0.1:2379: getsockopt: connection refused
error #1: dial tcp 127.0.0.1:4001: getsockopt: connection refused

[vagrant@docker-node1 etcd-v3.0.12-linux-amd64]$ sudo systemctl status firewalld.service 
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

docker-node2容器中

[vagrant@docker-node2 flask-redis]$ ls
app.py  Dockerfile  etcd-v3.0.12-linux-amd64  etcd-v3.0.12-linux-amd64.tar.gz  multi-host-network.md  nohup.out
[vagrant@docker-node2 flask-redis]$ cd etcd-v3.0.12-linux-amd64/
[vagrant@docker-node2 etcd-v3.0.12-linux-amd64]$ nohup ./etcd --name docker-node2 --initial-advertise-peer-urls http://192.168.205.11:2380 --listen-peer-urls http://192.168.205.11:2380 --listen-client-urls http://192.168.205.11:2379,http://127.0.0.1:2379 --advertise-client-urls http://192.168.205.11:2379 --initial-cluster-token etcd-cluster --initial-cluster docker-node1=http://192.168.205.10:2380,docker-node2=http://192.168.205.11:2380 --initial-cluster-state new&
[2] 6066
[vagrant@docker-node2 etcd-v3.0.12-linux-amd64]$ nohup: ignoring input and appending output to ‘nohup.out’

[2]+  Exit 1                  nohup ./etcd --name docker-node2 --initial-advertise-peer-urls http://192.168.205.11:2380 --listen-peer-urls http://192.168.205.11:2380 --listen-client-urls http://192.168.205.11:2379,http://127.0.0.1:2379 --advertise-client-urls http://192.168.205.11:2379 --initial-cluster-token etcd-cluster --initial-cluster docker-node1=http://192.168.205.10:2380,docker-node2=http://192.168.205.11:2380 --initial-cluster-state new
[vagrant@docker-node2 etcd-v3.0.12-linux-amd64]$ sudo systemctl status firewalld.service 
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:firewalld(1)

两个机器的防火墙是关闭的。为什么搭建不成功?老师,求教。

写回答

1回答

麦兜搞IT

2019-04-12

我看您的etcd是没有运行成功的,[1]+  Exit 2    您可以看看nohup: ignoring input and appending output to ‘nohup.out’
 这个nohup.out的的错误log信息

0
0

系统学习Docker 践行DevOps理念

无论你是开发、测试还是运维,Docker都是你的必备技能。

3297 学习 · 1895 问题

查看课程