Kinja OPS

Gawker ops team
Gawker ops team

MySQL replication module for ansible

We maintain a lot of servers under Kinja, so we have to use some orchestrator software to perform some tasks on a lot of servers. The Ansbile software is used by us, because it is cool.

We have also a lot of MySQL servers (and counting!) under Kinja, so we have some tasks to perform on them, such as managing replication. Of course there are some ways to do this, for example using multiplexed terminals, or run ansibile shell commands what performs mysql queries (e.g. ansible mysql-master1 -m shell -a "mysql -e "SOME SQL QUERY HERE") but it is not too comfy, and needs a lot of manual work.


So, there is a way to make it easier for us, and that's why I made a mysql_replication module for ansible. (And I made a pull request for that on GitHub, so I hope it will be merged soon to 'official' branch)

The mysql_replication module helps you to

  • Query slave status
  • Query master status
  • Change replication slave's parameters (such as master server ip, master_log_pos, etc.)
  • Stop slave thread
  • Start slave thread

The module can be find now in my GitHub repo here.

Use it.

Share This Story

Get our newsletter