Thank you for your suggestion! Unfortunately I have problems with bootstrapping. The problem is that it can’t be bootstrap till mysql is alive. But I can’t stop/kill mysql because it waiting for something. I tried different ways to stop mysql but without success. Here is what I tried:
systemctl stop mysql
it fails.
killall -KILL mysql mysqld_safe mysqld
it kills mysql for about 2 seconds and them mysql is recreated. So, I have no time to use:
systemctl start mysql@bootstrap.service
Also I tried
kill -9 PID
and
kill -15 PID
The same result as with “killall -KILL”
Then I tried:
/usr/local/mysql/bin/mysqladmin -u root -p shutdown
It shows:
mysqladmin: connect to server at ‘localhost’ failed
error: ‘Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’ (2)’
Check that mysqld is running and that the socket: ‘/var/lib/mysql/mysql.sock’ exists!
I tried to start it with:
systemctl start mysql
But of course it doesn’t work if the full cluster aren’t connected together.
Then I tried:
/usr/bin/mysqld_multi stop
None output…
/usr/bin/mysqld_safe stop
2016-12-08T16:55:35.218919Z mysqld_safe Logging to ‘/var/log/mysqld.log’.
2016-12-08T16:55:35.239877Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2016-12-08T16:55:35.249570Z mysqld_safe Skipping wsrep-recover for 43de3d74-bca8-11e6-a178-57b39b925285:9 pair
2016-12-08T16:55:35.250808Z mysqld_safe Assigning 43de3d74-bca8-11e6-a178-57b39b925285:9 to wsrep_start_position
2016-12-08T16:55:36.470775Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
If we see log file. We will notice that after mysql stop it recovers (immortal mysql):
2016-12-08T16:56:13.471971Z 0 [Warning] WSREP: access file(/var/lib/mysql//gvwstate.dat) failed(No such file or directory)
2016-12-08T16:56:13.471980Z 0 [Note] WSREP: restore pc from disk failed
2016-12-08T16:56:13.472480Z 0 [Note] WSREP: GMCast version 0
2016-12-08T16:56:13.472706Z 0 [Note] WSREP: (3a0efa51, ‘tcp://0.0.0.0:4567’) listening at tcp://0.0.0.0:4567
2016-12-08T16:56:13.472717Z 0 [Note] WSREP: (3a0efa51, ‘tcp://0.0.0.0:4567’) multicast: , ttl: 1
2016-12-08T16:56:13.473082Z 0 [Note] WSREP: EVS version 0
2016-12-08T16:56:13.473168Z 0 [Note] WSREP: gcomm: bootstrapping new group ‘pxc-cluster’
2016-12-08T16:56:13.473208Z 0 [Note] WSREP: start_prim is enabled, turn off pc_recovery
2016-12-08T16:56:13.473317Z 0 [ERROR] WSREP: Address already in use
2016-12-08T16:56:13.473463Z 0 [ERROR] WSREP: failed to open gcomm backend connection: 98: error while trying to listen ‘tcp://0.0.0.0:4567?socket.non_blocking=1’, asio error ‘Address already in use’: 98 (Address already in use)
at gcomm/src/asio_tcp.cpp:listen():816
2016-12-08T16:56:13.473479Z 0 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -98 (Address already in use)
2016-12-08T16:56:13.473527Z 0 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1407: Failed to open channel ‘pxc-cluster’ at ‘gcomm://192.168.0.120,192.168.0.121,192.168.0.122’: -98 (Address already in use)
2016-12-08T16:56:13.473537Z 0 [ERROR] WSREP: gcs connect failed: Address already in use
2016-12-08T16:56:13.473543Z 0 [ERROR] WSREP: wsrep::connect(gcomm://192.168.0.120,192.168.0.121,192.168.0.122) failed: 7
2016-12-08T16:56:13.473548Z 0 [ERROR] Aborting
2016-12-08T16:56:13.473559Z 0 [Note] Forcefully disconnecting 0 remaining clients
2016-12-08T16:56:13.473563Z 0 [Note] WSREP: Service disconnected.
2016-12-08T16:56:14.474088Z 0 [Note] WSREP: Some threads may fail to exit.
2016-12-08T16:56:14.474182Z 0 [Note] Binlog end
2016-12-08T16:56:14.474392Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2016-12-08T16:56:14.497916Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
2016-12-08T16:56:22.669108Z 0 [Note] WSREP: view((empty))
2016-12-08T16:56:22.669398Z 0 [ERROR] WSREP: failed to open gcomm backend connection: 110: failed to reach primary view: 110 (Connection timed out)
at gcomm/src/pc.cpp:connect():162
2016-12-08T16:56:22.669439Z 0 [ERROR] WSREP: gcs/src/gcs_core.cpp:gcs_core_open():208: Failed to open backend connection: -110 (Connection timed out)
2016-12-08T16:56:22.669843Z 0 [ERROR] WSREP: gcs/src/gcs.cpp:gcs_open():1407: Failed to open channel ‘pxc-cluster’ at ‘gcomm://192.168.0.120,192.168.0.121,192.168.0.122’: -110 (Connection timed out)
2016-12-08T16:56:22.669880Z 0 [ERROR] WSREP: gcs connect failed: Connection timed out
2016-12-08T16:56:22.669900Z 0 [ERROR] WSREP: wsrep::connect(gcomm://192.168.0.120,192.168.0.121,192.168.0.122) failed: 7
2016-12-08T16:56:22.669912Z 0 [ERROR] Aborting
2016-12-08T16:56:22.669938Z 0 [Note] Forcefully disconnecting 0 remaining clients
2016-12-08T16:56:22.669951Z 0 [Note] WSREP: Service disconnected.
2016-12-08T16:56:23.673653Z 0 [Note] WSREP: Some threads may fail to exit.
2016-12-08T16:56:23.673688Z 0 [Note] Binlog end
2016-12-08T16:56:23.673800Z 0 [Note] /usr/sbin/mysqld: Shutdown complete
2016-12-08T16:56:23.689228Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
2016-12-08T16:56:23.764524Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2016-12-08T16:56:23.773417Z mysqld_safe Skipping wsrep-recover for 43de3d74-bca8-11e6-a178-57b39b925285:9 pair
2016-12-08T16:56:23.774686Z mysqld_safe Assigning 43de3d74-bca8-11e6-a178-57b39b925285:9 to wsrep_start_position
2016-12-08T16:56:23.942531Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-12-08T16:56:23.943450Z 0 [Note] /usr/sbin/mysqld (mysqld 5.7.14-8-57-log) starting as process 20603 …
2016-12-08T16:56:23.945460Z 0 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use ‘–log-bin=GlusterDC1_1-bin’ to avoid this problem.
2016-12-08T16:56:23.945632Z 0 [Note] WSREP: Read nil XID from storage engines, skipping position init
2016-12-08T16:56:23.945643Z 0 [Note] WSREP: wsrep_load(): loading provider library ‘/usr/lib64/galera3/libgalera_smm.so’
2016-12-08T16:56:23.948918Z 0 [Note] WSREP: wsrep_load(): Galera 3.17(r447d194) by Codership Oy <info@codership.com> loaded successfully.
2016-12-08T16:56:23.948967Z 0 [Note] WSREP: CRC-32C: using hardware acceleration.
2016-12-08T16:56:23.949262Z 0 [Note] WSREP: Found saved state: 43de3d74-bca8-11e6-a178-57b39b925285:9
2016-12-08T16:56:23.949709Z 0 [Note] WSREP: Passing config to GCS: base_dir = /var/lib/mysql/; base_host = 192.168.0.120; base_port = 4567; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.join_retrans_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.user_send_window = 2; evs.view_forget_timeout = PT24H; gcache.dir = /var/lib/mysql/; gcache.keep_pages_count = 0; gcache.keep_pages_size = 0; gcache.mem_size = 0; gcache.name = /var/lib/mysql//galera.cache; gcache.page_size = 128M; gcache.size = 128M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.segment = 0; gmcast.version = 0; pc.announce_timeout = PT3S; pc.checksum = fa
2016-12-08T16:56:23.960759Z 0 [Note] WSREP: Service thread queue flushed.
2016-12-08T16:56:23.960806Z 0 [Note] WSREP: Assign initial position for certification: 9, protocol version: -1
2016-12-08T16:56:23.960822Z 0 [Note] WSREP: wsrep_sst_grab()
2016-12-08T16:56:23.960827Z 0 [Note] WSREP: Start replication
2016-12-08T16:56:23.960839Z 0 [Note] WSREP: Setting initial position to 43de3d74-bca8-11e6-a178-57b39b925285:9
2016-12-08T16:56:23.960944Z 0 [Note] WSREP: protonet asio version 0
2016-12-08T16:56:23.961054Z 0 [Note] WSREP: Using CRC-32C for message checksums.
2016-12-08T16:56:23.961091Z 0 [Note] WSREP: backend: asio
2016-12-08T16:56:23.961142Z 0 [Note] WSREP: gcomm thread scheduling priority set to other:0
Also I tried:
/usr/bin/mysql-systemd stop
SUCCESS! Stopping Percona XtraDB Cluster…
It is just words which mysql prints they mean nothing because mysql is still alive and broken.
ps -ef | grep ‘mysql’
root 22823 1 0 19:02 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr --wsrep-new-cluster
mysql 23236 22823 0 19:02 ? 00:00:01 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --wsrep-provider=/usr/lib64/galera3/libgalera_smm.so --wsrep-new-cluster --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock --wsrep_start_position=43de3d74-bca8-11e6-a178-57b39b925285:9
root 23519 3143 0 19:05 pts/0 00:00:00 grep --color=auto mysql