CLUSTER SETNODENAME
CLUSTER SETNODENAME name
- Group
- Cluster
- Complexity
- O(1)
- Arity
- 3 (exactly, counting the command name)
- 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
Section titled “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
Section titled “Examples”127.0.0.1:6379> CLUSTER SETNODENAME eu-west-primary-1OK127.0.0.1:6379> CLUSTER SETNODENAME "primary 1"(error) ERR Invalid node name: it may not contain spaces, control characters, ',', '=', quotes or backslashesCompatibility
Section titled “Compatibility”HotKV-only subcommand. Redis 7.2 and Valkey 8 set the same name through
cluster-announce-human-nodename only.
See also
Section titled “See also”In a cluster: Monitoring a cluster
Was this page helpful?
Thanks for the feedback.