Scylla JMX proxy
94f144e9b3
When getting the tokens of the current node, we use the get_token api call with the local broadcast address. The current implementation that tries to figure it out from the configuration is prone to error. Currently in a configuration where the broadcast address is set to the local API and the listening API is set to 127.0.0.1 we get a call to nodetool info will return an exception: ID : 54185d5d-6f62-4884-814c-5d17c2776de9 Gossip active : true Thrift active : true Native Transport active: true Load : 178.09 KB Generation No : 1458349593 Uptime (seconds) : 11 Heap Memory (MB) : 47.23 / 247.50 Off Heap Memory (MB) : 2.75 error: Index: 0, Size: 0 -- StackTrace -- java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.rangeCheck(ArrayList.java:653) at java.util.ArrayList.get(ArrayList.java:429) at org.apache.cassandra.tools.NodeProbe.getEndpoint(NodeProbe.java:812) at org.apache.cassandra.tools.NodeProbe.getDataCenter(NodeProbe.java:830) at org.apache.cassandra.tools.NodeTool$Info.execute(NodeTool.java:425) at org.apache.cassandra.tools.NodeTool$NodeToolCmd.run(NodeTool.java:288) at org.apache.cassandra.tools.NodeTool.main(NodeTool.java:202) Becasue getTokens will return an empty list. This patch changed how broadcast address is deduct. It Adds a reverse mapping from hostid to ip address and use it with the get local id to find the ip address in use. This implementation would probably be replaced by a single API call in the future. After the change a call to nodetool info works. Fixes scylladb/scylla#1027 Signed-off-by: Amnon Heiman <amnon@scylladb.com> Message-Id: <1458405434-8491-3-git-send-email-amnon@scylladb.com> |
||
---|---|---|
dist | ||
scripts | ||
src/main/java | ||
git-archive-all-license.txt | ||
LICENSE.AGPL | ||
NOTICE | ||
pom.xml | ||
README.md | ||
SCYLLA-VERSION-GEN |
Urchin JMX Interface
This is the JMX interface for Scylla
Compile
To compile do:
mvn install
Run
The maven will create an uber-jar with all dependency under the target directory. You should run it with the remote jmx enable so the nodetool will be able to connect to it.
java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=7199 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -jar target/scylla-jmx-1.0.jar
Setting IP and Port
By default the the JMX would connect to a node on the localhost on port 10000.
The jmx API uses the system properties to set the IP address and Port. To change the ip address use the apiaddress property (e.g. -Dapiaddress=1.1.1.1) To change the port use the apiport (e.g. -Dapiport=10001)