Share this article:

Spread Configuration Best Practices

Important: Make changes to your spread configuration with careful consideration. Misspellings or an incorrect configuration can prevent your database from starting up.

When a statement is executed, Vertica communicates with other nodes in the cluster via a data channel using the TCP protocol to transmit data. For example, when a query executes a COPY statement, the rows that are loaded and sent between nodes are controlled by the data channel.

The spread process uses the control channel to coordinate all messages and communication between nodes in the cluster. For example, the node state, query plan execution, and COMMIT statements are all controlled by the control channel. The control channel does not coordinate the flow of data.

The following graphic illustrates this architecture:

 

Spread is a messaging service that provides high reliability across networks in your database. Spread provides fault tolerance by controlling active processes and reliably delivering messages to all members in a group. Spread also provides cluster coordination by maintaining message order and retransmitting messages when necessary.

Change the Communication Mode (Broadcast or Point to Point)

Spread configuration is stored in the Vertica catalog and printed in the spread.conf file when the node starts up. You can make changes to the spread configuration using SQL statements that overwrite the spread.conf file. Manual changes in spread.conf are not persistent.

You can configure spread to run in one of two ways – either using broadcast or using point to point.

UDP Broadcast

Broadcast is the default configuration for the control channel. In this configuration, nodes broadcast one message that the network switch must distribute to the other nodes.

To set the spread control mode to broadcast, use the following statement:

=> SELECT set_control_mode ('broadcast');
set_control_mode
---------------------------
Control mode set to broadcast
(1 row)

UDP Point to Point

In this configuration, the topology is the same as broadcast. However, a node can send a package with a header to each node, and the switch can then reroute that package to the corresponding node. If the switch only has Vertica nodes, this option could present more traffic. However, if the switch has other applications or nodes, using this option reduces the chance that the package is lost. The point to point option is preferred when there are many network hops between nodes or when running clusters in the cloud.

To set the spread control mode to point to point, use the following statement:

=> SELECT set_control_mode ('pt2pt');
set_control_mode
---------------------------
Control mode set to pt2pt
(1 row)

Changing Spread Log Configuration

Spread logging is disabled by default. For best results, keep spread logging disabled so that spread focuses on communication messages. In some situations, it might be necessary to enable spread logging to debug a particular issue.

Set spread incidentals using the following statement:

=> SELECT set_spread_options ('logfile', ‘debugflags’, ‘extras’);

Disable spread logging using the following statement:

=> SELECT set_spread_options('/dev/null/,'EXIT','ExitOnIdle = yes');

Enable spread logging using the following statement:

=> SELECT set_spread_options('/opt/vertica/log/spread.log', 'MEMBERSHIP PRINT CONFIGURATION GROUPS SESSION EXIT', 
'ExitOnIdle = yes');

Viewing and Reloading Spread

Spread uses the spread.conf file, located in the catalog folder. If you make changes to the spread configuration, you must generate a new spread.conf file, and reload spread for the changes to take effect.

To see the catalog view of the spread configuration, use the following statement:

=> SELECT generate_spread_config ();

To write out the spread.conf on the initiator node, use the following statement:

=> SELECT write_spread_config('');

To reload the spread daemons, use the following statement:

=> SELECT reload_spread (true);
reload_spread
---------------
Reloaded
(1 row)

After you have reloaded the spread daemons, you must stop the database and restart it for the new spread configuration to take effect.

Share this article: