This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # On both nodes | |
| mysql -u root -p | |
| Enter password: [enter the MySQL root password you chose earlier] | |
| mysql> show databases; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install telnet |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # on db-02 | |
| telnet db-01.vm.xeriom.net mysql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # on db-01 | |
| mysql -u root -p | |
| Enter password: [enter the MySQL root password you chose earlier] | |
| mysql> grant replication slave on *.* to 'replication'@'db-02' identified by 'some_password'; | |
| mysql> \q | |
| sudo /etc/init.d/mysql restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| log_bin = /var/log/mysql/mysql-bin.log | |
| expire_logs_days = 10 | |
| max_binlog_size = 100M | |
| binlog_do_db = my_application | |
| binlog_ignore_db = mysql | |
| binlog_ignore_db = test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # On db-02 | |
| mysql -u root -p | |
| Enter password: [enter the MySQL root password you chose earlier] | |
| mysql> grant replication slave on *.* to 'replication'@'db-01.vm.xeriom.net' identified by 'some_password'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| master-host = db-02.vm.xeriom.net | |
| master-user = replication | |
| master-password = some_password | |
| master-port = 3306 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo /etc/init.d/mysql restart | |
| mysql -u root -p | |
| Enter password: [enter the MySQL root password you chose earlier] | |
| mysql> show slave status \G |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get install heartbeat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo cp /usr/share/doc/heartbeat/authkeys /etc/ha.d/ | |
| sudo sh -c "zcat /usr/share/doc/heartbeat/ha.cf.gz > /etc/ha.d/ha.cf" | |
| sudo sh -c "zcat /usr/share/doc/heartbeat/haresources.gz > /etc/ha.d/haresources" |