Scylla JMX proxy
649922fed8
The API returns errors with an HTTP code 400, 404 or 500 depending on the cause with a json object that contains the failure reason. The error message should be populate to the JMX calling client, translated to the appropriate exception. This patch adds the ability to detect API failure and throw a runtime exception with the returned message. It is up to the calling method what to do with the exception, if it would do nothing, the calling client would get a RuntimeException, depends on origin MBean definition, the caller can catch the exception and throw a specific kind. Note that any exception that is thrown must be known to the JMX client or it will not be able to process it. As a first step, this patch replaces the jersey client to the newer version under glassfish, which has an easy way of getting a Reply object, and check its status before returning the results. The only difference in the method that uses the APIClient is the use of MultivaluedHashMap. The following MBean implementation where changed ColumnFamily CompactionManager Gossiper EndpointSnitchInfo CacheService StorageProxy StorageService Signed-off-by: Amnon Heiman <amnon@scylladb.com> |
||
---|---|---|
debian | ||
dist | ||
scripts | ||
src/main/java | ||
LICENSE.AGPL | ||
NOTICE | ||
pom.xml | ||
README.md | ||
SCYLLA-VERSION-GEN |
Urchin JMX Interface
This is the JMX interface for urchin.
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/urchin-mbean-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)