Rails Octopus Gem - Master-Slave Replication connection behaviour when slave is down

Viewed 3038

I'm testing this great gem Octopus with Rails 4.0.2 in development.

I created a Slave db and configured octopus as follows (config>shards.yml):

octopus:
  environments:
    - development
  replicated: true
  fully_replicated: true 
  verify_connection: true
  development:
    slave1:
      host: 192.168.1.12
      adapter: mysql2
      username: slave_reader
      password: my_password
      database: my_server_development
      reconnect: true

It works very nice, reading from the Slave and writing to the Master, however if My Slave server is down, I would expect it to redirect to the Master db and get the content, but after some time trying, it throws the error:

Can't connect to MySQL server on '192.168.1.12' (113)

What can I do to make octopus look for my Master db if the Slave server is shutdown?

Thanks in advance!

1 Answers
Related