Configuring Faspex to Use a Remote Database (MySQL Only)

Faspex can be configured to use a remote database that only runs MySQL. To configure Faspex to use a remote database on a node that also runs Faspex background processes (so that the other Faspex node runs only the Faspex application), see Configuring Faspex to Use a Remote Database (Faspex + MySQL).

  1. Set up the remote database.
    Note: For this operation, Faspex requires MySQL version 5.5.42 or earlier. Later versions are not supported.
  2. On the Faspex server, stop Faspex services and back up the local database.
    > asctl faspex:stop
    > asctl faspex:backup_database

    Record the location of the database backup, which you use in the next step to migrate the database.

  3. Migrate the local database to the remote database.
    > mysql -h remote_db_ip_address -P port -umysql_username -pmysql_password path_to_db_backup

    The default MySQL port is 4406. For example,

    > mysql -h 54.182.111.111 -P 4406 -uroot -ptopsecretC:\Program Files [(x86)]\Aspera\Faspex\backup\2015-07-01_23458/faspex.sql
  4. Verify that the migration was successful.
    Login to the MySQL database:
    > mysql-h remote_db_ip_address -P port -umysql_username -pmysql_password
    View the contents of the new database by running the following commands:
    mysql> use faspex;
    mysql> show tables;
    mysql> select * from e_packages;
  5. Configure Faspex to use the remote database.
    Open C:\Program Files [(x86)]\Aspera\Common\mysql\database.rb.yml with a text editor. Change hostname to the IP address of the remote database, port to the MySQL port (4406, by default), and password to the remote MySQL database. For example,
    ---
    :version: 1.1.22.99169
    :process_id:
    :data_dir: C:\Program Files [(x86)]\Aspera\Common\mysql\data
    :hostname: 54.182.111.111
    :port: 4406
    :task status: 
       ...
       ...
    :password:  topsecret
    :setup_complete: true

    Save your changes then open C:\Program Files [(x86)]\Aspera\Faspex\config\database.yml with a text editor. Locate the production section and change host to the IP address of the remote database, port to the MySQL port (4406, by default), and password to the remote MySQL database. For example,

     ...
    production:
       encoding: utf8
       port: 4406
       username: svcAspera
       adapter: mysql
       database: faspex
       host: 54.182.111.111
       user: svcAspera
       password: topsecret
     ... 

    Save your changes.

  6. Shut down the local MySQL database and restart all other Faspex services.
    > asctl mysql:disable
    > asctl all:restart

    If you need to restart the local MySQL database, revert the .yml files and then run the following command:

    > asctl mysql:setup