rpk cluster fencing enable
Enable fencing to reject new writes.
Fencing rejects new writes and changes to user topics, consumer groups, Schema Registry, ACLs, and roles. Run this command on the source cluster of a Shadow Link before you fail over the link.
Fencing uses the saved settings. By default, it also blocks every consumer,
including your Shadow Link. To exempt the user of the Shadow Link, run
rpk cluster fencing config update before you enable fencing.
Use --wait to wait until the cluster reaches the FENCED state, which means
that every broker enforces fencing.
| This command was introduced in version v26.3.1. |
Examples
This section provides examples of how to use rpk cluster fencing enable.
Enable fencing and wait until every broker enforces it:
rpk cluster fencing enable --wait
Enable fencing only if nobody changed it since revision 4:
rpk cluster fencing enable --expected-revision 4
Enable fencing without confirmation and print the result as JSON:
rpk cluster fencing enable --no-confirm --format json
Flags
| Value | Type | Description |
|---|---|---|
|
int64 |
Fail if fencing is not at this revision, as |
|
string |
Output format ( |
|
bool |
Disable confirmation prompt. |
|
bool |
Wait until the cluster reaches the FENCED state. |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |