VCS cannot cleanly offline MySQL resource when using MyCnf in a non-default location
book
Article ID: 100033277
calendar_today
Updated On:
Description
Error Message
Messages similar to the excerpts found below are logged in VCS engine log.
With default logging (no additional debugging enabled):
2016/10/03 14:22:10 VCS NOTICE V-16-1-10300 Initiating Offline of Resource sql_db (Owner: Unspecified, Group: mysql_db) on System node101v
2016/10/03 14:22:12 VCS INFO V-16-1-10305 Resource sql_db (Owner: Unspecified, Group: mysql_db) is offline on node101v (VCS initiated)
2016/10/03 14:22:10 VCS DBG_5 MySQL:sql_db:offline: Stopping MySQL with Command [/usr/bin/mysqladmin] Args [--user=MySQLAdmin --password=auyhSuKmjNussiuPo shutdown]
2016/10/03 14:22:10 VCS DBG_5 MySQL:sql_db:offline:Sys:RunWithEnvCmdWithOutputWithTimeOut:Command line [/bin/su sgxsql -c '/usr/bin/mysqladmin --user=MySQLAdmin --XXXXXXXXXX=XXXXXXXXXX shutdown'] provided a non-zero exit code -- this does not necessarily indicate a problem... (Perl's OS error variable prior to the command-pipe close was [], and after the close was [] )
2016/10/03 14:22:10 VCS DBG_5 MySQL:sql_db:offline:VCSagentFW:messageEngineLog:[Warning: Using a XXXXXXXXX on the command line interface can be insecure.
^G/usr/bin/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!
]
2016/10/03 14:22:10 VCS NOTICE V-16-55031-20112 MySQL:sql_db:offline: Killed PIDs [21296 21297 21298 21846] Total killed: [4]
2016/10/03 14:22:10 VCS DBG_5 MySQL:sql_db:offline: Processes for this instance do not exist after shutdown
2016/10/03 14:22:10 VCS ERROR V-16-55031-20155 MySQL:sql_db:offline: Failed to offline resource
With additional debugging enabled:
2016/10/03 14:22:10 VCS NOTICE V-16-1-10300 Initiating Offline of Resource sql_db (Owner: Unspecified, Group: mysql_db) on System node101v
2016/10/03 14:22:12 VCS INFO V-16-1-10305 Resource sql_db (Owner: Unspecified, Group: mysql_db) is offline on node101v (VCS initiated)
2016/10/03 14:22:10 VCS NOTICE V-16-55031-20112 MySQL:sql_db:offline: Killed PIDs [21296 21297 21298 21846] Total killed: [4]
2016/10/03 14:22:10 VCS ERROR V-16-55031-20155 MySQL:sql_db:offline: Failed to offline resource
Cause
When my.cnf file (defined by MyCnf attribute in MySQL resource) is placed at a non-default location, the shutdown is not successful. It exits with the above-mentioned error. The current VCS MySQL agent uses the mysqladmin command, which expects the my.cnf file in a default location under the /var/lib/mysql directory. It does not provide for a non-default location of my.cnf file.
The example below is a resource configuration with a non-default location of my.cnf file:
MySQL sql_db (
ResLogLevel = TRACE
MySQLUser = sqluser
MySQLAdmin = MySQLAdmin
MySQLAdminPasswd @node101v = auyhSuKmjNussiuPo
MySQLAdminPasswd @nodel02v = aQPiKPpMQlQQoYQkSA
BaseDir = "/usr"
DataDir = "/data/mysql"
MyCnf = "/data/mysql/my.cnf"
HostName = dbl01c
)
Resolution
The current VCS MySQL agent (until VRTSmysql version 6.2.0.0) uses the following mysqladmin command whilst offlining the MySQL resource. This does not cater for a non-default location of my.cnf file:
/bin/su sgxsql -c '/usr/bin/mysqladmin --user=MySQLAdmin --XXXXXXXXXX=XXXXXXXXXX shutdown'
The MySQL agent is modified to provide for the above requirement. In the modified agent, we have:
- Added the --defaults-file option to the shutdown command in the Offline Entry Point (EP).
- Added the --defaults-file option to the status command in Second Level Monitoring (SLM).
The fix is available in the VRTSmysql package version 7.0.0.0 (for Linux only). Contact Veritas Support to obtain this package. The GA version of the modified agent package (for all platforms) will be included in VCS AgentPack 4Q2016 (scheduled for first week of Jan 2017).
Issue/Introduction
VCS (Veritas Cluster Server) cannot cleanly offline a MySQL resource when using MyCnf in a non-default location.
With additional debugging enabled for the MySQL agent/resource, a socket error may be returned by the mysqladmin command, in the VCS engine log.
Was this article helpful?
thumb_up
Yes
thumb_down
No