0

We're currently running a Galera cluster of 3 DB nodes. The way we're set up (due to ORM and automagical locking), we only have one of the 3 DB nodes being written to, and the other two provisioned for reads.

Galera's set to auto_increment on a value of 3, since there are three nodes in the cluster, in order to ensure that auto_increment values across the cluster are always unique. See this article (this is a Galera default) - https://blog.mariadb.org/auto-increments-in-galera/

If we plan to always only have 1 write DB, would it be dangerous or risky to set auto_increment to 1 globally across the cluster?

2
  • What happens when the single writable node dies? Do you promote another node to be the "only Master"? Do the clients redirect their writes to the new Master?
    – Rick James
    Apr 8, 2015 at 22:43
  • If the plan works, you would want to change both auto_increment_increment and auto_increment_offset back to 1.
    – Rick James
    Apr 8, 2015 at 22:44

1 Answer 1

0

Each node defines auto increment equal to the total number of nodes. This is for avoiding id collisions, because each node in the cluster have their unique sequence of numbers.

Like @jersten said, let galera handle it ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.