Skip to content

KR.ADMIN REMOVE-MEMBER

Removes a member from the cluster.

KR.ADMIN REMOVE-MEMBER <member-id>
ParameterTypeDescription
member-idstringExactly 40 characters for a full member ID, or exactly 4 characters for a prefix. A prefix is resolved against currently registered members.

Simple string. Returns OK on success.

Members in RUNNING status cannot be removed. This safety guard prevents accidental removal of active members.

After a successful removal, other cluster members observe the change promptly.

Requires cluster initialization.

Typical workflow: set the member to STOPPED with SET-MEMBER-STATUS first, then call REMOVE-MEMBER to decommission it.

ErrorCondition
ERR cluster has not been initialized yetThe cluster must be initialized first.
ERR Member in RUNNING status cannot be removedThe member is still active and must be stopped first.
ERR Member: <member-id> not registeredNo member with the given ID exists in the cluster.
ERR Member: <member-id> not registered properlyThe member’s directory exists but its data is missing or corrupted.
ERR Invalid memberId: <id>The value is neither a 40-character full member ID nor a 4-character prefix.
ERR no member found with prefix: <prefix>No registered member ID starts with the given 4-character prefix.
ERR more than one member found with prefix: <prefix>The 4-character prefix is ambiguous.

Remove a stopped member:

127.0.0.1:3320> KR.ADMIN SET-MEMBER-STATUS 006cdc459c59e600c76494e8388857fc3cba2fa8 STOPPED
OK
127.0.0.1:3320> KR.ADMIN REMOVE-MEMBER 006cdc459c59e600c76494e8388857fc3cba2fa8
OK

Using a 4-character prefix:

127.0.0.1:3320> KR.ADMIN REMOVE-MEMBER 006c
OK

Attempting to remove a running member:

127.0.0.1:3320> KR.ADMIN REMOVE-MEMBER 006cdc459c59e600c76494e8388857fc3cba2fa8
(error) ERR Member in RUNNING status cannot be removed

Member not found:

127.0.0.1:3320> KR.ADMIN REMOVE-MEMBER a3f18b2e74d9c5601f82e4a7b390d612c8f7e149
(error) ERR Member: a3f18b2e74d9c5601f82e4a7b390d612c8f7e149 not registered