Setting up a New Mashery Local Cluster

The following section describes how to set up a new Mashery Local Cluster.

Procedure

Prepare mysqldump from Existing Mashery Local Cluster. (Optional)

  1. For Mashery Local prior to 4.2.0, root can generate mysqldump in the Master Instance. Because proxy service needs to be stopped when mysqldump is being generated, this Mashery Local cluster cannot handle traffic.
    monit stop proxy
    mysqldump -u masherybackup -p'password_for_masherybackup' --opt --master-data --single-transaction onprem > /mnt/onprem.sql
    monit start proxy
     
     
    md5sum /mnt/onprem.sql

    For Mashery Local 4.2.0 or later, the Administrator can generate mysqldump in the Slave or Master Instance.

    The Administrator can generate mysqldump in the Slave Instance. Because proxy service needs to be stopped when mysqldump is being generated, this Slave Instance cannot handle traffic.

    sudo monit stop proxy
    mysqldump -u masherybackup -p'password_for_masherybackup' --opt --dump-slave --single-transaction onprem > /mnt/dump/onprem.sql
    sudo monit start proxy
     
    md5sum /mnt/dump/onprem.sql
    The Administrator can generate mysqldump in the Master Instance. Because proxy service needs to be stopped when mysqldump is being generated, this Mashery Local cluster cannot handle traffic.
    sudo monit stop proxy
    mysqldump -u masherybackup -p'password_for_masherybackup' --opt --master-data --single-transaction onprem > /mnt/dump/onprem.sql
    sudo monit start proxy
     
     
    md5sum /mnt/dump/onprem.sql

Set up Mashery Local Master Instance

  1. Perform the following steps:
    1. Create and configure a Mashery Local Master instance as described in the topic "Configuring a Mashery Local Master", in this Guide.
      If special tuning is needed on MySQL, for example, expanding buffer pool size in "/etc/my.cnf":
      innodb_buffer_pool_size = 512M
      Mashery Local customers should consult TIBCO Support and request assistance in tuning MySQL. After tuning of MySQL, the MySQL service should be restarted by the Administrator:
      sudo service mysqld restart
      When disk expansion is needed, the Administrator should follow the instructions in the topic "Expanding the Disk Space of a Mashery Local Instance" in this Guide.
    2. Import mysqldump from a previous Mashery Local Cluster. (Optional)
      Importing mysqldump from an existing Mashery Local Cluster can minimize the amount data to synchronize from Cloud, greatly reducing the amount of time required to setup the Mashery Local Instance.
      For example, suppose the remote Mashery Local instance is "remote_host".
      For Mashery Local prior to 4.2.0, the administrator can copy mysqldump from remote host:
      scp root@remote_host:/mnt/onprem.sql /mnt/dump
      For Mashery Local 4.2.0 or later, the administrator can copy mysqldump from remote host:
      scp administrator@remote_host:/mnt/dump/onprem.sql /mnt/dump
      Verify the checksum of mysqldump file:
      md5sum /mnt/dump/onprem.sql
      Stop "proxy" service:
      sudo monit stop proxy
      Import mysqldump:
      screen
      mysql -u masheryonprem -p'password_for_masheryonprem' onprem < /mnt/dump/onprem.sql
      To detach from "screen" process, press Ctrl-A then Ctrl-D. To reattach to "screen" process, run the following command:
      screen -r
      After importing is done, restart MySQL:
      sudo service mysqld restart
      Start "proxy" service:
      sudo monit start proxy
    3. Register the Mashery Local Instance as Master.
      Follow the instructions in the topic "Configuring a Local Mashery Master" in this guide to register the Mashery Local Instance as Master, to finish the settings for the Master in Cluster Manager.
      Note: When synchronizing the Master for the first time, allow the Master to finish the synchronization. This ensures the Master Instance is set up properly and synchronization with the Cloud is normal.
    4. Stop "proxy" Service (Optional).
      After "proxy" service is stopped, there will be no activity in MySQL. This enables Mashery Local slaves to replicate faster. To stop "proxy" service, run the following command:
      sudo monit start proxy

Set up the Mashery Local Slave Instance

  1. Perform the following steps:
    1. Create and configure a Mashery Local Slave instance as described in the topic "Configuring a Mashery Local Slave", in this Guide.
      If special tuning is needed on MySQL, for example, expanding buffer pool size in "/etc/my.cnf":
      innodb_buffer_pool_size = 512M
      Mashery Local customers should consult TIBCO Support and request assistance in tuning MySQL. After tuning of MySQL, the MySQL service should be restarted by the Administrator:
      sudo service mysqld restart
      When disk expansion is needed, the Administrator should follow the instructions in the topic "Expanding the Disk Space of a Mashery Local Instance" in this Guide.
    2. Register the Mashery Local Instance as a Slave.
      Follow the instructions in the topic "Configuring a Local Mashery Slave" in this guide to register the Mashery Local Instance as Slave, to finish the settings for the Slave in Cluster Manager.
    3. Import mysqldump from a previous Mashery Local Cluster. (Optional)
      Importing mysqldump from an existing Mashery Local Cluster can minimize the amount data to synchronize from Cloud, greatly reducing the amount of time required to setup the Mashery Local Instance.
      For example, suppose the remote Mashery Local instance is "remote_host".
      For Mashery Local prior to 4.2.0, the administrator can copy mysqldump from remote host:
      scp root@remote_host:/mnt/onprem.sql /mnt/dump
      For Mashery Local 4.2.0 or later, the administrator can copy mysqldump from remote host:
      scp administrator@remote_host:/mnt/dump/onprem.sql /mnt/dump
      Verify the checksum of mysqldump file:
      md5sum /mnt/dump/onprem.sql
      Stop "proxy" service:
      sudo monit stop proxy
      Stop MySQL Slave:
      mysql -u masheryonprem -p'password_for_masheryonprem' onprem
      stop slave
      Import mysqldump:
      screen
      mysql -u masheryonprem -p'password_for_masheryonprem' onprem < /mnt/dump/onprem.sql
      To detach from "screen" process, press Ctrl-A then Ctrl-D. To reattach to "screen" process, run the following command:
      screen -r
      After importing is done, restart MySQL:
      sudo service mysqld restart
      Start "proxy" service:
      sudo monit start proxy
      Ensure MySQL Slave replicates well from MySQL Master:
      mysql -u masheryonprem -p'password_for_masheryonprem' onprem
      show slave status\G
    4. Start "proxy" Service in Master after all Slaves are set. (Optional)
      Run the following command:
      sudo monit start proxy