Merge branch 'cassandra-2.2' into trunk

This commit is contained in:
Jason Brown 2015-06-25 10:45:43 -07:00
commit e7852a3e56
4 changed files with 38 additions and 0 deletions

View File

@ -12,6 +12,7 @@
2.2
* Allow JMX over SSL directly from nodetool (CASSANDRA-9090)
* Update cqlsh for UDFs (CASSANDRA-7556)
* Change Windows kernel default timer resolution (CASSANDRA-9634)
* Deprected sstable2json and json2sstable (CASSANDRA-9618)
@ -28,6 +29,7 @@
* Add logback metrics (CASSANDRA-9378)
* Update and refactor ant test/test-compression to run the tests in parallel (CASSANDRA-9583)
Merged from 2.1:
* Fix incorrect result for IN queries where column not found (CASSANDRA-9540)
* ColumnFamilyStore.selectAndReference may block during compaction (CASSANDRA-9637)
* Fix bug in cardinality check when compacting (CASSANDRA-9580)

View File

@ -56,6 +56,8 @@ fi
# JMX Port passed via cmd line args (-p 9999 / --port 9999 / --port=9999)
# should override the value from cassandra-env.sh
ARGS=""
JVM_ARGS=""
SSL_FILE=$HOME/.cassandra/nodetool-ssl.properties
while true
do
if [ ! $1 ]; then break; fi
@ -71,6 +73,16 @@ do
JMX_PORT=$2
shift
;;
--ssl)
if [ -f $SSL_FILE ]
then
SSL_ARGS=$(cat $SSL_FILE | tr '\n' ' ')
fi
JVM_ARGS="$JVM_ARGS -Dssl.enable=true $SSL_ARGS"
;;
-D*)
JVM_ARGS="$JVM_ARGS $1"
;;
*)
ARGS="$ARGS $1"
;;
@ -91,6 +103,7 @@ esac
-Dcassandra.storagedir="$cassandra_storagedir" \
-Dlogback.configurationFile=logback-tools.xml \
-Dstorage-config="$CASSANDRA_CONF" \
$JVM_ARGS \
org.apache.cassandra.tools.NodeTool -p $JMX_PORT $ARGS
# vi:ai sw=4 ts=4 tw=0 et

View File

@ -289,6 +289,14 @@ else
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl=false"
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=true"
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.password.file=/etc/cassandra/jmxremote.password"
# JVM_OPTS="$JVM_OPTS -Djavax.net.ssl.keyStore=/path/to/keystore"
# JVM_OPTS="$JVM_OPTS -Djavax.net.ssl.keyStorePassword=<keystore-password>"
# JVM_OPTS="$JVM_OPTS -Djavax.net.ssl.trustStore=/path/to/truststore"
# JVM_OPTS="$JVM_OPTS -Djavax.net.ssl.trustStorePassword=<truststore-password>"
# JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl.need.client.auth=true"
# JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.registry.ssl=true"
# JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl.enabled.protocols=<enabled-protocols>"
# JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl.enabled.cipher.suites=<enabled-cipher-suites>"
fi
# To use mx4j, an HTML interface for JMX, add mx4j-tools.jar to the lib/

View File

@ -25,6 +25,9 @@ import java.lang.management.MemoryUsage;
import java.lang.management.RuntimeMXBean;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMISocketFactory;
import java.text.SimpleDateFormat;
import java.util.AbstractMap;
import java.util.ArrayList;
import java.util.Collections;
@ -49,6 +52,7 @@ import javax.management.openmbean.TabularData;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import javax.rmi.ssl.SslRMIClientSocketFactory;
import org.apache.cassandra.concurrent.Stage;
import org.apache.cassandra.db.BatchlogManager;
@ -176,6 +180,9 @@ public class NodeProbe implements AutoCloseable
String[] creds = { username, password };
env.put(JMXConnector.CREDENTIALS, creds);
}
env.put("com.sun.jndi.rmi.factory.socket", getRMIClientSocketFactory());
jmxc = JMXConnectorFactory.connect(jmxUrl, env);
mbeanServerConn = jmxc.getMBeanServerConnection();
@ -216,6 +223,14 @@ public class NodeProbe implements AutoCloseable
mbeanServerConn, ManagementFactory.RUNTIME_MXBEAN_NAME, RuntimeMXBean.class);
}
private RMIClientSocketFactory getRMIClientSocketFactory() throws IOException
{
if (Boolean.parseBoolean(System.getProperty("ssl.enable")))
return new SslRMIClientSocketFactory();
else
return RMISocketFactory.getDefaultSocketFactory();
}
public void close() throws IOException
{
jmxc.close();