MySQL high availability (drbd+heartbeat+mysql)

Source: Internet
Author: User

Heartbeat and DRBD are the same as they were before. Here fine-tuned the next DRBD communication with a dedicated network card, so consider the speed limit is only IO .

    • about MySQL:

      Yum install mysql-server MySQL

      back up the previous /var/lib/mysql data and configuration file /etc/my.cnf, and Note that the permissions are MySQL

then DRBD mounts to the/var/lib/mysql to copy the data to this directory.

Mkdir/backupcd/var/lib/mysql/cp-ar */BACKUP/CP/ETC/MY.CNF/BACKUP/RM-FR/ETC/MY.CNFMOUNT/DEV/DRBD2/VAR/LIB/MYSQ l/rm-fr/var/lib/mysql/*cp-ra/backup/*


    • The configuration file is connected to the my.cnf inside the/var/lib/mysql, and the configuration does not involve the host name. Note that both sides are to be manipulated. This allows the configuration file to be also synchronized for high availability.

Ln-s/var/lib/mysql/my.cnf/etc/my.cnf
    • Heartbeat Configuring Resources :

server2.example.com ipaddr::192.168.88.200/24/eth0drbddisk::d ata1 FILESYSTEM::/DEV/DRBD2::/VAR/LIB/MYSQL::EXT4 MYSQLD (Note that there's a d in the back)


    • special attention. :

When high availability,MySQL mount, must be normal to stop the heartbeat , so that MySQL will stop normally. Otherwise it will remain Mysql.scoket. The next time in its HA centralization will not be successful.

always reported the wrong: Another MySQL daemon already running with the same UNIX socket.

Workaround: DRBD hangs, removes mysql.scoket, restarts HA.

    • Test High Availability .


MySQL high availability (drbd+heartbeat+mysql)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.