How to change the port of a leaf node without 'rebalance partitions'?


There are two leaf nodes and HA is on.

I did the following to try to change from port 3306 to another port (e.g. 3307).

Task 1. The following steps have been performed.

  1. memsql-admin stop-node
  2. Change the port (3306-> 3307) in “memsql.cnf”
  3. memsql-admin start node …

Task 2. The above task has not been completed, and has moved on to the next step.

Connect to MA

  1. “remove leaf …”
  2. “add leaf …”
  3. “rebalance partitions on …”

Is there any way I don’t need to do task 2?
“rebalance partitions” cause temporary locks.

Thanks in advance.


You can do “REMOVE LEAF … FORCE”, if you don’t mind some temporary downtime (until you run ADD LEAF). The “FORCE” will cause REMOVE LEAF not to bother rebalancing data. ADD LEAF will re-attach any data back into the cluster and put you back into the same state you were in before the add/remove.

Thank you for quick response.

I tried as your answered, but I need to do a “rebalance partitions”.
And, I need to restart the leaf node that changed the port.

  1. remove leaf ‘ip’:3306 force;

  2. Change the port (3306->3307) in “memsql.cnf”

  3. memsql-admin restart-node --memsql-id 30987E4340

  4. add leaf ‘root’:‘passwd’@‘ip’:3307;

  5. show partitions on test;
    The pair node has all master partitions.

  6. rebalance partitions;

Is there another way?
Thanks again.

Yep, your right. REMOVE … FORCE still triggers a failover to keep the cluster online. So when you ADD LEAF it will attach back the slave partitions that were on the leaf before the REMOVE, but the “old masters” need to be copied again (and promoted back to masters). So REMOVE… FORCE saves you some rebalance work, but not all of it. I’m checking if we have a feature request for this.