Skip to content
Snippets Groups Projects
Commit 2af17bf2 authored by ale's avatar ale
Browse files

Fix CHANGE MASTER TO syntax

parent 11ca6f48
Branches
No related tags found
No related merge requests found
Pipeline #
#!/bin/sh #!/bin/sh
MASTERELECTION_NAME=${MASTERELECTION_NAME:-mariadb} MASTERELECTION_NAME=${MASTERELECTION_NAME:-mariadb}
REPL_PASSWORD=${REPL_PASSWORD:-mariadb-replication}
if [ -z "${PUBLIC_ADDR}" ]; then if [ -z "${PUBLIC_ADDR}" ]; then
echo "ERROR: PUBLIC_ADDR is undefined" >&2 echo "ERROR: PUBLIC_ADDR is undefined" >&2
...@@ -30,7 +31,7 @@ become_slave() { ...@@ -30,7 +31,7 @@ become_slave() {
log "Switching master to ${master_addr}" log "Switching master to ${master_addr}"
mysql -NBe "CHANGE MASTER TO MASTER_HOST='${master_host}' MASTER_PORT=${master_port} MASTER_USER='replication' MASTER_PASS='${REPL_PASSWORD}' MASTER_CONNECT_RETRY=10 MASTER_USE_GTID=current_pos MASTER_AUTO_POSITION=1; START SLAVE" mysql -NBe "CHANGE MASTER TO MASTER_HOST='${master_host}', MASTER_PORT=${master_port}, MASTER_USER='replication', MASTER_PASSWORD='${REPL_PASSWORD}', MASTER_CONNECT_RETRY=10, MASTER_USE_GTID=current_pos, MASTER_AUTO_POSITION=1; START SLAVE"
# TODO: Wait for replication to catch up. # TODO: Wait for replication to catch up.
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment