Bug #85342 | Cluster.addInstance fails when adding a node | ||
---|---|---|---|
Submitted: | 7 Mar 2017 14:30 | Modified: | 11 May 2018 19:32 |
Reporter: | Eduardo Alapisco Arambula | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: Document Store: MySQL Shell | Severity: | S1 (Critical) |
Version: | 1.0.8-rc | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[7 Mar 2017 14:30]
Eduardo Alapisco Arambula
[11 May 2018 19:33]
Hema Sridharan
[From Dev Team] Could not reproduce the issue (not a bug). In the description, the second createCluster() (step 8) was executed without assigning the new cluster to a variable and the old cluster variable is used in the next operation (step 9) to add the instance which will lead to an expected error, however after getting the new cluster variable the addInstance() will execute successfully. {noformat} mysql-js> dba.deploySandboxInstance(3310, {portx:3320, password:"password", allowRootFrom:"%"}); Deploying new MySQL instance... Instance localhost:3310 successfully deployed and started. Use shell.connect('root@localhost:3310'); to connect to the instance. mysql-js> dba.deploySandboxInstance(3330, {portx:3340, password:"password", allowRootFrom:"%"}); Deploying new MySQL instance... Instance localhost:3330 successfully deployed and started. Use shell.connect('root@localhost:3330'); to connect to the instance. mysql-js> \connect -c root:password@localhost:3310 Creating a Classic Session to 'root@localhost:3310' Closing old connection... Session successfully established. No default schema selected. mysql-js> dba.createCluster('cluster1', {multiMaster:true,force:true}) A new InnoDB cluster will be created on instance 'root@localhost:3310'. Creating InnoDB cluster 'cluster1' on 'root@localhost:3310'... Adding Seed Instance... Cluster successfully created. Use Cluster.addInstance() to add MySQL instances. At least 3 instances are needed for the cluster to be able to withstand up to one server failure. <Cluster:cluster1> mysql-js> cluster = dba.getCluster('cluster1'); <Cluster:cluster1> mysql-js> cluster.addInstance({user:"root", password:"password", host:"localhost", port:3330}); A new instance will be added to the InnoDB cluster. Depending on the amount of data on the cluster this might take from a few seconds to several hours. Adding instance to the cluster ... The instance 'root@localhost:3330' was successfully added to the cluster. mysql-js> cluster.dissolve({force:true}); The cluster was successfully dissolved. Replication was disabled but user data was left intact. mysql-js> dba.createCluster('cluster1', {multiMaster:false,force:true}); A new InnoDB cluster will be created on instance 'root@localhost:3310'. Creating InnoDB cluster 'cluster1' on 'root@localhost:3310'... Adding Seed Instance... Cluster successfully created. Use Cluster.addInstance() to add MySQL instances. At least 3 instances are needed for the cluster to be able to withstand up to one server failure. <Cluster:cluster1> mysql-js> cluster.addInstance({user:"root", password:"password", host:"localhost", port:3330}); Cluster.addInstance: Can't call function 'addInstance' on a dissolved cluster (RuntimeError) mysql-js> cluster = dba.getCluster('cluster1'); <Cluster:cluster1> mysql-js> cluster.addInstance({user:"root", password:"password", host:"localhost", port:3330}); A new instance will be added to the InnoDB cluster. Depending on the amount of data on the cluster this might take from a few seconds to several hours. Adding instance to the cluster ... The instance 'root@localhost:3330' was successfully added to the cluster. mysql-js> {noformat}