Orchestrator provides a way to tag hosts.
Even though this has no effect on either the guy or the normal client operation, it can be a good way to use orchestrator as a way to also identify hosts.
On an ideal world, we could have a way to automatically tag hosts using puppet, or the source of truth, or the hosts identifying themselves.
Tags that could be useful would be:
- Candidate masters
- Backup sources
This is an example of a tag:
root@dborch1001:~# orchestrator-client -c tag -i db1077 --tag name=candidate db1077:3306
Then listing the hosts with a given tag can be done from the CLI or even using the api:
root@dborch1001:~# orchestrator-client -c tagged -t candidate db1077:3306 root@dborch1001:~# curl http://localhost:3000/api/tagged?tag=candidate [{"Hostname":"db1077","Port":3306}] root@dborch1001:~#
Seeing tagged hosts within a topology
root@dborch1001:~# orchestrator-client -c tag -i db1124 --tag name=master db1124.eqiad.wmnet:3306 root@dborch1001:~# orchestrator-client -c tag -i db1125 --tag name=candidate db1125.eqiad.wmnet:3306 root@dborch1001:~# /usr/bin/orchestrator-client -c which-cluster-master -a test-s4 < /usr/bin/orchestrator -c topology-tabulated -c topology-tags db1124.eqiad.wmnet:3306 [0s,ok,10.4.20-MariaDB-log,rw,STATEMENT,>>,semi:master] [name=master] + db1125.eqiad.wmnet:3306 [0s,ok,10.4.21-MariaDB-log,ro,ROW,>>,GTID,semi:replica] [name=candidate]
Complete documentation is at https://github.com/openark/orchestrator/blob/master/docs/tags.md