I built mysql master-slave replication on Microsoft Cloud
I used bitnami with replication mirror
my.cnf configuration in the mirror (main server)
[mysqladmin]
user=
[mysqld]
skip-name-resolve
basedir=/opt/bitnami/mysql
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
tmpdir=/opt/bitnami/mysql/tmp
max_allowed_packet=16M
bind-address=0.0.0.0
pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
log-error=/opt/bitnami/mysql/logs/mysqld.log
character-set-server=UTF8
collation-server=utf8_general_ci
[client]
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
default-character-set=UTF8
[manager]
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
!include /bitnami/mysql/conf/my_custom.cnf
My.cnf configuration in the mirror (slave server)
[mysqladmin]
user=
[mysqld]
skip-name-resolve
basedir=/opt/bitnami/mysql
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
tmpdir=/opt/bitnami/mysql/tmp
max_allowed_packet=16M
bind-address=0.0.0.0
pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
log-error=/opt/bitnami/mysql/logs/mysqld.log
character-set-server=UTF8
collation-server=utf8_general_ci
[client]
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
default-character-set=UTF8
[manager]
port=3306
socket=/opt/bitnami/mysql/tmp/mysql.sock
pid-file=/opt/bitnami/mysql/tmp/mysqld.pid
!include /bitnami/mysql/conf/my_custom.cnf
There is no setting for the REPLICATE_DO_DB parameter
After connecting to mysql, execute sql to modify REPLICATE_DO_DB
CHANGE REPLICATION FILTER REPLICATE_DO_DB = ();
After starting the slave; master-slave replication is available, but REPLICATE_DO_DB will be rolled back to the default after each reboot of the slave server bitnami database
Is there any other place to set REPLICATE_DO_DB?
为情所困2017-05-18 10:56:55
In this case, you must have configured it in the default startup parameters before you click this startup (guessing that either the configuration file you looked at is wrong, or it may have been configured when you created it), you need to write your custom parameters to Try it in the configuration file
黄舟2017-05-18 10:56:55
Write the master-slave configuration information into the configuration file!
淡淡烟草味2017-05-18 10:56:55
The problem that arises when I am not familiar with Linux is in the configuration file
The last part of the configuration file is !include /bitnami/mysql/conf/my_custom.cnf
Linux file link
Configure here. . . I’ve been looking for the file for a long time