MHA::AWS - A support script for "MySQL Master HA" running on AWS
$ mhaws [subcommand] --interface_id=ENI-id [... args passed by MHA]
$ mhaws [subcommand] --route_table_id=[RouteTable-id] --vip=[master VIP] [... args passed by MHA]
required arguments:
1. failover method is ENI attach/detach
--interface_id=[ENI-id for master VIP]
2. failover method is RouteTable change destination
--route_table_id=[RouteTable-id]
--vip=[master VIP]
subcommand:
master_ip_failover
master_ip_online_change
shutdown
/etc/masterha_default.cnf
[server default]
master_ip_failover_script=mhaws master_ip_failover --interface_id=eni-xxxxxxxx
master_ip_online_change_script=mhaws master_ip_online_change --interface_id=eni-xxxxxxxx
shutdown_script=mhaws shutdown --interface_id=eni-xxxxxxxx
MHA::AWS is a support script for "MySQL Master HA" which running on Amazon Web Service.
# cpanm MHA::AWS
- EC2 instance's "Name" tags must be resolved as DNS name in internal.
- root user must be allowed to ssh login between each MySQL instances.
- aws-cli is installed and available.
- One ENI (Elastic Network Interface) must be attached to the MySQL master instance. Clients accesses for the ENI's IP address.
- Prepare a VIP address in your VPC.
- All MySQL hosts(master, slaves) can handle the VIP.
- Clients accesses for the VIP address.
- MHA detect master failure.
- "mhaws master_ip_failover --command stop",
- (ENI) ENI will be detached from the old master instance.
- (Route table) Route to VIP will be removed from VPC route table.
- "mhaws shutdown --command (stopssh|stop)", Old master mysqld process will be killed (if ssh connection is available). Or old master instance will be stopped via AWS API (if ssh connection is NOT available).
- MHA will elect the new master and set up replication.
- "mhaws master_ip_failver --command start",
- (ENI) ENI will be attached to the new master instance.
- (Route table) Route to VIP will be set to new master instance.
AWS::CLIWrapper, https://code.google.com/p/mysql-master-ha/
Copyright (C) FUJIWARA Shunichiro.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
FUJIWARA Shunichiro fujiwara.shunichiro@gmail.com