DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
| Code Block |
|---|
// Optional values
--recovery-duration-ms <integer> A broker is required to respond with log information within this duration for it to be considered as a candidate for election.
Defaults to 30_000 (30 seconds) and represents time in milliseconds.
--recovery-election-attempts <integer> Number of retries of transient failures allowed for leader election requests.
Defaults to 3.
// At least 1 of these is required.
--show-replica-info Print a table showing replica info of targeted partitions. Can be used with any other arguments.
--manual-recovery-output-file <string> File path of a new file which will be created. The generated file will be capable of being an input to kafka-elect-leaders.sh.
It will contain topic-partitions and their designated leaders.
{
"partitions": [
{"topic": "foo", "partition": 1, "designatedLeader": 0},
{"topic": "foobar", "partition": 2, "designatedLeader": 1}
]
}
Mutually exclusive with the --automated-recovery flag.
--automated-recovery Automatically elect leaders with longest apparent logs by attempting designated leader elections.
// One of these two are required.
--path-to-json-file <String> Path to a JSON file containing a list of topic-partitions to attempt unclean recovery elections on.
Mutually exclusive with --all-offline-partitions.
Example:
{
"partitions": [
{
topic: "foo",
partitions: [0, 3, 5]
},
{
topic: "bar",
partitions: [0, 1, 4]
}
]
}
--all-offline-partitions Perform unclean recovery on all detected offline partitions. |
...
kafka-unclean-recovery.sh will attempt a "best-effort" approach and try to complete as many elections as it can within a time limit (or until the operator provides a SIGTERM). It should be expected that not all partitions in the input set will be "recovered" successfully. Possible failure modes are that either ElectLeadersRequest will fail or no successful GetReplicaLogInfoResponse was received in time for a given partition. Since designated leadership elections are idempotent (once a leader is elected, it is not possible to use designated leadership elections again until partition is again offline) operators can confidently run the tool multiple times. A zero exit status will be reported only if all elections for the input set are successful. Any failed elections will be logged to stderr.
There are some caveats to using a command line tool for this system.
...