+ port to remote config

This commit is contained in:
Alexander Demidov
2021-01-27 18:05:08 +00:00
parent d9d40251f7
commit 96c811950f
3 changed files with 4 additions and 4 deletions

View File

@ -2,3 +2,4 @@
user=replicationuser user=replicationuser
password=replicationpassword password=replicationpassword
host=remotehostip host=remotehostip
port=3306

View File

@ -19,5 +19,6 @@ echo "Apply bin log position to local mariadb db instance" >> $log_file
replication_user=`cat ./.remote.my.cnf | grep user | cut -d'=' -f2` replication_user=`cat ./.remote.my.cnf | grep user | cut -d'=' -f2`
replication_password=`cat ./.remote.my.cnf | grep password | cut -d'=' -f2` replication_password=`cat ./.remote.my.cnf | grep password | cut -d'=' -f2`
replication_host=`cat ./.remote.my.cnf | grep host | cut -d'=' -f2` replication_host=`cat ./.remote.my.cnf | grep host | cut -d'=' -f2`
replication_port=`cat ./.remote.my.cnf | grep port | cut -d'=' -f2`
mysql --defaults-extra-file=./.my.cnf -e "CHANGE MASTER TO MASTER_HOST = '$replication_host', MASTER_USER = '$replication_user', MASTER_PASSWORD = '$replication_password', MASTER_LOG_FILE = '$remote_master_log_file', MASTER_LOG_POS = $remote_master_log_pos;" mysql --defaults-extra-file=./.my.cnf -e "CHANGE MASTER TO MASTER_HOST = '$replication_host', MASTER_PORT = $replication_port, MASTER_USER = '$replication_user', MASTER_PASSWORD = '$replication_password', MASTER_LOG_FILE = '$remote_master_log_file', MASTER_LOG_POS = $remote_master_log_pos;"

View File

@ -19,9 +19,7 @@ do
REMOTE_SQL=$REMOTE_SQL' USE '$i'; FLUSH TABLES WITH READ LOCK;' REMOTE_SQL=$REMOTE_SQL' USE '$i'; FLUSH TABLES WITH READ LOCK;'
done done
REMOTE_SQL=$REMOTE_SQL' system ./_activate-slave.sh;' REMOTE_SQL=$REMOTE_SQL' system ./_activate-slave.sh; system ./_dump.sh;'
REMOTE_SQL=$REMOTE_SQL' system ./_dump.sh;'
for i in ${databases[@]} for i in ${databases[@]}
do do