I'm working for a client now that has hundreds of clusters of MySQL servers. I'm working on going through them and standardizing the MySQL install and fixing issues. I came across a cluster today that had half a dozen slaves but there was no documentation on which slaves were in the cluster. Part of the work I'm doing is adding "report_host = <server_name>" to each of the my.cnf files for MySQL servers so that when I run "show slave hosts" on the master I can know what slaves are in the cluster (and so that Orchestrator will be able to see them).
When I ran "show slave hosts" on the master there were several blank entries. In order to find them I ran this query:
mysql> select user, host from information_schema.processlist WHERE user = 'replication';
+-----------------+-----------------------------------------+
| user | host |
+-----------------+-----------------------------------------+
| replication | xx.xx.xx.xx:xxxxx |
| replication | xx.xx.xx.xx:xxxxx |
| replication | xx.xx.xx.xx:xxxxx |
| replication | xx.xx.xx.xx:xxxxx |
| replication | xx.xx.xx.xx:xxxxx |
| replication | xx.xx.xx.xx:xxxxx |
+-----------------+-----------------------------------------+
6 rows in set (0.00 sec)
This provided me with either the hostname or the IP address of each of the slaves. Using this information, I was able to SSH into each of the slaves, update the my.cnf and restart the slave so that it would appear in orchestrator.
No comments:
Post a Comment