Creating Subclusters
By default, new Eon Mode databases contain a single primary subcluster named default_subcluster. This subcluster contains all of the nodes that are part of your database when you create it. To create a new subcluster, use the admintools db_add_subcluster
tool:
$ admintools -t db_add_subcluster -h Usage: db_add_subcluster [options] Options: -h, --help show this help message and exit -d DB, --database=DB Name of database to be modified -s HOSTS, --hosts=HOSTS Comma separated list of hosts to add to the subcluster -p DBPASSWORD, --password=DBPASSWORD Database password in single quotes -c SCNAME, --subcluster=SCNAME Name of the new subcluster for the new node --is-secondary Create secondary subcluster --control-set-size=CONTROLSETSIZE Set the number of nodes that will run spread within the subcluster --timeout=NONINTERACTIVE_TIMEOUT set a timeout (in seconds) to wait for actions to complete ('never') will wait forever (implicitly sets -i) -i, --noprompts do not stop and wait for user input(default false). Setting this implies a timeout of 20 min.
The simplest command adds an empty subcluster. It requires the database name, password, and name for the new subcluster. This example adds a subcluster named analytics_cluster to the database named verticadb:
$ adminTools -t db_add_subcluster -d verticadb -p 'password' -c analytics_cluster Creating new subcluster 'analytics_cluster' Subcluster added to verticadb successfully.
By default, Vertica makes a new subclusters a primary subcluster. You can have it create a secondary subcluster by supplying the --is-secondary
argument.
Adding Nodes While Creating a Subcluster
You can also specify one or more nodes for Vertica to add to the subcluster while creating it. These nodes must be part of the cluster but not already part of the database. For example, nodes that you have added to the cluster using the MC or admintools, or nodes you have dropped from the database. This example creates analytics_cluster as a secondary subcluster and adds three nodes to it.
$ adminTools -t db_add_subcluster -c analytics_cluster \ -d verticadb -p 'password' -s 10.11.12.117,10.11.12.251,10.11.12.193 \ --is-secondary Creating new subcluster 'analytics_cluster' New subcluster is Secondary Adding new hosts to 'analytics_cluster' Verifying database connectivity...10.11.12.10 Eon database detected, creating new depot locations for newly added nodes Creating depots for each node Eon database detected, creating new depot locations for newly added nodes Creating depots for each node Eon database detected, creating new depot locations for newly added nodes Creating depots for each node Generating new configuration information and reloading spread Replicating configuration to all nodes Starting nodes Starting nodes: v_verticadb_node0004 (10.11.12.117) v_verticadb_node0005 (10.11.12.251) v_verticadb_node0006 (10.11.12.193) Starting Vertica on all nodes. Please wait, databases with a large catalog may take a while to initialize. Checking database state Node Status: v_verticadb_node0004: (DOWN) v_verticadb_node0005: (DOWN) v_verticadb_node0006: (DOWN) Node Status: v_verticadb_node0004: (DOWN) v_verticadb_node0005: (DOWN) v_verticadb_node0006: (DOWN) Node Status: v_verticadb_node0004: (DOWN) v_verticadb_node0005: (DOWN) v_verticadb_node0006: (DOWN) Node Status: v_verticadb_node0004: (DOWN) v_verticadb_node0005: (DOWN) v_verticadb_node0006: (DOWN) Node Status: v_verticadb_node0004: (UP) v_verticadb_node0005: (UP) v_verticadb_node0006: (UP) Communal storage detected: syncing catalog Multi-node DB add completed Nodes added to subcluster analytics_cluster successfully. Subcluster added to verticadb successfully.
Your newly-added nodes do not have any subscriptions to shards. See Updating Shard Subscriptions After Adding Nodes for more information.
Subclusters and Large Cluster
Vertica has a feature named large cluster that helps manage broadcast messages as the database cluster grows. It has several impacts on adding new subclusters:
- If you create a new subcluster with 16 or more nodes, Vertica automatically enables the large cluster feature. It sets the number of control nodes to the square root of the number of nodes in your subcluster. See Planning a Large Cluster.
- You can set the number of control nodes in a subcluster while creating it using the command line by using the
--control-set-size
option. - If your database cluster has 120 control nodes, Vertica returns an error if you try to add a new subcluster. Every subcluster must have at least one control node. Your database cannot have more than 120 control nodes. When your database reaches this limit, you must reduce the number of control nodes in other subclusters before you can add a new subcluster. See Changing the Number of Control Nodes and Realigning for more information.
See Large Cluster for more information about the large cluster feature.