首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >etcd2在我的CoreOS节点上启动失败

etcd2在我的CoreOS节点上启动失败
EN

Server Fault用户
提问于 2015-09-20 18:13:17
回答 2查看 4.4K关注 0票数 3

我正试图在我的etcd2节点中启动CoreOS。

我的云配置中有这样的内容:

代码语言:javascript
复制
coreos:
  etcd2:
    discovery: https://discovery.etcd.io/new?size=1
    advertise-client-urls: http://127.0.0.1:2379,http://127.0.0.1:4001
    initial-advertise-peer-urls: http://127.0.0.1:2380
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
    listen-peer-urls: http://127.0.0.1:2380

安装之后,当我启动系统时,会得到错误(根据日志):

etcdmain:顶级值后面的无效字符'p‘

etcd2也没能启动。

那是什么意思?我遵循了https://coreos.com/os/docs/latest/cloud-config.htmlhttps://coreos.com/os/docs/latest/cluster-discovery.html的指南。

编辑

节点1

代码语言:javascript
复制
coreos:
  etcd2:
    name: coreos1
    discovery: https://discovery.etcd.io/2d585793b364cf8985ca7a983d6c52e3
    advertise-client-urls: http://127.0.0.1:2379,http://127.0.0.1:4001
    initial-advertise-peer-urls: http://127.0.0.1:2380
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
    listen-peer-urls: http://127.0.0.1:2380

节点2

代码语言:javascript
复制
coreos:
  etcd2:
    name: coreos2
    discovery: https://discovery.etcd.io/2d585793b364cf8985ca7a983d6c52e3
    advertise-client-urls: http://127.0.0.1:2379,http://127.0.0.1:4001
    initial-advertise-peer-urls: http://127.0.0.1:2380
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
    listen-peer-urls: http://127.0.0.1:2380

coreos1>日志-u etcd2:

代码语言:javascript
复制
Sep 21 20:10:31 coreos1 etcd2[671]: 2015/09/21 20:10:31 discovery: found self e276d5b4c276a19d in the cluster
Sep 21 20:10:31 coreos1 etcd2[671]: 2015/09/21 20:10:31 discovery: found 1 peer(s), waiting for 1 more
Sep 21 20:11:31 coreos1 etcd2[671]: 2015/09/21 20:11:31 discovery: error #0: client: etcd member https://discovery.etcd.io returns server error [Gateway Timeout]
Sep 21 20:11:31 coreos1 etcd2[671]: 2015/09/21 20:11:31 discovery: waiting for other nodes: error connecting to https://discovery.etcd.io, retrying in 8m32s

coreos2>日志-u etcd2:

代码语言:javascript
复制
Sep 21 20:11:43 coreos2 systemd[1]: Starting etcd2...
Sep 21 20:11:43 coreos2 etcd2[1515]: 2015/09/21 20:11:43 etcdmain: etcd Version: 2.1.2
Sep 21 20:11:43 coreos2 etcd2[1515]: 2015/09/21 20:11:43 etcdmain: Git SHA: ff8d1ec
Sep 21 20:11:43 coreos2 etcd2[1515]: 2015/09/21 20:11:43 etcdmain: Go Version: go1.4.2
Sep 21 20:11:43 coreos2 etcd2[1515]: 2015/09/21 20:11:43 etcdmain: Go OS/Arch: linux/amd64
Sep 21 20:11:43 coreos2 etcd2[1515]: 2015/09/21 20:11:43 etcdmain: setting maximum number of CPUs to 1, total number of available CPUs is 1
Sep 21 20:11:43 coreos2 etcd2[1515]: 2015/09/21 20:11:43 etcdmain: listening for peers on http://127.0.0.1:2380
Sep 21 20:11:43 coreos2 etcd2[1515]: 2015/09/21 20:11:43 etcdmain: listening for client requests on http://0.0.0.0:2379
Sep 21 20:11:43 coreos2 etcd2[1515]: 2015/09/21 20:11:43 etcdmain: listening for client requests on http://0.0.0.0:4001
Sep 21 20:11:45 coreos2 etcd2[1515]: 2015/09/21 20:11:45 etcdmain: stopping listening for client requests on http://0.0.0.0:4001
Sep 21 20:11:45 coreos2 etcd2[1515]: 2015/09/21 20:11:45 etcdmain: stopping listening for client requests on http://0.0.0.0:2379
Sep 21 20:11:45 coreos2 etcd2[1515]: 2015/09/21 20:11:45 etcdmain: stopping listening for peers on http://127.0.0.1:2380
Sep 21 20:11:45 coreos2 etcd2[1515]: 2015/09/21 20:11:45 etcdmain: member "core2" has previously registered with discovery service token (https://discovery.etcd.io/2d585793b364cf8985ca7a983d6c52e3).
Sep 21 20:11:45 coreos2 etcd2[1515]: 2015/09/21 20:11:45 etcdmain: But etcd could not find vaild cluster configuration in the given data dir (/var/lib/etcd2).
Sep 21 20:11:45 coreos2 etcd2[1515]: 2015/09/21 20:11:45 etcdmain: Please check the given data dir path if the previous bootstrap succeeded
Sep 21 20:11:45 coreos2 etcd2[1515]: 2015/09/21 20:11:45 etcdmain: or use a new discovery token if the previous bootstrap failed.
Sep 21 20:11:45 coreos2 systemd[1]: etcd2.service: Main process exited, code=exited, status=1/FAILURE
Sep 21 20:11:45 coreos2 systemd[1]: etcd2.service: Unit entered failed state.
Sep 21 20:11:45 coreos2 systemd[1]: etcd2.service: Failed with result 'exit-code'.
EN

回答 2

Server Fault用户

回答已采纳

发布于 2015-09-21 09:10:14

您的发现URL是不正确的- URL https://discovery.etcd.io/new?size=1用于获取您可以在配置中使用的新发现URL。手动做一次,例如用卷曲:

代码语言:javascript
复制
curl --silent -H "Accept: text/plain" https://discovery.etcd.io/new?size=1

这将返回如下URL:

代码语言:javascript
复制
https://discovery.etcd.io/a93e30ebf9375f2385fef54c83b2840d

这是一个类似的URL,应该是您的发现URL。每当您构建新集群时,始终使用新的发现URL。

票数 6
EN

Server Fault用户

发布于 2015-09-20 22:35:02

如果这是完整的cloud-config.yml文件,那么它就错了。

文件的第一行需要:

代码语言:javascript
复制
#cloud-config

代码语言:javascript
复制
#cloud-config

coreos:
  etcd2:
    discovery: https://discovery.etcd.io/new?size=1
    advertise-client-urls: http://127.0.0.1:2379,http://127.0.0.1:4001
    initial-advertise-peer-urls: http://127.0.0.1:2380
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
    listen-peer-urls: http://127.0.0.1:2380

此外,

在从网站复制云配置时要小心。我在结果输出文件中隐藏了一些奇怪的字符,这些字符导致解析器错误并导致失败!

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/723620

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档