If WSREP is turned off, the init script can't stop mysqld.
We can start the server, then turn off WSREP:
[gmontee@localhost ~]$ sudo service mysql bootstrap
|
Bootstrapping the cluster.. Starting MySQL.... [ OK ]
|
[gmontee@localhost ~]$ mysql -u root --execute="SET GLOBAL wsrep_on=OFF;"
|
Then try to stop the server, but it fails:
[gmontee@localhost ~]$ sudo service mysql stop
|
Shutting down MySQL..................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................[FAILED]..........................................
|
The process is still running:
[gmontee@localhost ~]$ ps -elf | grep "mysqld"
|
4 S root 6905 1 0 80 0 - 2868 wait 11:17 pts/1 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --wsrep-new-cluster
|
4 S mysql 7168 6905 0 80 0 - 230398 futex_ 11:17 pts/1 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --wsrep-provider=/usr/lib64/galera/libgalera_smm.so --wsrep-new-cluster --log-error=/var/lib/mysql/localhost.localdomain.err --pid-file=/var/lib/mysql/localhost.localdomain.pid --wsrep_start_position=5edc131e-ae0b-11e4-85d1-c2c0512e9e7e:4
|
0 S gmontee 9202 3464 0 80 0 - 25814 pipe_w 11:33 pts/1 00:00:00 grep mysqld
|
However, the server isn't usable:
[gmontee@localhost ~]$ mysql -u root
|
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
|
The error log:
[gmontee@localhost ~]$ sudo tail -n 20 /var/lib/mysql/localhost.localdomain.err
|
150318 11:17:54 InnoDB: Completed initialization of buffer pool
|
150318 11:17:54 InnoDB: highest supported file format is Barracuda.
|
150318 11:17:54 InnoDB: Waiting for the background threads to start
|
150318 11:17:55 Percona XtraDB (http://www.percona.com) 5.5.40-MariaDB-36.1 started; log sequence number 1604754
|
150318 11:17:55 [Note] Plugin 'FEEDBACK' is disabled.
|
150318 11:17:55 [Note] Server socket created on IP: '0.0.0.0'.
|
150318 11:17:55 [Note] Event Scheduler: Loaded 0 events
|
150318 11:17:55 [Note] /usr/sbin/mysqld: ready for connections.
|
Version: '5.5.41-MariaDB-wsrep' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server, wsrep_25.11.r4026
|
150318 11:17:55 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
|
150318 11:17:55 [Note] WSREP: REPL Protocols: 5 (3, 1)
|
150318 11:17:55 [Note] WSREP: Service thread queue flushed.
|
150318 11:17:55 [Note] WSREP: Assign initial position for certification: 4, protocol version: 3
|
150318 11:17:55 [Note] WSREP: Service thread queue flushed.
|
150318 11:17:55 [Note] WSREP: Synchronized with group, ready for connections
|
150318 11:17:55 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
|
150318 11:18:10 [Note] /usr/sbin/mysqld: Normal shutdown
|
|
150318 11:18:10 [Note] WSREP: rollbacker thread exiting
|
150318 11:18:10 [Note] Event Scheduler: Purging the queue. 0 events
|
I have to kill -9 the server to stop it:
[gmontee@localhost ~]$ sudo kill -9 7168
|
[gmontee@localhost ~]$ ps -elf | grep "mysqld"
|
0 S gmontee 9255 3464 0 80 0 - 25813 pipe_w 11:36 pts/1 00:00:00 grep mysqld
|
If I turn WSREP back on before attempting to shut down the server, everything works normally:
[gmontee@localhost ~]$ sudo service mysql bootstrap
|
Bootstrapping the cluster.. Starting MySQL.... [ OK ]
|
[gmontee@localhost ~]$ mysql -u root --execute="SET GLOBAL wsrep_on=OFF;"
|
[gmontee@localhost ~]$ mysql -u root --execute="SET GLOBAL wsrep_on=ON;"
|
[gmontee@localhost ~]$ sudo service mysql stop
|
Shutting down MySQL... [ OK ]
|
{"report":{"fcp":1822.5,"ttfb":588.0999999046326,"pageVisibility":"visible","entityId":50537,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"6673c7f7-776b-40f9-b676-fdea0080e1c1","navigationType":0,"readyForUser":1915.0999999046326,"redirectCount":0,"resourceLoadedEnd":2248.899999856949,"resourceLoadedStart":597.8999998569489,"resourceTiming":[{"duration":707.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":597.8999998569489,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":597.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1305.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":707.2000000476837,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true&whisper-enabled=true","startTime":598.2999999523163,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":598.2999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1305.5,"responseStart":0,"secureConnectionStart":0},{"duration":714.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":599.7000000476837,"connectEnd":599.7000000476837,"connectStart":599.7000000476837,"domainLookupEnd":599.7000000476837,"domainLookupStart":599.7000000476837,"fetchStart":599.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":599.7000000476837,"responseEnd":1314.3999998569489,"responseStart":1314.3999998569489,"secureConnectionStart":599.7000000476837},{"duration":797.0999999046326,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/494e4c556ecbb29f90a3d3b4f09cb99c/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true&whisper-enabled=true","startTime":600.5,"connectEnd":600.5,"connectStart":600.5,"domainLookupEnd":600.5,"domainLookupStart":600.5,"fetchStart":600.5,"redirectEnd":0,"redirectStart":0,"requestStart":600.5,"responseEnd":1397.5999999046326,"responseStart":1397.5999999046326,"secureConnectionStart":600.5},{"duration":800.7999999523163,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":600.7000000476837,"connectEnd":600.7000000476837,"connectStart":600.7000000476837,"domainLookupEnd":600.7000000476837,"domainLookupStart":600.7000000476837,"fetchStart":600.7000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":600.7000000476837,"responseEnd":1401.5,"responseStart":1401.5,"secureConnectionStart":600.7000000476837},{"duration":801.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":600.8999998569489,"connectEnd":600.8999998569489,"connectStart":600.8999998569489,"domainLookupEnd":600.8999998569489,"domainLookupStart":600.8999998569489,"fetchStart":600.8999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":600.8999998569489,"responseEnd":1402.0999999046326,"responseStart":1402.0999999046326,"secureConnectionStart":600.8999998569489},{"duration":801.7000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":601,"connectEnd":601,"connectStart":601,"domainLookupEnd":601,"domainLookupStart":601,"fetchStart":601,"redirectEnd":0,"redirectStart":0,"requestStart":601,"responseEnd":1402.7000000476837,"responseStart":1402.7000000476837,"secureConnectionStart":601},{"duration":881.8999998569489,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":601.2000000476837,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":601.2000000476837,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1483.0999999046326,"responseStart":0,"secureConnectionStart":0},{"duration":802.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":601.3999998569489,"connectEnd":601.3999998569489,"connectStart":601.3999998569489,"domainLookupEnd":601.3999998569489,"domainLookupStart":601.3999998569489,"fetchStart":601.3999998569489,"redirectEnd":0,"redirectStart":0,"requestStart":601.3999998569489,"responseEnd":1403.7000000476837,"responseStart":1403.5999999046326,"secureConnectionStart":601.3999998569489},{"duration":881.6000001430511,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":601.5999999046326,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":601.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1483.2000000476837,"responseStart":0,"secureConnectionStart":0},{"duration":807.2000000476837,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":601.7999999523163,"connectEnd":601.7999999523163,"connectStart":601.7999999523163,"domainLookupEnd":601.7999999523163,"domainLookupStart":601.7999999523163,"fetchStart":601.7999999523163,"redirectEnd":0,"redirectStart":0,"requestStart":601.7999999523163,"responseEnd":1409,"responseStart":1409,"secureConnectionStart":601.7999999523163},{"duration":1105.9000000953674,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":603.0999999046326,"connectEnd":603.0999999046326,"connectStart":603.0999999046326,"domainLookupEnd":603.0999999046326,"domainLookupStart":603.0999999046326,"fetchStart":603.0999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":603.0999999046326,"responseEnd":1709,"responseStart":1709,"secureConnectionStart":603.0999999046326},{"duration":1643.3999998569489,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":605.5,"connectEnd":605.5,"connectStart":605.5,"domainLookupEnd":605.5,"domainLookupStart":605.5,"fetchStart":605.5,"redirectEnd":0,"redirectStart":0,"requestStart":605.5,"responseEnd":2248.899999856949,"responseStart":2248.899999856949,"secureConnectionStart":605.5},{"duration":357.2000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1506.5999999046326,"connectEnd":1506.5999999046326,"connectStart":1506.5999999046326,"domainLookupEnd":1506.5999999046326,"domainLookupStart":1506.5999999046326,"fetchStart":1506.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":1506.5999999046326,"responseEnd":1863.7999999523163,"responseStart":1863.7999999523163,"secureConnectionStart":1506.5999999046326}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":411,"responseStart":588,"responseEnd":605,"domLoading":592,"domInteractive":2276,"domContentLoadedEventStart":2276,"domContentLoadedEventEnd":2339,"domComplete":2764,"loadEventStart":2764,"loadEventEnd":2764,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":2251.0999999046326},{"name":"bigPipe.sidebar-id.end","time":2252},{"name":"bigPipe.activity-panel-pipe-id.start","time":2252.2000000476837},{"name":"bigPipe.activity-panel-pipe-id.end","time":2254.399999856949},{"name":"activityTabFullyLoaded","time":2355.2999999523163}],"measures":[],"correlationId":"82269127e1e174","effectiveType":"4g","downlink":10,"rtt":0,"serverDuration":104,"dbReadsTimeInMs":11,"dbConnsTimeInMs":19,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
Attempting to stop the server via mysqladmin has the same effect:
[gmontee@localhost ~]$ sudo service mysql bootstrap
Bootstrapping the cluster.. Starting MySQL.... [ OK ]
[gmontee@localhost ~]$ mysql -u root --execute="SET GLOBAL wsrep_on=OFF;"
[gmontee@localhost ~]$ mysqladmin -u root shutdown
[gmontee@localhost ~]$ ps -elf | grep "mysqld"
4 S root 10122 1 0 80 0 - 2868 wait 11:58 pts/1 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/localhost.localdomain.pid --wsrep-new-cluster
4 S mysql 10385 10122 0 80 0 - 230472 futex_ 11:58 pts/1 00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --wsrep-provider=/usr/lib64/galera/libgalera_smm.so --wsrep-new-cluster --log-error=/var/lib/mysql/localhost.localdomain.err --pid-file=/var/lib/mysql/localhost.localdomain.pid --wsrep_start_position=5edc131e-ae0b-11e4-85d1-c2c0512e9e7e:4
0 S gmontee 10446 3464 0 80 0 - 25814 pipe_w 11:58 pts/1 00:00:00 grep mysqld
[gmontee@localhost ~]$ sudo tail -n 20 /var/lib/mysql/localhost.localdomain.err
150318 11:58:32 InnoDB: Completed initialization of buffer pool
150318 11:58:32 InnoDB: highest supported file format is Barracuda.
150318 11:58:32 InnoDB: Waiting for the background threads to start
150318 11:58:33 Percona XtraDB (http://www.percona.com) 5.5.40-MariaDB-36.1 started; log sequence number 1605062
150318 11:58:33 [Note] Plugin 'FEEDBACK' is disabled.
150318 11:58:33 [Note] Server socket created on IP: '0.0.0.0'.
150318 11:58:33 [Note] Event Scheduler: Loaded 0 events
150318 11:58:33 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.41-MariaDB-wsrep' socket: '/var/lib/mysql/mysql.sock' port: 3306 MariaDB Server, wsrep_25.11.r4026
150318 11:58:33 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
150318 11:58:33 [Note] WSREP: REPL Protocols: 5 (3, 1)
150318 11:58:33 [Note] WSREP: Service thread queue flushed.
150318 11:58:33 [Note] WSREP: Assign initial position for certification: 4, protocol version: 3
150318 11:58:33 [Note] WSREP: Service thread queue flushed.
150318 11:58:33 [Note] WSREP: Synchronized with group, ready for connections
150318 11:58:33 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
150318 11:58:47 [Note] /usr/sbin/mysqld: Normal shutdown
150318 11:58:47 [Note] WSREP: rollbacker thread exiting
150318 11:58:47 [Note] Event Scheduler: Purging the queue. 0 events
[gmontee@localhost ~]$ mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)