etcd启动报错:couldn't find local name "default" in the initial cluster configuration
2019-11-28 10:38 abce 阅读(7048) 评论(0) 编辑 收藏 举报启动etcd的时候报错:
# systemctl restart etcd Job for etcd.service failed because the control process exited with error code. See "systemctl status etcd.service" and "journalctl -xe" for details. # journalctl -xe Nov 28 10:26:07 mysql7 systemd[1]: Starting Etcd Server... -- Subject: Unit etcd.service has begun start-up -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit etcd.service has begun starting up. Nov 28 10:26:07 abce etcd[2598]: recognized and used environment variable ETCD_ADVERTISE_CLIENT_URLS=http://10.10.20.70:2379 Nov 28 10:26:07 abce etcd[2598]: recognized and used environment variable ETCD_INITIAL_ADVERTISE_PEER_URLS=http://8.8.8.8:2380 Nov 28 10:26:07 abce etcd[2598]: recognized and used environment variable ETCD_INITIAL_CLUSTER=etcd0=http://8.8.8.8:2380 Nov 28 10:26:07 abce etcd[2598]: recognized and used environment variable ETCD_INITIAL_CLUSTER_STATE=new Nov 28 10:26:07 abce etcd[2598]: recognized and used environment variable ETCD_INITIAL_CLUSTER_TOKEN=cluster1 Nov 28 10:26:07 abce etcd[2598]: recognized and used environment variable ETCD_LISTEN_PEER_URLS=http://8.8.8.8:2380 Nov 28 10:26:07 abce etcd[2598]: recognized environment variable ETCD_NAME, but unused: shadowed by corresponding flag Nov 28 10:26:07 abce etcd[2598]: recognized environment variable ETCD_LISTEN_CLIENT_URLS, but unused: shadowed by corresponding flag Nov 28 10:26:07 abce etcd[2598]: etcd Version: 3.3.11 Nov 28 10:26:07 abce etcd[2598]: Git SHA: 2cf9e51 Nov 28 10:26:07 abce etcd[2598]: Go Version: go1.10.3 Nov 28 10:26:07 abce etcd[2598]: Go OS/Arch: linux/amd64 Nov 28 10:26:07 abce etcd[2598]: setting maximum number of CPUs to 4, total number of available CPUs is 4 Nov 28 10:26:07 abce etcd[2598]: no data-dir provided, using default data-dir ./default.etcd Nov 28 10:26:07 abce etcd[2598]: the server is already initialized as member before, starting as etcd member... Nov 28 10:26:07 abce etcd[2598]: listening for peers on http://8.8.8.8:2380 Nov 28 10:26:07 abce etcd[2598]: listening for client requests on 8.8.8.8:2379 Nov 28 10:26:07 abce etcd[2598]: listening for client requests on localhost:2379 Nov 28 10:26:07 abce etcd[2598]: couldn't find local name "default" in the initial cluster configuration Nov 28 10:26:07 abce systemd[1]: etcd.service: main process exited, code=exited, status=1/FAILURE Nov 28 10:26:07 abce systemd[1]: Failed to start Etcd Server. -- Subject: Unit etcd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit etcd.service has failed. -- -- The result is failed. Nov 28 10:26:07 abce systemd[1]: Unit etcd.service entered failed state. Nov 28 10:26:07 abce systemd[1]: etcd.service failed. Nov 28 10:26:07 abce systemd[1]: etcd.service holdoff time over, scheduling restart. Nov 28 10:26:07 abce systemd[1]: start request repeated too quickly for etcd.service Nov 28 10:26:07 abce systemd[1]: Failed to start Etcd Server. -- Subject: Unit etcd.service has failed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- Unit etcd.service has failed. -- -- The result is failed. Nov 28 10:26:07 abce systemd[1]: Unit etcd.service entered failed state. Nov 28 10:26:07 abce systemd[1]: etcd.service failed.
检查配置文件:
#[Member] ETCD_LISTEN_PEER_URLS="http://8.8.8.8:2380" ETCD_LISTEN_CLIENT_URLS="http://localhost:2379,http://8.8.8.8:2379" ETCD_NAME="default" #[Clustering] ETCD_INITIAL_ADVERTISE_PEER_URLS="http://8.8.8.8:2380" ETCD_ADVERTISE_CLIENT_URLS="http://8.8.8.8:2379" ETCD_INITIAL_CLUSTER="etcd0=http://8.8.8.8:2380" ETCD_INITIAL_CLUSTER_TOKEN="cluster1" ETCD_INITIAL_CLUSTER_STATE="new"
可以看到:
ETCD_NAME="default" ETCD_INITIAL_CLUSTER="etcd0=http://8.8.8.8:2380"
这里参数配置不一致。改成一致就可以了。