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 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
5o (using the letter “o” by mistake), the system displays the following message:
PROPERTY PRIOR NEW 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:
Open a terminal window and log in to a node on your cluster.
At the prompt, type
rpk cluster config edit. To edit tuning properties, type
rpk cluster config edit --allinstead.
Edit the configuration file and set values for the properties you want to change.
Save the file and quit the editor.
At the prompt, type
rpk cluster config statusto see whether the cluster requires a restart. If a restart is necessary, you will see a message like this:
$ rpk cluster config status NODE CONFIG-VERSION NEEDS-RESTART INVALID UNKNOWN 1 4 true  
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:
PROPERTY PRIOR NEW tx_timeout_delay_ms 1000 2000 Successfully updated configuration. New configuration version is 2.
You can also change property values using the
To see the current value of a property, run
rpk cluster config get <property_name>. For example:
$ rpk cluster config get log_compression_type producer
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.
Export the current configuration settings to a
.yamlfile 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.
<filename>.yamlto the other cluster.
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>.yamlto all nodes in the cluster.
Redpanda does not support importing cluster-specific identification (such as
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.
Using Raft to centralize cluster configuration in Redpanda article