how to restart node about docker version

I used the below commands to create 3 nodes cluster

docker pull percona/percona-xtradb-cluster:5.7
docker tag percona/percona-xtradb-cluster:5.7 pxc
docker network create --subnet= net1
docker run -d -p 33010:3306 -e MYSQL_ROOT_PASSWORD=root -e CLUSTER_NAME=pxc_cluster --name=pxc_node1 --net=pxc-network pxc
docker run -d -p 33011:3306 -e MYSQL_ROOT_PASSWORD=root -e CLUSTER_NAME=pxc_cluster -e CLUSTER_JOIN=pxc_node1 --name=pxc_node2 --net=pxc-network pxc
docker run -d -p 33012:3306 -e MYSQL_ROOT_PASSWORD=root -e CLUSTER_NAME=pxc_cluster -e CLUSTER_JOIN=pxc_node1 --name=pxc_node3 --net=pxc-network pxc

it success running.
but, when I stop one node container, docker stop pxc_node1
after I docker start pex_node1
it can’t start again success.
the logs below:

2018-08-26T03:37:50.980926Z 0 [Warning] WSREP: last inactive check more than PT1.5S (3*evs.inactive_check_period) ago (PT3.50266S), skipping check
2018-08-26T03:38:20.494172Z 0 [Note] WSREP: Current view of cluster as seen by this node
view ((empty))
2018-08-26T03:38:20.495190Z 0 [ERROR] WSREP: failed to open gcomm backend connection: 110: failed to reach primary view (pc.wait_prim_timeout): 110 (Connection timed out)
at gcomm/src/pc.cpp:connect():159
2018-08-26T03:38:20.495304Z 0 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out)
2018-08-26T03:38:20.495463Z 0 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1514: Failed to open channel ‘cluster1’ at ‘gcomm://pxc_node1’: -110 (Connection timed out)
2018-08-26T03:38:20.495561Z 0 [ERROR] WSREP: gcs connect failed: Connection timed out
2018-08-26T03:38:20.495621Z 0 [ERROR] WSREP: Provider/Node (gcomm://pxc_node1) failed to establish connection with cluster (reason: 7)
2018-08-26T03:38:20.495701Z 0 [ERROR] Aborting

2018-08-26T03:38:20.495795Z 0 [Note] Giving 0 client threads a chance to die gracefully
2018-08-26T03:38:20.495871Z 0 [Note] WSREP: Waiting for active wsrep applier to exit
2018-08-26T03:38:20.495972Z 0 [Note] WSREP: Service disconnected.
2018-08-26T03:38:20.496274Z 0 [Note] WSREP: Waiting to close threads…
2018-08-26T03:38:25.496469Z 0 [Note] WSREP: Some threads may fail to exit.
2018-08-26T03:38:25.496619Z 0 [Note] Binlog end

can anybody help me ? thanks in advance!

First of all, the commands above do not look like exact copy/paste of real session, as there are typos and mismatches. For instance:

docker network create --subnet= net1

has an extra dot, making the address wrong.
And docker run commands use another network name then created before:


Anyway, as the bootstrapped node has this line without addresses:


you can’t just restart it as if it was normal service on a non-docker instance.

So, as you stop the first node but two other keep running, instead of restarting it (docker start does not accept needed variables), you may actually remove and re-run the first one like this:

# docker rm pxc_node1

# docker run -d -p 33010:3306 -e MYSQL_ROOT_PASSWORD=root -e CLUSTER_NAME=pxc_cluster -e CLUSTER_JOIN=pxc_node2 --name=pxc_node1 --net=net1 pxc

# docker exec -it pxc_node1 mysql -uroot -proot -e "show status like 'wsrep_cluster_size'"
mysql: [Warning] Using a password on the command line interface can be insecure.
| Variable_name | Value |
| wsrep_cluster_size | 3 |

Hope that helps.

thanks przemek, it works! i typed the wrong network name. thank you very much.