Scylla JMX proxy
Go to file
Amnon Heiman 94f144e9b3 StorageService: Get the broadcast address from the API
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>
2016-03-22 09:43:13 +02:00
dist dist/ubuntu: Relax Java dependencies 2016-03-21 14:43:08 +02:00
scripts scylla-jmx: Support local only jmx port by default 2016-03-01 19:52:26 +02:00
src/main/java StorageService: Get the broadcast address from the API 2016-03-22 09:43:13 +02:00
git-archive-all-license.txt dist: make ubuntu package as 'debian non-native package' 2015-11-25 19:43:38 +09:00
LICENSE.AGPL Change license to AGPLv3 2015-09-22 13:33:24 +03:00
NOTICE Add a NOTICE file for the yammer library 2015-06-11 14:32:45 +03:00
pom.xml pom.xml: Add log4j classes 2016-01-25 20:32:46 +02:00
README.md Rename urchin-mbean.jar to scylla-jmx.jar 2015-12-17 09:27:58 +02:00
SCYLLA-VERSION-GEN version: rename development version to 666.development 2016-01-14 14:40:45 +02:00

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)