# CLUSTER SETNODENAME

> Give the receiving node a human-readable name that every node uses for it in its logs.

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

```
CLUSTER SETNODENAME name
```

- Group: Cluster
- Complexity: O(1)
- HotKV Cloud: not available
- On-Premise: no license needed

`CLUSTER SETNODENAME` sets the receiving node's human-readable name, the
value of `cluster-announce-human-nodename`. The name is saved in
`nodes.conf` and sent to every other node at once, and all nodes then use it
for this node in their log lines instead of its address, which makes the
logs of a large cluster easier to follow. `""` removes the name.

The name can be up to 40 characters of printable ASCII, without spaces,
`,`, `=`, quotes or backslashes. The command has the same effect as
`CONFIG SET cluster-announce-human-nodename name`. A name set this way
stays after a restart unless the configuration file sets another one.

## Return value

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

| Case | Error |
| --- | --- |
| More than 40 characters | `ERR Node name too long (max 40 characters)` |
| A character that is not allowed | `ERR Invalid node name: it may not contain spaces, control characters, ',', '=', quotes or backslashes` |
| Cluster mode is off | `ERR This instance has cluster support disabled` |

## Examples

```
127.0.0.1:6379> CLUSTER SETNODENAME eu-west-primary-1
OK
127.0.0.1:6379> CLUSTER SETNODENAME "primary 1"
(error) ERR Invalid node name: it may not contain spaces, control characters, ',', '=', quotes or backslashes
```

## Compatibility

HotKV-only subcommand. Redis 7.2 and Valkey 8 set the same name through
`cluster-announce-human-nodename` only.

## See also

[CLUSTER NODES](https://docs.hotkv.com/commands/cluster-nodes/index.md), [CLUSTER MYID](https://docs.hotkv.com/commands/cluster-myid/index.md)

In a cluster: [Monitoring a cluster](https://docs.hotkv.com/clustering/monitoring/index.md)