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.
scalr-server-local.rb for the database component.
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.
- Install Scalr on both servers.
scalr-server-wizardon servers 1.
- Make all necessary changes to
scalr-server.rband make sure to specify that server 1 should be used as database server.
- Make sure your
scalr-server-local.rbenables the MySQL component, set server_id=1, enable the binary log and accepts remote root logins on server 1.
- Copy the scalr-server.rb and scalr-server-secrets.json from server 1 to server 2.
- Make sure your
scalr-server-local.rbenables the MySQL component, set server_id=2, enable the binary log and accepts remote root logins on server 2.
scalr-server-ctl reconfigureon server 1.
scalr-server-ctl reconfigureon server 2.
- Start replication by executing:
/opt/scalr-server/bin/kickstart-replication IP-OF-MASTER:6280 IP-OF-SLAVE:6280
scalr-server-local.rb on server 1:
scalr-server-local.rb on server 2: