nodetool sjk
Runs Swiss Java Knife (SJK) commands to execute, troubleshoot, and monitor the database using MBeans.
Synopsis
nodetool sjk options command command_options
Syntax conventions
| Syntax conventions | Description |
|---|---|
UPPERCASE |
Literal keyword. |
Lowercase |
Not literal. |
|
Variable value. Replace with a valid option or user-defined value. |
|
Optional.
Square brackets ( |
|
Group.
Parentheses ( |
|
Or.
A vertical bar ( |
|
Repeatable.
An ellipsis ( |
|
Single quotation ( |
|
Map collection.
Braces ( |
|
Set, list, map, or tuple.
Angle brackets ( |
|
End CQL statement.
A semicolon ( |
|
Separate the command line options from the command arguments with two hyphens ( |
|
Search CQL only: Single quotation marks ( |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrconfig files. |
Connection options
How to connect and authenticate for all nodetool commands.
| Short | Long | Description |
|---|---|---|
|
|
Hostname or IP address. |
|
|
Port number. |
|
|
Password file path. |
|
|
Password. |
|
|
Remote JMX agent username. |
|
Separates an option from an argument that could be mistaken for an option. |
|
Options
General Swiss Java Knife options.
--commands-
Displays a list of all SJK commands.
--help-
Displays command specific help, for example
nodetool sjk ttop --help. -X,--verbose-
Displays detailed diagnostics.
Commands
DataStax Enterprise (DSE) supports running SJK commands from nodetool.
mxdump-
Prints serialized MBeans to JSON format.
|
The |
To avoid errors if a non-serializable type (such as an mx4j MBean) is returned, run the nodetool sjk mxdump command with the -q (query) switch:
nodetool sjk mxdump -q
-q,--query-
Output selected MBeans by specifying the
ObjectName; match patterns using the asterisk (*) and question mark (?) wildcard characters.For example, to get all values for Garbage Collector:
nodetool sjk mxdump -q java.lang:type=GarbageCollector,name=* gc-
Print GC (garbage collection) log messages for remote process.
To print the GC log messages:
nodetool sjk gcNo options for GC.
hh-
Heap histogram (hh) prints the class histogram, similar to
jmap -histo. When no options are specified, prints complete histogram for all objects.
|
For package installations, run |
For example, to print a histogram for young with a sample duration of 10000 milliseconds on a system with DataStax Enterprise package installation:
sudo -u cassandra nodetool sjk hh --young --sample-depth 10000ms -n 10
-d,--sample-depth-
Specify an integer and unit to set the sample duration for
--dead-youngor--young; default:10000ms. To set the unit, use the following notation:-
ms(milliseconds) -
s(seconds) -
m(minutes) -
h(hours) -
d(days)
-
--dead-
Prints histogram of dead objects.
--dead-young-
Prints histogram for sample of dead young objects. Use with
-dto set the duration. --live-
Prints histogram of live objects.
-n,--top-number-
Limits the number of buckets for N top buckets; default: 2147483647.
--young-
Prints histrogram for a sample of the new objects. Use with
-dto set the duration. mx-
Provides query and execution for Mbeans from the
nodetoolinterface. -all,--allMatched-
Process all matched MBeans.
-a,--arguments-
Arguments for MBean operation invocation.
-f,--field,--attribute-
MBean attribute
-b,--bean-
Mbean name.
-mc,--call-
Invokes MBean method. Default false.
-mg,--get-
Retrieves value of MBean attribute. Default false.
-mi,--info-
Display metadata for MBean. Default false.
--max-col-width-
Table column width threshold for formatting tabular data. Default 40.
-op,--operation-
MBean operation name to be called.
--quiet-
Avoid non-essential output; default: false.
-ms,--set-
Sets value for MBean attribute; default: false.
-v,--value-
Value to set for MBean attribute.
jps-
Enhanced version of
jpstool from the Java Development Kit (JDK) that lists the instrumented HotSpot Java Virtual Machines (JVMs) on the target system. -fd, --filter-description-
Use a wildcard expression to match the process description.
-fp,--filter-property-
Use a wildcard expressions to match JVM system properties.
- -pd, --process-details
-
Prints custom information related to a process; set to
PID,MAIN,FDQN_MAIN,ARGS,Dsys-prop, orDsys-prop. Xjvm-flag-
Prints custom information related to the specified JVM flag.
stcap-
Stack Capture dumps stack traces to file for further processing.
-e,--empty-
Set to true to retain threads without stack trace in dump (ignored by default); default: false.
-f,--filter-
Filters threads by name using Java RegEx syntax; default: .*
The default value, period (.) followed by asterisk (*), allows any number of any characters, including nulls.
-l,--limit-
Target number of traces to collect, once reached command terminates where 0 is unlimited; default: 0.
-m,--match-frame-
Set to filtering string and only traces containing are included in the dump.
-o,--output-
Write the thread dump to the specified a file name.
-r,--rotate-
When specified output file would be rotated every
Ntraces. Specify 0 for no rotation; default: 0. -i,--sampler-interval-
Interval between polling MBeans; default: 0.
-t,--timeout-
Time until command terminate even without enough traces collected; default: 30000.
stcpy-
Stack Copy utility copies and filters dumps.
-e,--empty-
Set to true to retain threads without stack trace in dump (ignored by default); default: false.
-i,--input-
Input files.
--mask-
One or more masking rules, for example
com.mycompany:com.somecompany.Default: null.
-m,--match-frame-
Frame filter, only traces containing the string are included in dump.
-o,--output-
Set to filename. Writes thread dump to the specified file.
-ss,--subsample-
If below 1.0 some frames are randomly thrown away. For example, 0.1 retains only every 10th frame; default: 1.0.
-tf,--thread-filter-
Filter threads by name using Java RegEx syntax; default: .*
ssa-
Stack Sample Analyzer for stack trace dumps.
--categorize-
Prints summary for provided categorization; no summary printed by default.
-cf,--categorizer-file-
Path to file with stack trace categorization definition.
-co,--csv-output-
Output data in CSV format; default: false.
-f,--file-
Path to stack dump file.
--flame-
Exports flame graph to SVG format; default: not included.
--histo-
Prints frame histogram; default: not included.
-nc,--named-class-
Defines name stack trace. Use with other options.
classes-
Use name=filter expression notation; default: no expression.
--print-
Print traces from file; default: not included.
-rc,--rainbow-
List of filters for rainbow coloring.
--ssa-help-
Provides additional information about SSan options; default: not shown.
-si,--summary-info-
Lists summaries.
--thread-info-
Prints per thread information summary; default: false.
-tn,--thread-name-
Filters thread name using Java RegEx syntax.
-tr,--time-range-
Filters time range.
-tz,--time-zone-
Time zone used for timestamps; default: UTC. Use
--ssa-helpfor timezone notation. --title-
Inserts a flame graph title; default: Flame Graph.
-tf,--trace-filter-
Applies filter to traces before processing. Use
--ssa-helpfor more details about filter notation. -tt,--trace-trim-
Positional filter trim frames to process. Use
--ssa-helpfor more details about trace filters. --width-
Flame graph width in pixels; default: 1200.
ttop-
Displays top threads from JVM process.
-f,--filter-
Wildcard expression to filter threads by name.
-o,--order-
Sort order. Value tags:
CPU,USER,SYS,ALLOC,NAME; default:CPU. -ri,--report-interval-
Interval between CPU usage reports in milliseconds; default: 10000ms.
-si,--sampler-interval-
Interval between polling MBeans; default: 500.
-n,--top-number-
Number of threads to show; default: 20.
Examples
Get status for the EndpointStateTracker MBean
nodetool sjk mx -b com.datastax.bdp:type=core,name=EndpointStateTracker -f Blacklisted --get
Set status to true for the EndpointStateTracker MBean
nodetool sjk mx -b com.datastax.bdp:type=core,name=EndpointStateTracker -f Blacklisted --set -v true
Get status of node1
nodetool sjk mx -b com.datastax.bdp:type=core,name=EndpointStateTracker -mc -op getBlacklistedStatus -a node1