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.

Usage

rpk cluster fencing enable [flags]

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

--expected-revision

int64

Fail if fencing is not at this revision, as rpk cluster fencing status reports it.

--format

string

Output format (json,yaml,text,wide,help). Default: text.

--no-confirm

bool

Disable confirmation prompt.

-w, --wait

bool

Wait until the cluster reaches the FENCED state.

Global flags

Value Type Description

--config

string

Redpanda or rpk config file; default search paths are ~/.config/rpk/rpk.yaml, $PWD/redpanda.yaml, and /etc/redpanda/redpanda.yaml.

-X, --config-opt

stringArray

Override rpk configuration settings; -X help for detail or -X list for terser detail.

--ignore-profile

bool

Ignore rpk.yaml and redpanda.yaml; use default settings.

--profile

string

rpk profile to use.

-v, --verbose

bool

Enable verbose logging.