Sharing MySQL Data

This procedure lets you configure Orchestrator for the sharing of MySQL.

The steps below give you information about the current ownership on Orchestrator directories and then provide the commands for changing them as needed so that you can share MySQL data.
Note: All directories in Orchestrator (/opt/aspera/../*/) have root:root ownership with the exception of the following directories:
  • /opt/aspera/common/mysql - root:mysql ownership
  • /opt/aspera/common/mysql/data - mysql:mysql ownership
  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 directory has rwxr-xr-x permissions:
    /mnt/shared/orchestrator/
    This directory 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 to change the ownership of the mysql directory to the mysql user and group.
    $ cd /opt/aspera/common/mysql
    $ mv ./data ./data.bak
    $ ln -s /mnt/shared/orchestrator/mysql_data ./data
    $ chown -Rh mysql:mysql ./data
  6. Confirm that the operation in the previous step was successful 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 directory:
    /opt/aspera/common/mysql/data/
    Now run the following commands to confirm that this directory 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. 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