# CLUSTER SAVECONFIG

> Write the receiving node's cluster configuration to nodes.conf now.

URL: https://docs.hotkv.com/commands/cluster-saveconfig/

```
CLUSTER SAVECONFIG
```

- Group: Cluster
- Complexity: O(N) where N is the number of known nodes
- HotKV Cloud: not available
- On-Premise: no license needed

`CLUSTER SAVECONFIG` writes the node's view of the cluster (nodes, slots,
epochs) to its cluster configuration file, `cluster-config-file`
(`nodes.conf` by default), before it replies. The node already
saves the file whenever its configuration changes; use this command to make
sure, for example before a backup, or to check that the file can be written.

## Return value

Simple string `OK` in RESP2 and RESP3, or one of these errors:

| Case | Error |
| --- | --- |
| The file could not be written | `ERR error saving the cluster node config: <reason>` |
| Cluster mode is off | `ERR This instance has cluster support disabled` |

## Examples

```
127.0.0.1:6379> CLUSTER SAVECONFIG
OK
```

## Compatibility

Same as Redis 7 and Valkey 8.

## See also

[CLUSTER NODES](https://docs.hotkv.com/commands/cluster-nodes/index.md), [Persistence and backups](https://docs.hotkv.com/persistence/index.md)

In a cluster: [Cluster troubleshooting](https://docs.hotkv.com/clustering/troubleshooting/index.md#nodes-disagree)