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 under the /mnt/ folder. Because proxy service needs to be stopped when mysqldump is being generated, this Mashery Local cluster cannot handle traffic.
    If you are using Docker-Machine, make sure you are talking to the right one. Execute the command docker-machine ls to find which one is currently active. It is also recommended to always redo the command:
    eval "$(docker-machine env <docker machine name>)"
    1. docker exec -it ml-tm nohup service javaproxy stop

      1. docker exec -it ml-db /bin/bash
      2. mysqldump -u masherybackup -p'password_for_masherybackup'--opt --master-data --single-transaction onprem > /mnt/onprem.sql
      3. md5sum /mnt/onprem.sql
      4. Exit the ml-db container

        Below step copies the mysqldump from container to host's file system in present working directory. You can specify other location by replacing '.' at the end.

      5. docker cp ml-db:/mnt/onprem.sql
    2. docker exec -it ml-tm nohup service javaproxy start

    For Mashery Local 4.2.0 or later, root can generate mysqldump in the Slave or Master Instance under /mnt/dump/ folder.

    Because proxy service needs to be stopped when mysqldump is being generated, this Master/Slave Instance cannot handle traffic.

    1. docker exec -it ml-tm nohup service javaproxy stop

      1. docker exec -it ml-db /bin/bash
      2. mysqldump -u masherybackup -p'password_for_masherybackup'--opt --dump-slave --single-transaction onprem > /mnt/dump/onprem.sql
      3. md5sum /mnt/dump/onprem.sql
      4. Exit the ml-db container

        Below step copies the mysqldump from container to host's file system in present working directory. You can specify other location by replacing '.' at the end

      5. docker cp ml-db:/mnt/dump/onprem.sql.
    2. docker exec -it ml-tm nohup service javaproxy start

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" (login into ml-db container first):
      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:
      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, root can copy mysqldump from remote host.
      If you are using Docker-Machine, make sure your are talking to the right one. Execute the command docker-machine ls to find which one is currently active. It is also recommended to always redo the command:
      eval "$(docker-machine env <docker machine name>)"
      1. First transfer the mysqldump from remote host to the current host. scp root@remote_host: <Absolute path of onprem.sql on remote host> <LOCAL DEST DIR>
      2. Now copy the mysqldump file from host machine to DB container's file system docker cp <LOCAL DEST DIR>/onprem.sql ml-db:/mnt/
      For Mashery Local 4.2.0 or later, root can copy mysqldump from remote host:
      1. First transfer the mysqldump from remote host to the current host. scp root@remote_host:<Absolute path of onprem.sql on remote host> <LOCAL DEST DIR>
      2. Now copy the mysqldump file from host machine to DB container's file system docker cp <LOCAL DEST DIR>/onprem.sql ml-db:/mnt/
      Verify the checksum of mysqldump file (Login into ml-db container:
      md5sum /mnt/dump/onprem.sql
      Stop "proxy" service:
      docker exec -it ml-tm nohup service javaproxy stop
      Import mysqldump:
      mysql -u masheryonprem -p'password_for_masheryonprem' onprem < /mnt/dump/onprem.sql
      After importing is done, restart MySQL:
      service mysqld restart
      Start "proxy" service:
      docker exec -it ml-tm nohup service javaproxy start
    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:
      docker exec -it ml-tm nohup service javaproxy stop

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:
      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 user can copy mysqldump from remote host.
      If you are using Docker-Machine, make sure you are talking to the right one. Execute the command docker-machine ls to find which one is currently active. It is also recommended to always redo the command:
      eval "$(docker-machine env <docker machine name>)"
      1. First transfer the mysqldump from remote host to the current host. scp root@remote_host:<Absolute path of onprem.sql on remote host> <LOCAL DEST DIR>
      2. Now copy the mysqldump file from host machine to DB container's file system docker cp <LOCAL DEST DIR>/onprem.sql ml-db:/mnt/
      For Mashery Local 4.2.0 or later, root can copy mysqldump from remote host:
      1. First transfer the mysqldump from remote host to the current host. scp root@remote_host:<Absolute path of onprem.sql on remote host> <LOCAL DEST DIR>
      2. Now copy the mysqldump file from host machine to DB container's file system docker cp <LOCAL DEST DIR>/onprem.sql ml-db:/mnt/
      Verify the checksum of mysqldump file (Login into ml-db container) :
      md5sum /mnt/dump/onprem.sql
      Stop "proxy" service:
      docker exec -it ml-tm nohup service javaproxy stop
      Import mysqldump:
      mysql -u masheryonprem -p'password_for_masheryonprem' onprem < /mnt/dump/onprem.sql
      After importing is done, restart MySQL:
      service mysqld restart
      Start "proxy" service:
      docker exec -it ml-tm nohup service javaproxy start
      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:
      docker exec -it ml-tm nohup service javaproxy start