Mariadb 바이너리를 통한 듀얼마스터 구성 - CentOS7.x MySQL/MariaDB

https://downloads.mariadb.org/interstitial/mariadb-10.3.12/bintar-linux-x86_64/mariadb-10.3.12-linux-x86_64.tar.gz/from/http%3A//ftp.kaist.ac.kr/mariadb/
# tar -vxzf mariadb-10.3.12-linux-x86_64.tar.gz 
# mv mariadb-10.3.12-linux-x86_64 mariadb
# groupadd mysql
# useradd -g mysql mysql
# chown mysql.mysql -R mariadb
# cd /home/mysql/mariadb
# ./scripts/mysql_install_db --user=mysql --defaults-file=/etc/my.cnf
# support-files/mysql.server start --basedir=/home/mysql/mariadb --datadir=/home/mysql/mariadb/data
# ./bin/mysqladmin -u root password 'replica'

> GRANT file ON *.* TO replica@"%" IDENTIFIED BY 'replica';
> GRANT REPLICATION SLAVE  ON *.* TO replica@"%" IDENTIFIED BY 'replica';
> flush privileges;

# support-files/mysql.server stop --basedir=/home/mysql/mariadb --datadir=/home/mysql/mariadb/data
# support-files/mysql.server start --basedir=/home/mysql/mariadb --datadir=/home/mysql/mariadb/data

# master_log_file, master_log_pos는 show master status;로 값을 확인할 수 있음(*Master1,2 상대방 값을 입력)
# Master1
> change master to master_host='192.168.0.2', master_user='replica', master_password='replica', master_port=3306, master_log_file='mysql-bin.000003', master_log_pos=123;
> show slave status;

# Master2
> change master to master_host='192.168.0.1', master_user='replica', master_password='replica', master_port=3306, master_log_file='mysql-bin.000003', master_log_pos=234;
> show slave status;

[ 에러조치 - mariadb 실행시 에러 발생 ]
./bin/mysqld: error while loading shared libraries: libaio.so.1: cannot open shared object file: No such file or directory
#yum install libaio
libaio-0.3.109-13.el7.x86_64.rpm
# find / -name libaio*
/usr/lib64/libaio.so.1
/usr/lib64/libaio.so.1.0.0
/usr/lib64/libaio.so.1.0.1
/usr/share/doc/libaio-0.3.109



덧글

댓글 입력 영역