我在微軟雲端上搭建mysql主從複製master-slave
使用了bitnami with replication 的鏡像
鏡像中my.cnf配置(主伺服器)
[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配置(從伺服器)
[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
並沒有關於REPLICATE_DO_DB 參數的設定
連線進入mysql後執行sql修改REPLICATE_DO_DB
CHANGE REPLICATION FILTER REPLICATE_DO_DB = ();
在啟動slave;主從複製是可以得的,可是每次reboot從伺服器後REPLICATE_DO_DB bitnami資料庫
是不是還有其他地方設定REPLICATE_DO_DB?
這種情況肯定是在預設啟動參數中配置了才會按這個啟動(猜測要么你看的配置文件不對,要么可能在你創建的時候就配置的),你需要將你的自定義參數寫到設定檔中嘗試一下
把主從設定資訊寫入設定檔!
自己linux不熟出現的問題,是在設定檔裡面
設定檔最後 !include /bitnami/mysql/conf/my_custom.cnf
linux檔案連結
這裡設定。 。 。文件找了很久