openark / orchestrator

MySQL replication topology management and HA
Apache License 2.0
5.63k stars 930 forks source link

set read-only to all non co-master replicas #240

Open tapuhi opened 7 years ago

tapuhi commented 7 years ago

Hi, In our configuration we have mult-dc co-masters and only those can have RW traffic all other replicas can serve as RO replicas. Is there a way to cause orchestrator to set all non co-master replicas to be read-only, or is that something I need to set manually ?

BR

shlomi-noach commented 7 years ago

@tapuhi this sounds like either job for your puppet or for some scripting.

To let you know how we do this:

You can easily check which are all the co-masters via:

curl -s http://path.to.orchestrator/api/all-instances | jq -r '.[] | select(.IsCoMaster==true) | .Key.Hostname'

and likewise who are all the non-co-masters:

curl -s http://path.to.orchestrator/api/all-instances | jq -r '.[] | select(.IsCoMaster==false) | .Key.Hostname'