zun 不能创建 docker 容器,报错: datastore for scope "global" is not initialized
问题:zun不能创建docker容器,报错:datastore for scope "global" is not initialized
解决:修改docker 服务配置文件:
[root@node-172-19-15-230 ~]# cat /usr/lib/systemd/system/docker.service
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network.target firewalld.service
[Service]
Type=notify
ExecStart=/usr/bin/dockerd --insecure-registry 172.19.15.95:4000 -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster-advertise 172.19.15.230:2375 --cluster-store etcd://172.19.15.230:2379
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TimeoutStartSec=0
Delegate=yes
KillMode=process
MountFlags=shared
[Install]
WantedBy=multi-user.target
在文件中增加:
-H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock --cluster-advertise 172.19.15.230:2375 --cluster-store etcd://172.19.15.230:2379
同时需要 etcd 服务用来存储数据的