【发布时间】:2016-03-30 02:57:49
【问题描述】:
我正在尝试使用guide 在 2 个节点 centos 7.1 上建立一个 kubernetes 集群。但是,当我尝试像这样在 minion 上启动服务时:
for SERVICES in kube-proxy kubelet docker flanneld; do
systemctl restart $SERVICES
systemctl enable $SERVICES
systemctl status $SERVICES
done
我收到以下错误:
-- Logs begin at Wed 2015-12-23 13:00:41 UTC, end at Wed 2015-12-23 16:03:54 UTC. --
Dec 23 16:03:47 sc-test2 systemd[1]: docker-storage-setup.service: main process exited, code=exited, status=1/FAILURE
Dec 23 16:03:47 sc-test2 systemd[1]: Failed to start Docker Storage Setup.
-- Subject: Unit docker-storage-setup.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit docker-storage-setup.service has failed.
--
-- The result is failed.
Dec 23 16:03:47 sc-test2 systemd[1]: Unit docker-storage-setup.service entered failed state.
Dec 23 16:03:48 sc-test2 flanneld[36477]: E1223 16:03:48.187350 36477 network.go:53] Failed to retrieve network config: 100: Key not found (/atomic.io)
Dec 23 16:03:49 sc-test2 flanneld[36477]: E1223 16:03:49.189860 36477 network.go:53] Failed to retrieve network config: 100: Key not found (/atomic.io)
Dec 23 16:03:50 sc-test2 flanneld[36477]: E1223 16:03:50.192894 36477 network.go:53] Failed to retrieve network config: 100: Key not found (/atomic.io)
Dec 23 16:03:51 sc-test2 flanneld[36477]: E1223 16:03:51.194940 36477 network.go:53] Failed to retrieve network config: 100: Key not found (/atomic.io)
Dec 23 16:03:52 sc-test2 flanneld[36477]: E1223 16:03:52.197222 36477 network.go:53] Failed to retrieve network config: 100: Key not found (/atomic.io)
Dec 23 16:03:53 sc-test2 flanneld[36477]: E1223 16:03:53.199248 36477 network.go:53] Failed to retrieve network config: 100: Key not found (/atomic.io)
Dec 23 16:03:54 sc-test2 flanneld[36477]: E1223 16:03:54.201160 36477 network.go:53] Failed to retrieve network config: 100: Key not found (/atomic.io)
我确定我在主服务器上设置了密钥: etcdctl mk /coreos.com/network/config '{"Network":"172.17.0.0/16"}'
到目前为止,安装似乎是使用 kubernetes 最难的部分:(
【问题讨论】:
-
如果您查看错误消息,它不是在
/coreos.com下查看;它似乎正在查看/atomic.io:Key not found (/atomic.io) -
True..这是从小兵
# etcd config key. This is the configuration key that flannel queries # For address range assignment FLANNEL_ETCD_KEY="/atomic.io/network"上的配置文件的摘录 -
我要在这里更改吗?我正在使用 centos..
-
您可以在
/etc/sysconfig/flanneld中更改FLANNEL_ETCD_KEY的值,也可以在etcd中创建适当的路径。您确定您使用的是当前的 CentOS 原子映像吗?在我的环境中(CentOS 7 atomic;rpm-ostree status表示7.20151118),FLANNEL_ETCD_KEY已经设置为"/coreos.com/network"。 -
我没有 rpm-ostree 状态命令..我的文件现在看起来像
# Flanneld configuration options # etcd url location. Point this to the server where etcd runs FLANNEL_ETCD="http://x.x.x.x:2379" # etcd config key. This is the configuration key that flannel queries # For address range assignment FLANNEL_ETCD_KEY="/coreos.com/network" # Any additional options that you want to pass #FLANNEL_OPTIONS=""但是 flannel 仍然失败但出现不同的错误:` 无法检索网络配置:无效字符 'e ' 在顶级值之后`
标签: docker kubernetes etcd flannel