Giter Club home page Giter Club logo

Comments (5)

mnelson avatar mnelson commented on August 20, 2024

That error occurs when all connections had a failure related to connectivity within the blacklist duration. If you weren't using makara, it would be equivalent to seeing a connection error in newrelic. Are you able to provide the full trace and a summary of your database.yml?

from makara.

nikhilvs avatar nikhilvs commented on August 20, 2024

Our database.yml looks like this :

  adapter: 'makara_mysql2'
  encoding: utf8
  database: <%= ENV['RDS_DB_NAME'] %>
  username: <%= ENV['RDS_USERNAME'] %>
  password: <%= ENV['RDS_PASSWORD'] %>
  host: <%= ENV['RDS_HOSTNAME'] %>
  port: <%= ENV['RDS_PORT'] %>
  pool: <%= ENV['DB_POOL'] %>
  reaping_frequency: <%= ENV['REAPING_FREQUENCY'] %>
  timeout: 5000

  makara:
    blacklist_duration: 5
    master_ttl: 5
    sticky: true
    rescue_connection_failures: false

    connections:
      - role: master
        host: <%= ENV['RDS_HOSTNAME'] %>
        name: master-database
      - role: slave
        host: <%= ENV['DB_SLAVE1'] %>
        name: read-slave1
        weight: 5
      - role: slave
        host: <%= ENV['DB_SLAVE2'] %>
        name: read-slave2
        weight: 5

from makara.

joelr avatar joelr commented on August 20, 2024

I get the same error when I only have one connection defined in the connection list, even when the connection is valid...

eg

    connections:
      - role: master
        host: <%= ENV['DATABASE_HOST'] %>
        adapter: mysql2
<% unless ENV['DATABASE_SLAVE_HOST'].blank? %>
      - role: slave
        host: <%= ENV['DATABASE_SLAVE_HOST'] %>
        adapter: mysql2
        database: <%= ENV['DATABASE_SLAVE_DATABASE'] %>
        username: <%= ENV['DATABASE_SLAVE_USERNAME'] %>
        password: <%= ENV['DATABASE_SLAVE_PASSWORD'] %>
<% end %>

I wanted the slave to be optional, but it seems to fail with Makara::Errors::AllConnectionsBlacklisted unless > 1 connection is defined, is this a known issue?

from makara.

ic avatar ic commented on August 20, 2024

Same problem as @joelr. It would be great if Makara could behave as a "standard" adapter when there is only a master defined.

One practical example is to set up a staging environment with the same adapter as production (i.e. Makara), but with only a single DB for saving cost. This allows to test easily (except, yes, this settings does not allow to test fail-overs!).

@joelr: One dangerous workaround is to set a single machine as both master and slave. I did not check the source code yet, so please be aware this should be temporary (or confirmed as an OK workaround). A brief look at pool.rb tells me that it should be ok, but pretty costly (e.g. each send_to_all is executed twice by the DB, etc).

from makara.

bleonard avatar bleonard commented on August 20, 2024

I'm going to combine this with this one (#101) -- I think they are both saying that master is special and especially if there is only one, there is something interesting that should happen where it works like "normal" - more investigating on that that means but "merging" them.

from makara.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.