Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
法兰绒和docker don';开始_Docker_Kubernetes_Etcd_Flannel - Fatal编程技术网

法兰绒和docker don';开始

法兰绒和docker don';开始,docker,kubernetes,etcd,flannel,Docker,Kubernetes,Etcd,Flannel,我正在尝试在centos 7.1的2个节点上建立kubernetes群集。但是,当我尝试在仆从身上启动服务时,如下所示: for SERVICES in kube-proxy kubelet docker flanneld; do systemctl restart $SERVICES systemctl enable $SERVICES systemctl status $SERVICES done 我得到以下错误: -- Logs begin at Wed 201

我正在尝试在centos 7.1的2个节点上建立kubernetes群集。但是,当我尝试在仆从身上启动服务时,如下所示:

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时,安装似乎是最困难的一点:(

今天的圣诞节,但我花了一整天的时间试图让它工作:)这就是我所做的:

#1件法兰绒 如前所述,我在主机上设置了法兰绒etcd键:

etcdctl mk/coreos.com/network/config'{“network”:“172.17.0.0/16”}

但我在试着在仆从身上启动法兰绒时犯了这个错误:

检索网络配置失败:100:找不到密钥(/atomic.io)

因此,我从以下位置编辑了仆从上的
/etc/sysconfig/flanneld
文件:

# Flanneld configuration options  

# etcd url location.  Point this to the server where etcd runs
FLANNEL_ETCD="http://master: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=""

to:

# Flanneld configuration options  

# etcd url location.  Point this to the server where etcd runs
FLANNEL_ETCD="http://master:2379"

# etcd config key.  This is the configuration key that flannel queries
# For address range assignment
FLANNEL_ETCD_KEY="/atomic.io/network"

# Any additional options that you want to pass
#FLANNEL_OPTIONS=""
i、 e.换了法兰绒钥匙

在此之后,
systemctl启动法兰盘工作

#2码头工人 我没有找到方法使kubernetes作为依赖项安装的版本正常工作,因此我卸载了它,并遵循Centos docker docs安装的docker engine,并手动为systemctl创建了docker.service文件

cd/usr/lib/systemd/system

以及docker.service的内容:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target docker.socket
Requires=docker.socket
Requires=flanneld.service
After=flanneld.service

[Service]
EnvironmentFile=/etc/sysconfig/flanneld
ExecStart=/usr/bin/docker daemon -H fd:// --bip=${FLANNEL_SUBNET}
Restart=on-failure
RestartSec=5


[Install]
WantedBy=multi-user.target
然后使用systemctl启动并启用守护进程,并查询状态

systemctl restart docker
systemctl enable docker
systemctl status docker

如果您查看错误消息,它不会在
/coreos.com
下查看;它似乎在
/atomic.io
找不到键(/atomic.io)
True.下面是minion
etcd配置键上配置文件的摘录。这是flannel查询的配置键#地址范围分配flannel_ETCD_key=“/atomic.io/network”
我是否在此处更改它?我正在使用centos。您可以在
/etc/sysconfig/flanneld
中更改
FLANNEL\u ETCD\u键的值,也可以在
ETCD
中创建适当的路径。您确定正在使用当前的CentOS原子映像吗?在我的环境中(CentOS 7 atomic;
rpm ostree status
表示
7.20151118
),
FLANNEL_ETCD_KEY
已设置为
“/coreos.com/network”
。我没有rpm ostree status命令。。我的文件现在看起来像
\Flanneld configuration options\ETCD url位置。将此指向etcd运行FLANNEL_etcd=”的服务器http://x.x.x.x:2379“#etcd配置键。这是flannel查询的配置键#地址范围分配flannel_ETCD_key=“/coreos.com/network”#要传递的任何其他选项#flannel_options=“”
但是,flannel仍然失败,但出现了另一个错误:`未能检索网络配置:顶级值后面的字符'e'无效`我一直在处理同一个问题。Severlnines.com的指令似乎依赖于更多的存储空间;我在centos guests in virtual box中尝试了这一点,docker启动失败,因为docker存储安装失败,因为它无法创建逻辑卷来保存docker映像。由于我使用的是virtual box,所以我只创建了更大(12GB)的centos来宾,这很管用。然后我陷入了法兰绒问题。看起来他们对法兰布配置的设置是错误的。你找的钱帮我搞定了。不,说得太早了。12GB虚拟机不够大。知道我应该做多大吗?我不认为存储是一个问题,我可以通过卸载现有的docker包(通过yum install docker安装)并按照docker文档安装docker引擎来让kubernetes工作。然后将服务文件值与上面的值进行交换。我确实发现,将参数
--storage opt=“dm.blocksize=64k”
添加到
docker daemon
命令中修复了它。从…起