Sharing MySQL Data

This topic describes the process for configuring Orchestrator for the sharing of MySQL data.

  1. Preliminary step: stop the services.
    Stop Orchestrator and MySQL on both nodes with the following commands:
    $ asctl orchestrator:stop
    $ asctl mysql:stop
  2. Confirm that the following folder has rwxr-xr-x permissions:
    /mnt/shared/orchestrator/
    This folder is the Orchestrator mount point on the shared storage. If it does not have the necessary permissions, change them with the following command:
    $ chmod 755 /mnt/shared/orchestrator/
  3. Create a mysql_data directory under the mount point for the MySQL shared data files.
  4. Open the /etc/group and /etc/passwd files to confirm that mysql group-id and mysql user-id are the same on both nodes.
  5. On both nodes, run the following:
    $ cd /opt/aspera/common/mysql
    $ mv ./data ./data.bak
    $ ln -s /mnt/shared/orchestrator/mysql_data ./data
    $ chown -h mysql.mysql ./data
  6. Check the results of the operation in Step 5 by running a list operation on the mysql directory.
    $ ls -lah /opt/aspera/common/mysql
    ...
    lrwxrwxrwx 1 mysql mysql 4 Jun 12 15:25 data -> /mnt/shared/orchestrator/mysql_data
    drwxr-x--- 5 mysql mysql 4.0K Jan 18 16:26 data.bak
    ...
    
  7. Create an empty file in the following folder:
    /opt/aspera/common/mysql/data/
    Now run the following commands to confirm that this folder comes with mysql ownership (rather than nobody ownership):
    $ cd /opt/aspera/common/mysql/data/
    $ sudo -u mysql touch toto.txt
    $ ls –l
    -rw-r--r-- 1 mysql mysql        0 May 12 08:19 toto.txt
    $ rm –f toto.txt
  8. On one node where the shared storage is accessible, copy the MySQL data into the shared volume.
    $ cp -R /opt/aspera/common/mysql/data.bak/* /opt/aspera/common/mysql/data
  9. Ensure that the files under the following folder are owned by mysql user and group.
  10. On the other node, verify that you can see the data files in this directory. It may be necessary to perform a failover to make the shared storage visible.
    $ ls /opt/aspera/common/mysql/data/
    -rw-rw----. 1 mysql mysql 18874368 Apr 23 11:04 ibdata1
    -rw-rw----. 1 mysql mysql 19922944 Apr 23 11:04 ib_logfile0
    -rw-rw----. 1 mysql mysql 19922944 Apr 22 16:01 ib_logfile1
    drwx------. 2 mysql mysql    32768 Apr 22 16:00 mysql
    -rw-rw----. 1 mysql mysql     5536 Apr 23 11:04 mysqld.log
    drwx------. 2 mysql mysql    32768 Apr 22 17:52 orchestrator
    drwx------. 2 mysql mysql    32768 Apr 22 16:00 test