Sun Cluster Data Service for MySQL Guide for Solaris OS

Upgrade to SC3.2 when Using Sun Cluster HA for MySQL

Use the information in this section to understand how to upgrade to SC3.2 when using Sun Cluster HA for MySQL.


Note –

This procedure will not describe how to upgrade to SC3.2. It includes only the steps to upgrade Sun Cluster HA for MySQL to SC3.2.


ProcedureUpgrade from Sun Cluster 3.0 to Sun Cluster 3.2 when Using Sun Cluster HA for MySQL

This procedure shows the steps how to upgrade Sun Cluster HA for MySQL from SC3.0 to SC3.2.

  1. Shutdown Sun Cluster HA for MySQL resource with clresource disable MySQL- resouce.


    # clresource disableMySQL- resouce
    
  2. Upgrade the nodes to SC3.2 according to Sun Cluster documentation.

  3. Start the MySQL Server manually on SC3.2.


    #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 &
    
  4. 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> 
  5. 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)
  6. 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)
  7. 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)
  8. Add faultmonitor-user and a test-database to MySQL.


    # cd /opt/SUNWscmys/util
    

    Copy the mysql_config to myplace and 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=""

    Note –

    The following is an example for MySQL instance on SC3.2.



    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"
    
  9. After editing mysql_config, run the mysql_register script.


    # ./mysql_register -f myplace/mysql_config
    
  10. Stop the MySQL Server manually.


    # kill -TERM `cat <MySQL Databasedirectry>/mysqld.pid
    
  11. Startup Sun Cluster HA for MySQL resource with clresource enable MySQL- resouce


    # clresource enable MySQL- resouce
    
  12. Change source addresses for adminuser for accessing locally a MySQL instance with a MySQL Logicalhost.


    Note –

    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 logical host and add an adminuser belonging to the physical host.


    Note –

    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.2.


    # 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;

    Note –

    You have to manually add the Grant_priv to the admin users, See MySQL Administration documentation.