MariaDB replicate

/etc/my.cnf

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

max_allowed_packet=32M
max_connections=500

#innodb_log_buffer_size = 32M
innodb_buffer_pool_size=6G
key_buffer_size = 10M
#innodb_log_file_size = 768M

#Replication
server_id       = 67
log-bin         = /var/lib/mysql/mysql-bin
log-bin-index   = /var/lib/mysql/mysql-bin.index
relay-log       = /var/lib/mysql/mysql-relay-bin
relay-log-index = /var/lib/mysql/mysql-relay-bin.index
binlog-format   = mixed
expire_logs_days= 5
max_binlog_size = 100M
auto_increment_increment = 5
auto_increment_offset = 2

replicate_wild_ignore_table = %.cache%
slave-skip-errors = 1032,1053,1062

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
!includedir /etc/my.cnf.d


MariaDB [(none)]> CHANGE MASTER TO MASTER_HOST='xxxxxx',MASTER_USER='repl', MASTER_PASSWORD='xxxxxx', MASTER_LOG_FILE='mysql-bin.000058', MASTER_LOG_POS=245;
MariaDB [(none)]>show master status \G
MariaDB [(none)]> show slave status \G


MariaDB [(none)]> START SLAVE;
MariaDB [(none)]> STOP SLAVE;

MariaDB [(none)]> CREATE USER 'repl'@'localhost' IDENTIFIED BY 'repl1cat1onpass';
MariaDB [(none)]> GRANT SUPER, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT, PROCESS ON *.* TO repl@'localhost';

Comments

Popular posts from this blog

VIOS TIPs

Configure Solaris 10 LDOM on Solaris 11.4

Change P410i from HBA mode to Raid mdoe