Renaming a node?

Moderator: NorbertKrupa

Post Reply
User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Renaming a node?

Post by Julie » Sun Jan 17, 2016 10:56 pm

Hi,

I have a three node cluster. After adding/removing nodes I ended up with the following node names:

Code: Select all

dbadmin=> select node_name from nodes;
       node_name
-----------------------
 v_instruments_node0001
 v_instruments_node0002
 v_instruments_node0004
(1 row)
I realize that it is not necessary, but to satisfy my OCD, Is it possible to rename node "v_instruments_node0004" to "v_instruments_node0003"?

Thank you!
Thanks,
Juliette

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Renaming a node?

Post by JimKnicely » Mon Jan 18, 2016 1:04 am

Hi Julie,

It is possible and listed below are the steps to do so. Make sure to test first prior to trying in a prod environment and you should make sure you have a valid backup!

Warnings:
  • The process will temporarily cause your DB to be running on only two nodes.
  • The process will have to perform two re-balance operations. If the amount of data that needs to be re-balanced is large, this could take a long time.
Probably the best option is to leave the node name well enough alone :)

If you wish to continue, here are the steps:

1. Using admintools, remove node v_instruments_node0004 from the "instruments" database.

2. Using VSQL, issue the following statements:

Code: Select all

CREATE NODE v_instruments_node0003 IS HOSTNAME 'XXX.XXX.XXX.XXX' DATAPATH '../instruments/v_instruments_node0003_data' CATALOGPATH '../instruments/v_instruments_node0003_catalog' CONTROL HOSTNAME 'XXX.XXX.XXX.XXX'; 
SELECT reload_spread(true); 
** Please use the correct hostname or IP for the host in the above CREATE NODE statement. Also, your catalog and data directory path above should be identical to what it is set on the other nodes.

3. Edit the /opt/vertica/config/admintools.conf file include the newly added node in the [Nodes] section and in the [Database:instruments] section. You can copy an existing entry and then modify the nodename to v_instruments_node0003

4. Using AdminTools, distribute the AdminTools meta-data to the rest of the cluster (Main menu -> Configuration Menu -> Distribute Config Files).

5. SSH to the new node and create the data directory "../instruments/v_instruments_node0003_data" amnd catalog directory "../instruments/v_instruments_node0003_catalog directories". Set the same permissions /ownership to these directories by comparing it with an existing node.

6. Using AdminTools, restart Vertica on the newly added node - v_instruments_node0003. You should see the new node come UP.

I hope this helps!
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “Vertica Database Administration”