Skip to content

Commit

Permalink
Fix Read Replica for V-8.4.2 (#39)
Browse files Browse the repository at this point in the history
Signed-off-by: AshrafulHaqueToni <[email protected]>
Co-authored-by: SK Ali Arman <[email protected]>
  • Loading branch information
AshrafulHaqueToni and sheikh-arman authored Nov 11, 2024
1 parent f5a9b2c commit 3f2a4b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/run_read_only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ function wait_for_mysqld_running() {
function start_read_replica() {
#stop_slave
local mysql="$mysql_header --host=$localhost"
$mysql_header -e "stop slave;"
$mysql_header -e "stop replica;"
ssl_config=",SOURCE_SSL=0"
if [[ "$source_ssl" == "true" ]]; then
ssl_config=",SOURCE_SSL=1,SOURCE_SSL_CA = '/etc/mysql/server/certs/ca.crt',SOURCE_SSL_CERT = '/etc/mysql/server/certs/tls.crt',SOURCE_SSL_KEY = '/etc/mysql/server/certs/tls.key'"
require_SSL="REQUIRE SSL"
fi
echo $ssl_config
out=$($mysql_header -e "CHANGE MASTER TO MASTER_HOST = '$SOURCE_HOST',MASTER_PORT = 3306,MASTER_USER = '$SOURCE_USERNAME',MASTER_PASSWORD = '$SOURCE_PASSWORD',MASTER_AUTO_POSITION = 1 $ssl_config;")
out=$($mysql_header -e "CHANGE REPLICATION SOURCE TO SOURCE_HOST = '$SOURCE_HOST',SOURCE_PORT = 3306,SOURCE_USER = '$SOURCE_USERNAME',SOURCE_PASSWORD = '$SOURCE_PASSWORD',SOURCE_AUTO_POSITION = 1 $ssl_config;")
echo $out
sleep 1
out=$($mysql_header -e "start slave;")
out=$($mysql_header -e "start replica;")
echo $out

$mysql_header -e "set global super_read_only=ON"
Expand Down

0 comments on commit 3f2a4b3

Please sign in to comment.