After installing Shares, you can choose to use a MySQL database on a remote system
rather than the default local MySQL database. You need to have the MySQL
credentials, port, and the hostname of the remote machine.
Note: You must configure Shares to use an external MySQL database is you are sharing
the MySQL database among multiple Shares instances.
-
Dump the Shares and stats collector databases.
Run the following commands:
# mysqldump -u username -p web_production > sharesdb.sql
# mysqldump -u username -p stats_collector > statscollectordb.sql
The following step takes place on the remote system hosting the remote
MySQL server.
-
Import the MySQL dumps into the MySQL on the remote system.
First log in to the MySQL command-line client and create the two needed
databases if they do not exist:
mysql> create database web_production;
mysql> create database stats_collector;
Exit the MySQL client then import the dumps. You can do this with commands
like the following:
# mysql -u username -p web_production < sharesdb.sql
# mysql -u username -p stats_collector < statscollectordb.sql
The following steps return to the system with Shares
installed.
-
Back on the system with Shares, update the Shares application configuration
file, which can be found at the following location:
C:\Shares\www\config\database.yml
Add in the remote_host,
remote_username, remote_password and
port for your remote MySQL in the production
and production_stats_collector sections:
production:
database: web_production
username: "remote_user"
password: "remote_password"
host: remote_host
port: remote_port
encoding: utf8
reconnect: false
pool: 5
production_stats_collector:
database: stats_collector
username: "remote_user"
password: "remote_password"
host: remote_host
port: remote_port
encoding: utf8
reconnect: false
pool: 5
-
Update the stats collector configuration file, which can be found at the
following location:
C:\Shares\statscollector\etc\persistence.xml
Add in the remote_host, remote_username
and remote_password for the remote MySQL server under the
connection URL header:
<!-- connection URL: jdbc:mysql://HOST:PORT/DATABASE -->
<property name="hibernate.connection.url" value="jdbc:mysql://remote_host/stats_collector"/>
<property name="hibernate.connection.username" value="remote_user"/>
<property name="hibernate.connection.password" value="remote_password"/>
-
Restart Shares services.
From the Windows
Start Menu search for
Services and click the best-matched result to open the Services application.
Start and stop any of the following Shares services:
- IBM Aspera Shares Nginx
- IBM Aspera Shares Delayed Job 1
- IBM Aspera Shares Web Services
- IBM Aspera Shares Stats Collector
-
If you are sharing the MySQL database with multiple Shares instances, make sure
the following Shares files are identical on every Shares instance:
C:\Shares\statscollector\etc\keystore.jks
C:\Shares\statscollector\etc\persistence.xml
C:\Shares\www\config\aspera\secret.rb
C:\Shares\www\config\database.yml
C:\Shares\www\config\initializers\secret_token.rb