Wednesday, January 19, 2011

How can I configure MySQL data folder in a Red Hat cluster suite running in VMware

Hi,

I have configured Red Hat cluster in VMware. I created two nodes Node00 and Node01 which are running CentOs 5.2. I have added MySQL service to my cluster. When I suspend Node00 then instance is moved to Node01. The problem is when MySQL instance is moved to Node01 it uses the data folder of that local system.

I have installed Openfiler in another VMware machine called Node02 and configured NFS share. The NFS share is working fine. I want that the data folder to be kept in the NFS share and MySQL to use the common data folder and configuration files from the NFS share.

Can anyone please help me to configure my cluster for the same.

Warm Regards

Supratik

  • change in my.cnf datadir path you can change to your nfs mountpoint.

    [mysqld] user=mysql_owner datadir=/path/to/datadir/mysql socket=/path/to/datadir/mysql/mysql.sock skip-innodb

    [mysql.server] user=mysql_owner basedir=/path/to/datadir

    [client] user=mysql_owner socket=/path/to/datadir/mysql/mysql.sock

    [safe_mysqld] err-log=/var/log/mysqld.log pid-file=/var/run/mysqld/mysqld.pid

    From Rajat
  • Where shared NFS storage is mounted on Node01?

    I think it is better to mount NFS share in /var/lib/mysql (default for RedHat) instead of configuring paths for server and clients.

    I don't know what do you want to achieve. But if you try clustering mysql this way you are wrong and could couse data inconsistency. This setup is only valid, if mysql service on Node01 is started after Node00 failure.

    If you want to have 2 instances of mysql accesing data concurently, you should use NDB cluster. If you start two mysql instances accesing the same datadir, you get data inconsistency.

    For stand-by purpose you should better use DRBD replication or mysql replication (probably with MMM).

    From ms

0 comments:

Post a Comment