public class ClusterTool extends Object
Usage: ClusterTool <cluster-dir> <command> [options]
describe: prints out all descriptors in the mark file.
pid: prints PID of cluster component.
recovery-plan: [service count] prints recovery plan of cluster component.
recording-log: prints recording log of cluster component.
sort-recording-log: reorders entries in the recording log to match the order in memory.
seed-recording-log-from-snapshot: creates a new recording log based on the latest valid snapshot.
errors: prints Aeron and cluster component error logs.
list-members: prints leader memberId, active members and passive members lists.
remove-member: [memberId] requests removal of a member by memberId.
remove-passive: [memberId] requests removal of a passive member by memberId.
backup-query: [delay] get, or set, time of next backup query.
invalidate-latest-snapshot: marks the latest snapshot as a invalid so the previous is loaded.
snapshot: triggers a snapshot on the leader.
standby-snapshot: triggers a snapshot on cluster standby nodes.
suspend: suspends appending to the log.
resume: resumes reading from the log.
shutdown: initiates an orderly stop of the cluster with a snapshot.
abort: stops the cluster without a snapshot.
describe-latest-cm-snapshot: prints the contents of the latest valid consensus module snapshot.
is-leader: returns zero if the cluster node is leader, non-zero if not
| Modifier and Type | Field and Description |
|---|---|
static String |
AERON_CLUSTER_TOOL_DELAY_PROP_NAME
Delay in nanoseconds to be applied to an operation such as when the new cluster backup query will occur.
|
static String |
AERON_CLUSTER_TOOL_REPLAY_CHANNEL
Channel used for archive replays.
|
static String |
AERON_CLUSTER_TOOL_REPLAY_CHANNEL_DEFAULT
Default channel used for archive replays.
|
static String |
AERON_CLUSTER_TOOL_REPLAY_CHANNEL_PROP_NAME
Property name for setting the channel used for archive replays.
|
static int |
AERON_CLUSTER_TOOL_REPLAY_STREAM_ID
Stream id used for archive replays.
|
static int |
AERON_CLUSTER_TOOL_REPLAY_STREAM_ID_DEFAULT
Default stream id used for archive replays.
|
static String |
AERON_CLUSTER_TOOL_REPLAY_STREAM_ID_PROP_NAME
Property name for setting the stream id used for archive replays.
|
static String |
AERON_CLUSTER_TOOL_TIMEOUT_PROP_NAME
Timeout in nanoseconds for the tool to wait while trying to perform an operation.
|
| Constructor and Description |
|---|
ClusterTool() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
abort(File clusterDir,
PrintStream out)
Instruct the cluster to abort.
|
static void |
describe(PrintStream out,
ClusterMarkFile[] serviceMarkFiles)
Print out the descriptors in the
ClusterMarkFiles. |
static void |
describe(PrintStream out,
File clusterDir)
Print out the descriptors in the
ClusterMarkFiles. |
static void |
describeLatestConsensusModuleSnapshot(PrintStream out,
File clusterDir)
Print out a summary of the state captured in the latest consensus module snapshot.
|
static void |
errors(PrintStream out,
File clusterDir)
Print out the errors in the error logs for the cluster components.
|
static boolean |
invalidateLatestSnapshot(PrintStream out,
File clusterDir)
Invalidate the latest snapshot so recovery will use an earlier one or log if no earlier one exists.
|
static int |
isLeader(PrintStream out,
File clusterDir)
Determine if the given node is a leader
|
static boolean |
listMembers(ClusterMembership clusterMembership,
File clusterDir,
long timeoutMs)
List the current members of a cluster.
|
static void |
listMembers(PrintStream out,
File clusterDir)
Print out a list of the current members of the cluster.
|
static void |
main(String[] args)
Main method for launching the process.
|
static boolean |
markFileExists(File clusterDir)
Does a
ClusterMarkFile exist in the cluster directory. |
static void |
nextBackupQuery(PrintStream out,
File clusterDir,
long delayMs)
Set the time of the next backup query for the cluster backup.
|
static long |
nextBackupQueryDeadlineMs(ClusterMarkFile markFile)
Get the deadline time (MS) for the next cluster backup query.
|
static boolean |
nextBackupQueryDeadlineMs(ClusterMarkFile markFile,
long timeMs)
Set the deadline time (MS) for the next cluster backup query.
|
static long |
nextBackupQueryDeadlineMs(File clusterDir)
Get the deadline time (MS) for the next cluster backup query.
|
static boolean |
nextBackupQueryDeadlineMs(File clusterDir,
long timeMs)
Set the deadline time (MS) for the next cluster backup query.
|
static void |
pid(PrintStream out,
File clusterDir)
Print out the PID of the cluster process.
|
static void |
printNextBackupQuery(PrintStream out,
File clusterDir)
Print out the time of the next backup query.
|
static boolean |
queryClusterMembers(ClusterMarkFile markFile,
long timeoutMs,
ClusterMembership clusterMembership)
Query the membership of a cluster.
|
static boolean |
queryClusterMembers(ClusterNodeControlProperties controlProperties,
long timeoutMs,
ClusterMembership clusterMembership)
Query the membership of a cluster.
|
static void |
recordingLog(PrintStream out,
File clusterDir)
Print out the
RecordingLog for the cluster. |
static void |
recoveryPlan(PrintStream out,
File clusterDir,
int serviceCount)
Print out the
RecordingLog.RecoveryPlan for the cluster. |
static boolean |
resume(File clusterDir,
PrintStream out)
Instruct the cluster to resume operation.
|
static void |
seedRecordingLogFromSnapshot(File clusterDir)
Create a new
RecordingLog based on the latest valid snapshot whose term base and log positions are set
to zero. |
static boolean |
shutdown(File clusterDir,
PrintStream out)
Instruct the cluster to shut down.
|
static boolean |
snapshot(File clusterDir,
PrintStream out)
Instruct the cluster to take a snapshot.
|
static boolean |
sortRecordingLog(File clusterDir)
Re-order entries in thee
RecordingLog file on disc if they are not in a proper order. |
static boolean |
suspend(File clusterDir,
PrintStream out)
Instruct the cluster to suspend operation.
|
public static final String AERON_CLUSTER_TOOL_TIMEOUT_PROP_NAME
public static final String AERON_CLUSTER_TOOL_DELAY_PROP_NAME
public static final String AERON_CLUSTER_TOOL_REPLAY_CHANNEL_PROP_NAME
public static final String AERON_CLUSTER_TOOL_REPLAY_CHANNEL_DEFAULT
public static final String AERON_CLUSTER_TOOL_REPLAY_CHANNEL
public static final String AERON_CLUSTER_TOOL_REPLAY_STREAM_ID_PROP_NAME
public static final int AERON_CLUSTER_TOOL_REPLAY_STREAM_ID_DEFAULT
public static final int AERON_CLUSTER_TOOL_REPLAY_STREAM_ID
public static void main(String[] args)
args - passed to the process.public static void describe(PrintStream out, File clusterDir)
ClusterMarkFiles.out - to print the output to.clusterDir - where the cluster is running.public static void pid(PrintStream out, File clusterDir)
out - to print the output to.clusterDir - where the cluster is running.public static void recoveryPlan(PrintStream out, File clusterDir, int serviceCount)
RecordingLog.RecoveryPlan for the cluster.out - to print the output to.clusterDir - where the cluster is running.serviceCount - of services running in the containers.public static void recordingLog(PrintStream out, File clusterDir)
RecordingLog for the cluster.out - to print the output to.clusterDir - where the cluster is running.public static boolean sortRecordingLog(File clusterDir)
RecordingLog file on disc if they are not in a proper order.clusterDir - where the cluster is running.true if file contents was changed or false if it was already in the correct order.public static void seedRecordingLogFromSnapshot(File clusterDir)
RecordingLog based on the latest valid snapshot whose term base and log positions are set
to zero. The original recording log file is backed up as recording.log.bak.clusterDir - where the cluster is running.public static void errors(PrintStream out, File clusterDir)
out - to print the output to.clusterDir - where the cluster is running.public static void listMembers(PrintStream out, File clusterDir)
out - to print the output to.clusterDir - where the cluster is running.public static void printNextBackupQuery(PrintStream out, File clusterDir)
out - to print the output to.clusterDir - where the cluster backup is running.public static void nextBackupQuery(PrintStream out, File clusterDir, long delayMs)
out - to print the output to.clusterDir - where the cluster is running.delayMs - from the current time for the next backup query.public static void describe(PrintStream out, ClusterMarkFile[] serviceMarkFiles)
ClusterMarkFiles.out - to print the output to.serviceMarkFiles - to query.public static int isLeader(PrintStream out, File clusterDir)
out - to print the output to.clusterDir - where the cluster is running.public static boolean markFileExists(File clusterDir)
ClusterMarkFile exist in the cluster directory.clusterDir - to check for if a mark file exists.public static boolean listMembers(ClusterMembership clusterMembership, File clusterDir, long timeoutMs)
clusterMembership - to populate.clusterDir - where the cluster is running.timeoutMs - to wait on the query completing.public static boolean queryClusterMembers(ClusterMarkFile markFile, long timeoutMs, ClusterMembership clusterMembership)
markFile - for the cluster component.timeoutMs - to wait for the query.clusterMembership - to populate.public static boolean queryClusterMembers(ClusterNodeControlProperties controlProperties, long timeoutMs, ClusterMembership clusterMembership)
controlProperties - from a ClusterMarkFile.timeoutMs - to wait for the query.clusterMembership - to populate.public static long nextBackupQueryDeadlineMs(File clusterDir)
clusterDir - where the cluster component is running.Aeron.NULL_VALUE not available.public static long nextBackupQueryDeadlineMs(ClusterMarkFile markFile)
markFile - for the cluster component.Aeron.NULL_VALUE not available.public static boolean nextBackupQueryDeadlineMs(File clusterDir, long timeMs)
clusterDir - where the cluster component is running.timeMs - to set for the next deadline.public static boolean nextBackupQueryDeadlineMs(ClusterMarkFile markFile, long timeMs)
markFile - for the cluster component.timeMs - to set for the next deadline.public static boolean invalidateLatestSnapshot(PrintStream out, File clusterDir)
out - to print the operation result.clusterDir - where the cluster component is running.public static void describeLatestConsensusModuleSnapshot(PrintStream out, File clusterDir)
out - to print the operation result.clusterDir - where the cluster is running.public static boolean snapshot(File clusterDir, PrintStream out)
clusterDir - where the consensus module is running.out - to print the result of the operation.public static boolean suspend(File clusterDir, PrintStream out)
clusterDir - where the consensus module is running.out - to print the result of the operation.public static boolean resume(File clusterDir, PrintStream out)
clusterDir - where the consensus module is running.out - to print the result of the operation.public static boolean shutdown(File clusterDir, PrintStream out)
clusterDir - where the consensus module is running.out - to print the result of the operation.public static boolean abort(File clusterDir, PrintStream out)
clusterDir - where the consensus module is running.out - to print the result of the operation.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.