代码改变世界

etcd启动报错:couldn't find local name "default" in the initial cluster configuration

  abce  阅读(7091)  评论(0编辑  收藏  举报

启动etcd的时候报错:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# 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.

  

检查配置文件:

1
2
3
4
5
6
7
8
9
10
11
#[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"

  

可以看到:

1
2
ETCD_NAME="default"
ETCD_INITIAL_CLUSTER="etcd0=http://8.8.8.8:2380"

 

这里参数配置不一致。改成一致就可以了。

编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2017-11-28 Keepalived源码安装
点击右上角即可分享
微信分享提示