创建wordpress容器失败,自动停止,又启动
来源:7-4 在swarm集群里通过service部署wordpress
精慕门8459013
2018-10-31
老师,您好,我在manager上面创建了网络,然后创建mysql容器,没有问题。
但是当在创建wordpress容器的时候,就失败。
然后我在manager上ping mysql也是ping不通的。求指导。
[vagrant@swarm-manager ~]$ docker service ps mysql
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
o2rqvg37mi70 mysql.1 mysql:latest swarm-worker1 Running Running 7 minutes ago
[vagrant@swarm-manager ~]$ docker service ps wordpress
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
dry08zd5eq51 wordpress.1 wordpress:latest swarm-worker2 Running Running 17 seconds ago
yxivuadvqbpq _ wordpress.1 wordpress:latest swarm-worker2 Shutdown Failed 23 seconds ago "task: non-zero exit (1)"
xzs1t70ftxbh _ wordpress.1 wordpress:latest swarm-manager Shutdown Failed 2 minutes ago "task: non-zero exit (1)"
woswpi4kd6a5 _ wordpress.1 wordpress:latest swarm-manager Shutdown Failed 2 minutes ago "task: non-zero exit (1)"
piucm6stbtzx _ wordpress.1 wordpress:latest swarm-manager Shutdown Failed 3 minutes ago "task: non-zero exit (1)"
[vagrant@swarm-manager ~]$
5回答
-
精慕门8459013
提问者
2018-11-06
老师 ,您真神了,换了一个mysql5.7 就好了。。 佩服,如果方便可否拜在您的门下,哈哈。
我的QQ 894747821 如果方便还请加一下
022018-11-08 -
精慕门8459013
提问者
2018-11-05
老师,您好,我的这个文字可能比较多,还请您耐心阅读。
我就是先创建的test的网络,然后在创建的mysql service 最后创建的wordpress service ,
我通过docker service log wordpress 发现是wordpress连接数据库失败,报错如下。
rdpress.1.c6k8v37i73se@swarm-manager | MySQL Connection Error: (2054) The server requested authentication method unknown to the client wordpress.1.c6k8v37i73se@swarm-manager | wordpress.1.luuaclvshrny@swarm-manager | MySQL Connection Error: (2054) The server requested authentication method unknown to the client wordpress.1.luuaclvshrny@swarm-manager | wordpress.1.c6k8v37i73se@swarm-manager | Warning: mysqli::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in Standard input code on line 22 wordpress.1.c6k8v37i73se@swarm-manager | wordpress.1.luuaclvshrny@swarm-manager | Warning: mysqli::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] in Standard input code on line 22 wordpress.1.luuaclvshrny@swarm-manager | wordpress.1.c6k8v37i73se@swarm-manager | Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in Standard input code on line 22 wordpress.1.c6k8v37i73se@swarm-manager | wordpress.1.luuaclvshrny@swarm-manager | Warning: mysqli::__construct(): (HY000/2054): The server requested authentication method unknown to the client in Standard input code on line 22 wordpress.1.luuaclvshrny@swarm-manager | wordpress.1.c6k8v37i73se@swarm-manager | MySQL Connection Error: (2054) The server requested authentication method unknown to the client wordpress.1.luuaclvshrny@swarm-manager | MySQL Connection Error: (2054) The server requested authentication method unknown to the client
我的实验环境是这样的:
使用您提供的vagrantFile创建的三个容器,分别是
swarm-manager running (virtualbox) swarm-worker1 running (virtualbox) swarm-worker2 running (virtualbox)
然后在 在manager创建的docker swarm 然后在另外两个worker上加入的swarm
最后在manager上 创建的网络,再然后创建mysql 容器并指定创建的网络,我通过exec进入到mysql容器,可以正常登录到数据里里面,查看也有wordpress数据库,最后创建wordpress容器。
发现wordpress容器总是自己down掉。然后在启动。
我通过3个虚拟机ping mysql都ping不通,是不是因为我本地物理机网络问题呢?
012018-11-05 -
麦兜搞IT
2018-11-01
您那个test的网络最好先创建,然后再去创建mysql和wordpress的service,另外,您可以通过docker service logs 去看一下wordpress的log,看为啥会退出
00 -
精慕门8459013
提问者
2018-10-31
[vagrant@swarm-manager ~]$ docker service ps wordpress
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
nmzzj5g7lg38 wordpress.1 wordpress:latest swarm-worker1 Running Running 19 seconds ago
vybzoyfsw52p \_ wordpress.1 wordpress:latest swarm-worker1 Shutdown Failed 25 seconds ago "task: non-zero exit (1)"
9uwpg5hopg9a \_ wordpress.1 wordpress:latest swarm-worker2 Shutdown Failed 59 seconds ago "task: non-zero exit (1)"
[vagrant@swarm-manager ~]$
00 -
精慕门8459013
提问者
2018-10-31
还是不行,不知道为什么。我怀疑是不是网络的问题?
我直接写的ip,但是还是启动失败。
022018-10-31
相似问题