Hi folks,
Today I encoutered some difficulties to use mysql resource in a
semi-synchronous replication with MySQL and corosync. As you probably know to
use semi-synchronous replication, mysql plugins are mandatory.
If you try to start mysql without specifying the mysql base directory (basedir)
you will get some error messages and mysql will shutdown immediately as
demonstrated below
[root@mysql-qual1 heartbeat]# /u00/app/mysql/product/mysql-5.5.15/bin/mysqld
--defaults-file=/etc/my.cnf
--pid_file=/u00/app/mysql/admin/mysqld1/socket/mysqld1.pid
--socket=/u00/app/mysql/admin/mysqld1/socket/mld1.sock
--datadir=/u01/mysqldata/mysqld1 --user=mysql --port=33001
110816 18:16:32 [ERROR] Can't find messagefile
'/usr/local/mysql/share/errmsg.sys'
110816 18:16:32 [Note] Plugin 'FEDERATED' is disabled.
110816 18:16:32 [ERROR]
110816 18:16:32 [Warning] Couldn't load plugin named 'rpl_semi_sync_master'
with soname 'semisync_master.so'.
110816 18:16:32 [ERROR]
110816 18:16:32 [Warning] Couldn't load plugin named 'rpl_semi_sync_slave' with
soname 'semisync_slave.so'.
110816 18:16:32 InnoDB: The InnoDB memory heap is disabled
110816 18:16:32 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110816 18:16:32 InnoDB: Compressed tables use zlib 1.2.3
110816 18:16:32 InnoDB: Using Linux native AIO
110816 18:16:32 InnoDB: Initializing buffer pool, size = 128.0M
110816 18:16:32 InnoDB: Completed initialization of buffer pool
110816 18:16:32 InnoDB: highest supported file format is Barracuda.
110816 18:16:32 InnoDB: Waiting for the background threads to start
110816 18:16:33 InnoDB: 1.1.8 started; log sequence number 1682335
110816 18:16:33 [ERROR] Aborting
110816 18:16:33 InnoDB: Starting shutdown...
110816 18:16:33 InnoDB: Shutdown completed; log sequence number 1682335
110816 18:16:33 [Note]
In order to solve this problem it is mandatory to set the basedir which is not
done in the file /usr/lib/ocf/resource.d/heartbeat/mysql. Otherwise your mysql
resource won't be able to start. Additionally it would be really clever to have
the possibility to set the port without using the "additional_parameters". I
made some tests by setting the two additional variables below and it's
perfectly working.
export OCF_RESKEY_binary=/u00/app/mysql/product/mysql-5.5.15/bin/mysqld
export OCF_RESKEY_client_binary=/u00/app/mysql/product/mysql-5.5.15/bin/mysql
export OCF_RESKEY_config=/u00/app/mysql/etc/my.cnf
export OCF_RESKEY_datadir=/u01/mysqldata/mysqld1
export OCF_RESKEY_user=mysql
export OCF_RESKEY_group=mysql
export OCF_RESKEY_test_table=mysql.user
export OCF_RESKEY_test_user=root
export OCF_RESKEY_test_passwd=manager
export OCF_RESKEY_log=/u00/app/mysql/admin/mysqld1/log/mysqld1.log
export OCF_RESKEY_pid=/u00/app/mysql/admin/mysqld1/socket/mysqld1.pid
export OCF_RESKEY_socket=/u00/app/mysql/admin/mysqld1/socket/mysqld1.sock
export OCF_RESKEY_port=33001
export OCF_RESKEY_basedir=/u00/app/mysql/product/mysql-5.5.15
In order to be able to use it in the corosync environnement, the following
changes are mandatory in the file /usr/lib/ocf/resource.d/heartbeat/mysql
mysql_start() {
...
${OCF_RESKEY_binary} --defaults-file=$OCF_RESKEY_config \
--pid-file=$OCF_RESKEY_pid \
--socket=$OCF_RESKEY_socket \
--datadir=$OCF_RESKEY_datadir \
--basedir=$OCF_RESKEY_basedir \
--port=$OCF_RESKEY_port \
--user=$OCF_RESKEY_user $OCF_RESKEY_additional_parameters >/dev/null 2>&1 &
rc=$?
...
Best regards
Greg
Gregory Steulet
Senior Consultant
Delivery Manager
[email protected]
+41 79 963 43 69
www.dbi-services.com
dbi services Lausanne
chemin Maillefer 36 | CH-1052 Le Mont-sur-Lausanne
Blog www.dbi-services.com/blog
Follow dbi services!
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems