Skip to end of metadata
Go to start of metadata

Scalr users 2 databases. One main database that contains farms, roles, scripts, etc. The second one contains load statistics, such as CPU load and RAM usage. You can only have one active database master at a given time. However, you can replicate the database to a stand-by slave in real time.

If the main server fails, you can update the Scalr configuration and turn the stand-by slave into an active master. This is the only component were you can opt to use an external MySQL database instead of the built-in one from Scalr.

Example scalr-server-local.rb for the database component.

Example scalr-server.rb for the database component.

Note: Scalr supports MySQL, Percona, and Mariadb for the Scalr database.

Please note: If you are using your own MySQL server (not the embedded databases) and your MySQL version is 5.5.X, you must add the following to your MySQL Config:  skip-character-set-client-handshake = 1

How to replicate (and backup)

If you are using the built-in MySQL server that comes with Scalr, you can use the kickstart-replication script to setup replication to your slave database.

Follow these instructions to setup a 2 server database replication.

  1. Install Scalr on both servers.
  2. Run scalr-server-wizard on servers 1.
  3. Make all necessary changes to scalr-server.rb and make sure to specify that server 1 should be used as database server.
  4. Make sure your scalr-server-local.rb enables the MySQL component, set server_id=1, enable the binary log and accepts remote root logins on server 1.
  5. Copy the scalr-server.rb and scalr-server-secrets.json from server 1 to server 2.
  6. Make sure your scalr-server-local.rb enables the MySQL component, set server_id=2, enable the binary log and accepts remote root logins on server 2.
  7. Run scalr-server-ctl reconfigure on server 1.
  8. Run scalr-server-ctl reconfigure on server 2.
  9. Start replication by executing: /opt/scalr-server/bin/kickstart-replication IP-OF-MASTER:6280 IP-OF-SLAVE:6280

Example scalr-server.rb:

Example scalr-server-local.rb on server 1:

Example scalr-server-local.rb on server 2:

  • No labels