I've set up three Ubuntu MySQL servers (18.04 LTS / 8.0.17) in a single-primary InnoDB cluster and have installed mysqlrouter on an application server.

With the router’s configuration manually specified, a failure on either read-only server results in all read queries being sent to the remaining secondary, as expected.

However, if the read-write server fails, the router would be unaware of which node had been promoted as the new primary. I assume that routing_strategy = first-available could be used, but after reading that it promotes the next UUID in sequence, those would have to be alphabetized among the nodes, which feels like a sloppy solution. Otherwise it seems that it could end up connecting to a read-only server for write operations.

I've looked through the documentation for mysqlrouter's --bootstrap option, but I continue to get the following error despite taking directory ownership and loosening permissions:

Error: Could not open /var/run/mysqlrouter/state.json.tmp for writing: Permission denied

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.