MHA (Master High Availability Manager) is a tool for automating MySQL master failover and slave promotion with minimal downtime. It consists of Perl scripts that monitor a replication topology and automatically switch a slave to a master if the current master fails. When a failure is detected, MHA identifies the most up-to-date slave and applies any missing binary logs to make it the new master. It then changes the slaves to replicate from the new master. MHA requires installing node packages on all servers and a manager package to coordinate monitoring and failover.