outbrain / orchestrator

MySQL replication topology manager/visualizer
Other
829 stars 168 forks source link

Prevent slave from becoming a master #258

Closed AshokJivani closed 8 years ago

AshokJivani commented 8 years ago

Hi @shlomi-noach,

I am still trying to understand on how Maintenance Mode works in Orchestrator. I have a case where a slave recently went bad (still running and in sync directly under master) and I don't like it to be promoted as master. I can do this by either putting it under "PromotionIgnoreHostnameFilters" and restart orchestrator or moving it under another slave.

Is there a way to ignore the given slave from becoming a master on the fly (may be part of preFailover script)?

Thanks, Ashok

shlomi-noach commented 8 years ago

I can do this by either putting it under "PromotionIgnoreHostnameFilters" and restart orchestrator

It's enough to reload orchestrator. No need to restart.

or moving it under another slave.

That's a good option

Is there a way to ignore the given slave from becoming a master on the fly (may be part of preFailover script)?

Yes. You can:

orchestrator -c register-candidate -i name.of.server --promotion-rule=must-not

This self expires after some time (default 1h iirc) so you need to reissue this via cron or something.

AshokJivani commented 8 years ago

got it. Thanks

shlomi-noach commented 8 years ago

@AshokJivani if you feel this should be better documented, please feel free to submit documentation PR