Configuring Faspex to use a remote database can make the application more responsive by putting the database and background processes on a separate server from the one that hosts the Faspex web application. The following instructions describe how to set up and configure two Faspex servers; ensure that you are performing the configuration steps on the correct server. The server that runs the database is referred to as the "database server" and the server that runs the web application is referred to as the "application server".
If you want to set up a remote database that only runs MySQL, see Configuring Faspex to Use a Remote Database (MySQL Only)
Aspera recommends that you use the database on the server that runs background
processes. The server hosting the application can be remote.
-
Set up two identical Faspex instances on separate servers.
Each Faspex installation creates its own database, but the servers are
configured to only use one.
-
On the database server, grant the application server access to the
database.
Run the following commands to run the MySQL command
line:
# /opt/aspera/common/mysql/bin/mysql -umysql_username -pmysql_password
From
the MySQL command line, allow remote connection to the Faspex database from only
the remote node, and exit the MySQL command
line:
mysql# grant all privileges on faspex.* to root@'ui_server_hostname' identified by 'mysql_password';
mysql# end
These
commands allow connections from the application server to access the
specified database.
-
On the database server, decrypt the database.yml database
configuration file.
# asctl faspex:rake aspera:decrypt_database_passwords
-
Copy the database.yml and secret.yml files from the database
server to the application server.
-
On both servers, encrypt the database.yml database configuration
files.
asctl faspex:rake aspera:encrypt_database_passwords
-
On the application server, point Faspex to the database on the database
server.
Open /opt/aspera/faspex/config/database.yml in a
text editor. Locate the line for host in the
production section and change the value to the
hostname of the database server. Save your changes.
-
On both servers, set matching encryption keys.
On both the database server and application server, run the following command
to set the encryption key to the same
value:
# asconfigurator -x ""set_node_data;token_encryption_key,token_key"
The
token_key must be identical on the
servers.
-
On both servers, restart asperacentral and asperanoded.
Run the following command in
a Terminal window to restart
asperacentral:# /etc/init.d/asperacentral restart
Run the following commands to
restart
asperanoded:# /etc/init.d/asperanoded restart
-
On both servers, create the same node username and password.
This must be done after configuring
database.yml and
secret.yml. Run the following
command:
# /opt/aspera/bin/asnodeadmin -a -u node_username -p node_password -x transfer_username
For
example:
# /opt/aspera/bin/asnodeadmin -a -u nodeadmin -p XF324cd28 -x faspex
-
In the web application, configure the localhost file server to use the new node
user.
In the Faspex application, go to
Server > File Storage.
Click the arrow for localhost and click
Edit. Enter the
node_username from the previous step in the
Username field and the
node_password in the
Password
field.
Click Update Node to activate your
changes.
-
On both servers, restart Faspex services.
-
On both servers, configure background processes.
On the database node: Disable the application by running the following
command:
# asctl faspex:mongrel:stop
On
the application node: Disable all process but the application by
running the following
commands:
# asctl all:stop
# asctl faspex:mongrel:start
# asctl apache:start
After following these instructions, you have one node
running database and background services, and another node running only the application.