Creating Fault Groups Using the Fault Group Script

When you define fault groups, Vertica distributes data segments across the cluster. This allows the cluster to be aware of your cluster topology so it can tolerate correlated failures inherent in your environment, such as a rack failure. For an overview, see High Availability With Fault Groups.

Prerequisites for Defining Fault Groups

Defining fault groups requires careful and thorough network planning. You must have a solid understanding of your network topology.

The user who creates fault groups must be a superuser.

Before you can define fault groups, you must:

Run the Fault Group Script

  1. As the database administrator, run the fault_group_ddl_generator.py script and include the following arguments:
    • The database name
    • The fault group input file

    For example:

    $ python /opt/vertica/scripts/fault_group_ddl_generator.py
        VMart fault_groups_VMart.out > fault_group_ddl.sql  

    The preceding command writes the output of fault_group_ddl_generator.py to a file (fault_group_ddl.sql). This approach allows you to run a single SQL script instead of multiple DDL statements. Also consider saving your input file so you can modify fault groups later, such as after you expand the cluster or change the distribution of control nodes.

  2. Using vsql, run the DDL statements in fault_group_ddl.sql or execute the commands in the file using vsql.

    => \i fault_group_ddl.sql
  3. If you have large cluster enabled, realign the control nodes, as shown. Otherwise, proceed to the next step.

    => SELECT REALIGN_CONTROL_NODES(); 
  4. Save cluster changes to the spread configuration file.

    => SELECT RELOAD_SPREAD(true); 
  5. Use Administration Tools to restart the database.
  6. Save changes to the cluster's data layout by calling the REBALANCE_CLUSTER function.

    => SELECT REBALANCE_CLUSTER();

See Also