How to Create a Database with Desired Node Names
Amaksh
Vertica Employee Employee
Tip by Mohit Saxena
To be able to copy a cluster in Vertica, you must provide the same node name on the target. However, you might have nonsequential node names in the source database as in the following:
$ admintools -t list_allnodes Node | Host | State | Version | DB -------------------+----------------+-------+------------------+-------- v_prodee_node0004 | 192.168.51.201 | UP | vertica-9.3.1.10 | prodee v_prodee_node0005 | 192.168.51.202 | UP | vertica-9.3.1.10 | prodee v_prodee_node0006 | 192.168.51.203 | UP | vertica-9.3.1.10 | prodee
In this case, you would need to create a database with the desired node names to copy a cluster.
To do this,
- Modify the following [nodes] section in admintools.conf with the desired node names:
[nodes] node0004 = 192.168.51.204,/home/dbadmin,/home/dbadmin node0005 = 192.168.51.205,/home/dbadmin,/home/dbadmin node0006 = 192.168.51.206,/home/dbadmin,/home/dbadmin v_prodee_node0004 = 192.168.51.204,/home/dbadmin,/home/dbadmin v_prodee_node0005 = 192.168.51.205,/home/dbadmin,/home/dbadmin v_prodee_node0006 = 192.168.51.206,/home/dbadmin,/home/dbadmin
- Run the following create db command by providing node names in the hosts list:
$ admintools -t create_db -d prodee --compat21 -s v_prodee_node0004,v_prodee_node0005,v_prodee_node0006 Info: no password specified, using none WARNING: --compat21 is deprecated as of Vertica. Support may be removed in future versions. Creating database prodee
- Check the database status.
$ admintools -t list_allnodes Node | Host | State | Version | DB -------------------+----------------+-------+------------------+-------- v_prodee_node0004 | 192.168.51.204 | UP | vertica-9.3.1.10 | prodee v_prodee_node0005 | 192.168.51.205 | UP | vertica-9.3.1.10 | prodee v_prodee_node0006 | 192.168.51.206 | UP | vertica-9.3.1.10 | prodee
0