Configure Cluster Properties

When you install Redpanda software, it automatically generates a cluster configuration with default settings assigned to each cluster property. You might want to change some of the default settings, particularly if you plan to use features such as rack awareness or tiered storage, which are disabled by default.

Tunable properties, such as internal buffer sizes, have default settings that you typically do not need to modify during normal operations. You should only change these properties after collecting sufficient data to warrant a change.

To view all cluster properties, along with their descriptions and default settings, refer to Cluster configuration properties and Tunable properties.

Editing cluster properties

To change any property settings, edit the configuration from the command line using your default text editor. As you make changes, the Redpanda Admin API verifies that the new value is valid. For example, if you change fetch_max_bytes from the default of 57671680 to 5o (using the letter “o” by mistake), the system displays the following message:

fetch_max_bytes  57671680  5o

Validation errors:
 * fetch_max_bytes: expected type integer

No changes were made.

The following instructions explain how to change the values currently assigned to cluster properties. After you save your configuration changes, the new values are automatically applied and a new version number is generated. Any subsequent edits start with the most recent version of the configuration.

Some properties require that you restart the cluster for a change to take effect. When this is the case, the default configuration includes this information in the descriptions for these properties.

To assign new values to cluster properties:

  1. Open a terminal window and log in to a node on your cluster.

  2. At the prompt, type rpk cluster config edit. To edit tuning properties, type rpk cluster config edit --all instead.

  3. Edit the configuration file and set values for the properties you want to change.

  4. Save the file and quit the editor.

  5. At the prompt, type rpk cluster config status to see whether the cluster requires a restart. If a restart is necessary, you will see a message like this:

    $ rpk cluster config status
    1     4               true           []       []
  6. If necessary, restart the cluster.

    When you finish your edits, the system updates the configuration and displays a message that lists which property settings were changed, along with their prior and new values. The message also includes the new version number of the configuration. For example:

tx_timeout_delay_ms  1000   2000

Successfully updated configuration. New configuration version is 2.
You can also change property values using the rpk cluster config set command, but this method does not display the current setting or the description.

Viewing the current value of a property

To see the current value of a property, run rpk cluster config get <property_name>. For example:

$ rpk cluster config get log_compression_type

Copying configurations to other clusters

Use the export option to save the current cluster configuration to a file. You can then copy this file to other clusters so they can use the same configuration.

  1. Export the current configuration settings to a .yaml file by running rpk cluster config export –filename <filename>.yaml. To store the configuration file outside your current working directory, use the full pathname for –filename; otherwise, supply the filename to store the file in your current working directory.

  2. Copy <filename>.yaml to the other cluster.

  3. Log in to the other cluster and import the file with the saved configuration by running rpk cluster config import –filename <filename>.yaml. This command applies the property settings in <filename>.yaml to all nodes in the cluster.

Redpanda does not support importing cluster-specific identification (such as cluster_id) with this command.

Removing cluster properties from a redpanda.yaml file

If you have a redpanda.yaml file that contains both cluster and node properties, the cluster properties are ignored. You can remove cluster properties from the redpanda.yaml file by running the following command:

rpk cluster config lint

This avoids the issue of referring to a previous version or custom configuration.

Suggested reading

  • Using Raft to centralize cluster configuration in Redpanda article