This procedure shows the steps how to upgrade Sun Cluster HA for MySQL to SC3.1.
Shutdown Sun Cluster HA for MySQL resource with scswitch —n —j MySQL- resouce.
# scswitch -n -j MySQL- resouce |
Upgrade the nodes to SC3.1 according to Sun Cluster documentation.
Start the MySQL Server manually on SC3.1.
#cd <MySQL Basedirectory> |
# ./bin/mysqld --defaults-file=<MySQL Databasedirectry>/my.cnf \ --basedir=<MySQL Basedirectory>\ --datadir=<MySQL Databasedirectory>\ --user=mysql\ --pid-file=<MySQL Databasedirectory>/mysqld.pid & |
Access the MySQL instance from local node with the socket option.
#<MySQL Basedirectory> /bin/mysql -S <MySQL Socket> -uroot \ -p<Adminpassword>\ |
The following is an example for a MySQL instance.
# mysql -s /tmp/hahostix1.sock -uroot -proot mysql> |
Drop the Sun Cluster HA for MySQL test database sc3_test_database.
# mysql -s /tmp/hahostix1.sock -uroot -proot mysql> DROP DATABASE sc3_test_database; Query OK, 0 rows affected (0.03 sec) |
Delete all entries in db-table in mysql-database that contain User='<MySQL Faultmonitor user>'.
# mysql -s /tmp/hahostix1.sock -uroot -proot mysql> use mysql; Database changed mysql> DELETE FROM db WHERE User='fmuser'; Query OK, 1 row affected (0.03 sec) |
Delete all entries in user-table in mysql-database that contain User='<MySQL Faultmonitor user>'.
# mysql -s /tmp/hahostix1.sock -uroot -proot mysql> use mysql; Database changed mysql> DELETE FROM user WHERE User='fmuser'; Query OK, 1 row affected (0.03 sec) |
Add faultmonitor-user and a test-database to MySQL.
# cd /opt/SUNWscmys/util |
Edit the mysql_config file and follow the comments within that file:
# Where is mysql installed (BASEDIR) MYSQL_BASE= # Mysql admin-user for localhost (Should be root) MYSQL_USER= # Password for mysql admin user MYSQL_PASSWD= # Configured logicalhost MYSQL_HOST= # Specify a username for a faultmonitor user FMUSER= # Pick a password for that faultmonitor user FMPASS= # Socket name for mysqld ( Should be /tmp/<Logical host>.sock ) MYSQL_SOCK= # FOR SC3.1 ONLY, Specify the physical hostname for the # physical NIC that this logicalhostname belongs to for every node in the # cluster this Resourcegroup can located on. # IE: The logicalhost lh1 belongs to hme1 for physical-node phys-1 and # hme3 for physical-node phys-2. The hostname for hme1 is phys-1-hme1 and # for hme3 on phys-2 it is phys-2-hme3. # IE: MYSQL_NIC_HOSTNAME="phys-1-hme1 phys-2-hme3" MYSQL_NIC_HOSTNAME="" |
The following is an example for MySQL instance on SC3.1.
MYSQL_BASE=/global/mysql MYSQL_USER=root MYSQL_PASSWD=root MYSQL_HOST=hahostix1 FMUSER=fmuser FMPASS=fmuser MYSQL_SOCK=/tmp/hahostix1.sock MYSQL_NIC_HOSTNAME="clusterix1 clusterix2" |
After editing mysql_config, run the mysql_register script.
# ./mysql_register |
Stop the MySQL Server manually.
# kill -TERM `cat <MySQL Databasedirectry>/mysqld.pid |
Startup Sun Cluster HA for MySQL resource with scswitch —e —j MySQL- resouce
# scswitch -e -j MySQL- resouce |
Change source addresses for adminuser for accessing locally a MySQL instance with a MySQL Logicalhost.
If you want to access the MySQL instance only through the socket (localhost), omit this step.
When SC3.0U3 has been used, delete the root user belonging to the logicalhost and add an adminuser belonging to the physicalhost.
If the nodename and the hostname for the physical interface are different, use the hostname for the physical interface.
The following is an example for MySQL instance on SC3.1.
# mysql -S /tmp/hahostix1.sock -uroot mysql> use mysql; mysql> DELETE FROM user where User='root' AND Host='hahostix1'; mysql> GRANT ALL ON *.* TO 'root'@'clusterix1' IDENTIFIED BY 'rootpasswd'; mysql> GRANT ALL ON *.* TO 'root'@'clusterix2' IDENTIFIED BY 'rootpasswd'; mysql> exit; |
You have to manually add the Grant_priv to the admin users, See MySQL Administration documentation.