nixos/mysql: fix mysqlReplication test (#61671)
nixos/mysql: fix mysqlReplication test
This commit is contained in:
@@ -272,8 +272,13 @@ in
|
|||||||
port = ${toString cfg.port}
|
port = ${toString cfg.port}
|
||||||
datadir = ${cfg.dataDir}
|
datadir = ${cfg.dataDir}
|
||||||
${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" }
|
${optionalString (cfg.bind != null) "bind-address = ${cfg.bind}" }
|
||||||
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"}
|
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave")
|
||||||
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"}
|
''
|
||||||
|
log-bin=mysql-bin-${toString cfg.replication.serverId}
|
||||||
|
log-bin-index=mysql-bin-${toString cfg.replication.serverId}.index
|
||||||
|
relay-log=mysql-relay-bin
|
||||||
|
server-id = ${toString cfg.replication.serverId}
|
||||||
|
''}
|
||||||
${optionalString (cfg.ensureUsers != [])
|
${optionalString (cfg.ensureUsers != [])
|
||||||
''
|
''
|
||||||
plugin-load-add = auth_socket.so
|
plugin-load-add = auth_socket.so
|
||||||
@@ -381,6 +386,7 @@ in
|
|||||||
|
|
||||||
( echo "stop slave;"
|
( echo "stop slave;"
|
||||||
echo "change master to master_host='${cfg.replication.masterHost}', master_user='${cfg.replication.masterUser}', master_password='${cfg.replication.masterPassword}';"
|
echo "change master to master_host='${cfg.replication.masterHost}', master_user='${cfg.replication.masterUser}', master_password='${cfg.replication.masterPassword}';"
|
||||||
|
echo "set global slave_exec_mode='IDEMPOTENT';"
|
||||||
echo "start slave;"
|
echo "start slave;"
|
||||||
) | ${mysql}/bin/mysql -u root -N
|
) | ${mysql}/bin/mysql -u root -N
|
||||||
''}
|
''}
|
||||||
|
|||||||
Reference in New Issue
Block a user