ruby-on-railsruby-on-rails-4octopus

Octopus not sending reads to slave


I have the following configuration for a slave:

octopus:
  replicated: true
  fully_replicated: true 
  environments:
    - staging
    # - production

  staging:
    shards:
      slave1:
        host: database_ip
        username: <%= ENV['DATABASE_USERNAME'] %>
        password: <%= ENV['DATABASE_PASSWORD'] %>
        database: <%= ENV['DATABASE_NAME'] %>

I checked pg_stat_activity from this slave and there is nothing, not a single query is running except from mine.
Am I missing something from octopus configuration? I went through the wiki but couldn't find anything else than shards.yml


Solution

  • You can try (without shards key):

    octopus:
      replicated: true
      fully_replicated: true 
      environments:
        - staging
        # - production
    
      staging:
        slave1:
          host: database_ip
          username: <%= ENV['DATABASE_USERNAME'] %>
          password: <%= ENV['DATABASE_PASSWORD'] %>
          database: <%= ENV['DATABASE_NAME'] %>
    

    From Config file wiki