Go to main content

Oracle® Solaris Cluster Data Replication Guide for MySQL

Exit Print View

Updated: August 2018
 
 

How to Create and Configure a MySQL Protection Group

Before You Begin

Ensure that the following conditions are met:

  1. Log in to a cluster node of the primary cluster.
  2. Create the content for the mysql_geo_config file.

    Note -  If you added readonly=true to the my.cnf file for the secondary cluster, you must also set READONLY=true in the mysql_geo_config file. Adding readonly=true to the my.cnf file is described in Step 2 of How to Configure the MySQL Replication.
  3. Copy the mysql_geo_config file to a different location.

    For example:

    phys-paris-1# cp /opt/SUNWscmys/geocontrol/util/mysql_geo_config /temp
  4. Specify the following variables in /temp/mysql_geo_config. This list uses sample values.
    PS=mysql-ps
    PG=mysql-pg
    REPCOMP=mysql.sbp
    REPRS=mysql-rep-rs
    REPRG=mysql-rep-rg
    DESC="mysql replication pg"
    CONFIGFILE=/geo-config/sbpconfig
    REALMYSRG=paris-rg,newyork-rg
    REALMYSRS=paris-mys-rs,newyork-mys-rs
    READONLY=
    APPRG=usa-rg
    LONGPING=
    SHORTPING=
  5. Create the script-based plug-in configuration file on all nodes of all clusters.

    Assuming that the nodes of the primary cluster, cluster-paris, are phys-paris-1 and phys-paris-2, on each node of cluster-paris, you would issue the following commands:

    phys-paris-1# mkdir /geo-config
    phys-paris-1# echo "mysql.sbp|any|phys-paris-1,phys-paris-2" > /geo-config/sbpconfig

    Assuming that the nodes of the secondary cluster, cluster-newyork, are phys-newyork-1 and phys-newyork-2, on each node of cluster-newyork, you would issue the following commands:

    phys-newyork-1# mkdir /geo-config
    phys-newyork-1# echo "mysql.sbp|any|phys-newyork-1,phys-newyork-2" \
    > /geo-config/sbpconfig
  6. Execute the mysql_geo_register script on the primary cluster.

    For example:

    phys-paris-1# ksh /opt/SUNWscmys/geocontrol/util/mysql_geo_register \
    -f /temp/mysql_geo_config
  7. Replicate the protection group to the partner cluster.

    Note -  You can also accomplish this step by using the Oracle Solaris Cluster Manager GUI. Click Partnerships, click the partnership name, highlight the protection group name, and click Get Protection Groups. For more information about Oracle Solaris Cluster Manager, see Chapter 12, Using the Oracle Solaris Cluster Manager Browser Interface in Administering an Oracle Solaris Cluster 4.4 Configuration.

    The final messages of the registration script outline the required geopg get command. You must log in to one node of the partner cluster and execute that exact command.

    phys-newyork-1# geopg get --partnership mysql-ps mysql-pg