Mysqld_multi realization of multi-master one from synchronization

Source: Internet
Author: User

First make sure that MySQL is about 5.5, too old, and the method may be different.


1. Generate Database with mysql_install_db

mysql_install_db--DATADIR=/VAR/LIB/MYSQL2--user=mysql

mysql_install_db--datadir=/var/lib/mysql3--user=mysql

2. Generate Configuration file

Mysqld_multi--example

3, modify the configuration file: my.cnf

[Mysqld_multi]

Mysqld=/usr/bin/mysqld_safe

Mysqladmin =/usr/bin/mysqladmin


[Mysqld2]

socket=/var/lib/mysql2/mysql2.sock

Port= 3307

Datadir=/VAR/LIB/MYSQL2

Log-bin=mysql-bin2

user= MySQL

[MYSQLD3]

socket=/var/lib/mysql3/mysql3.sock

Port= 3308

Datadir=/var/lib/mysql3

Log-bin=mysql-bin3

user= MySQL

4. Launch instance

View Status: Mysqld_multi--defaults-extra-file=/etc/my.cnf report

Start individually: Mysqld_multi--defaults-extra-file=/etc/my.cnf start 2

Mysqld_multi--defaults-extra-file=/etc/my.cnf Start 3

5, check whether the normal start

Check if the port is listening properly: NETSTAT-TUNLP

View process: Ps-aux|grep MySQL

6. Connection attempt: Enter Mysql-uroot-p-h127.0.0.1-p3307 respectively


7, refer to the master-slave synchronization of the next step to achieve a multi-master one from.

http://oanyt.blog.51cto.com/6168303/1093768




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.