1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
var dbPass = "mysql"
var clusterName = "devCluster"
try {
print('Setting up InnoDB cluster...\n');
shell.connect('root@mysql-server-1:3306', dbPass)
var cluster = dba.createCluster(clusterName);
print('Adding instances to the cluster.');
cluster.addInstance({user: "root", host: "mysql-server-2", password: dbPass}, {recoveryMethod: 'incremental'})
print('.');
cluster.addInstance({user: "root", host: "mysql-server-3", password: dbPass}, {recoveryMethod: 'incremental'})
print('.\nInstances successfully added to the cluster.');
print('\nInnoDB cluster deployed successfully.\n');
} catch (e) {
print('\nThe InnoDB cluster could not be created.\n\nError: ' + e.message + '\n');
}
|