Changing Server Node Name

I have started a Couchbase cluster on AWS EC2 with public DNS for server node name.
I used public DNS since I needed to use XDCR. (http://blog.couchbase.com/cross-data-center-replication-step-step-guide-amazon-aws)

But I no longer need to use XDCR.
So I guess using public DNS may cause extra charge on AWS network usage. (Since using public IP costs $0.01/GB)

Hence, I want to change the cluster node names to private IP.
How could I do so for the running cluster?

If it’s not possible, would there be any alternative way (best way) to change them?

First it is important to ensure your apps hitting this server will continue to work on whatever option you choose to use for the names. if you use the private IP, ensure that private IP is something your apps can resolve.
The way to perform the operation would be to remove the node > rebalance and bring the node back in with the new name > rebalance. You can do this in a rolling fashion across the cluster (ex: one node at a time). As long as you have a replica configured, remove will fail over and with the new add it will fail back to the new node.
Hope this helps.

1 Like

I agree with Cihan: the way to reset your node names to private IP addresses is via a swap rebalance:

(1) remove 1 node and rebalance the cluster
(2) add back that node using its private IP address as the node name and simultaneously remove the next node and rebalance the cluster again
(3) repeat step 2 until all nodes in the cluster have been removed and re-added using their private IP addresses as their node names.

I just set up a 5-node cluster on AWS and did exactly that renaming/rebalance sequence and it succeeded without problem so that all of the node names are now the private IP addresses of the nodes.

I also want to reiterate Cihan’s concern that your clients remain able to connect to the cluster once you have “taken it private”.

Finally, I’m trying to figure out if doing all this is actually going to achieve your goal of saving network transmission charges on AWS: if you are operating web server clients inside of AWS so that they can connect to the local IP addresses your strategy should work. However if your clients are outside of AWS and must continue to connect using public DNS names, I’m not sure if changing your node names to their private IP addresses will get you any savings.

1 Like

@cihangirb @morrie : Thank you very much for your concern.

Since I am running my web server client within AWS as well, it looks like saving network charge would work as planned. :smile:
Plus, thank you for your idea as well.

@Dynamicscope ec2 public IP’s will resolve the internal IP’s address when resolving from within aws. Hence, if your app is also within ec2 you can use the public IP to connect - the data will move internally through AWS and you won’t be charged.

btw. how did you enter the external IP address?

I get this error when trying to enter it during setup: “Could not listen: eaddrnotavail”

Thanks!

@whollycow007
Thank you for the tip~!! :slight_smile:
For entering the external IP, I just followed this step.

@Dynamicscope thanks. In 3.0.1 I was actually able to directly enter the ec2 dns name directly into the setup screen and it worked :slight_smile: