Configure the DataStax Agent JVM
The DataStax Agent JVM is designed to have a minimal footprint on nodes and require no extra configuration for most environments.
DataStax Agent shell script
If you need to modify the DataStax Agent JVM properties, edit the datastax-agent-env.sh script.
The default location of this script depends on the type of installation:
-
Package installations:
/etc/datastax-agent/datastax-agent-env.sh -
Tarball installations:
INSTALL_DIRECTORY/agent/conf/datastax-agent-env.sh
Configure heap for the agent JVM
For most environments, the DataStax Agent requires 1GB of heap.
If an agent is experiencing OutOfMemory issues, try changing the -Xmx property in datastax-agent-env.sh to 2048M (2 GB):
JVM_OPTS="$JVM_OPTS -Xmx2048M"
If memory issues persist, contact IBM Support to determine whether your environment requires more heap or if there is a problem with the agent.
Configure the /tmp directory for the agent
Many enterprise security policies require mounting /tmp directories with the no execution (noexec) flag.
However, OpsCenter runs the JVM using Jython, which requires access to the temporary directory where it can copy executable files.
The JDK requires an executable directory to start, and it is mapped to /tmp by default.
If the /tmp directory has the noexec flag set, then the agent cannot start.
If you cannot disable the noexec flag on the /tmp directory, you must remap the default temporary directory to an executable directory, and then change the directory permissions to allow full access for the user that runs the agent process:
-
Find or create a directory that will become the new temporary directory.
-
Modify the directory permissions to grant full access to the user that runs the agent process.
When installed automatically, the DataStax Agent runs as the same user as the DSE process. If you manually installed the agent, see Set permissions to run the DataStax Agent as the DSE user.
For example:
mkdir -p /path/to/tmp/dir chmod 700 /path/to/tmp/dir -
On the node where the agent is installed, edit the
datastax-agent-env.shfile. -
Set the
-Djava.io.tmpdirproperty to the path for the new/tmpdirectory:JVM_OPTS="$JVM_OPTS -Xmx512M -Djava.io.tmpdir=/path/to/tmp/dir"The
-Xmxproperty sets the heap size. -
Save the file.
-
Repeat for all other agents in the cluster that require a non-default temporary directory.
Encrypt JMX communication between the agent and DSE
When you enable encryption for JMX communications between the DataStax Agent and DataStax Enterprise (DSE), the agent uses an SSL-aware socket factory when connecting to DSE. This doesn’t enable encryption for DSE itself.
On a DSE node, by default, JMX remote connections are disabled, and JMX security authentication is disabled for local and remote connections. This is controlled by the following option:
JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
-
Before you configure JMX authentication for DSE, you must enable DSE Unified authentication.
-
Complete all steps to set up SSL certificates.
-
Stop DSE on every node in the cluster.
-
Stop the DataStax Agent on each node where it is running.
-
Edit the JVM options file for your DSE version:
-
DSE 6.9:
jvm-server.optionsorjvm11-server.options -
DSE 6.8:
jvm-server.options,jvm8-server.options, orjvm11-server.options -
DSE 5.1:
jvm.options -
Earlier versions:
cassandra-env.sh
The default location of the
jvm*-server.optionsfiles depends on your installation type:-
Package installations of DSE:
/etc/dse/cassandra/jvmRELEASE_NUMBER-server.options -
Tarball installations of DSE:
INSTALL_DIRECTORY/resources/cassandra/conf/jvmRELEASE_NUMBER-server.options
-
-
In the JVM options file, add an SSL settings section with the following options:
# SSL settings -Dcom.sun.management.jmxremote.ssl=true -Dcom.sun.management.jmxremote.ssl.need.client.auth=true -Djavax.net.ssl.keyStore=/path_to_keyStore/keyStore_name.jks -Djavax.net.ssl.keyStorePassword=keyStore_password -Djavax.net.ssl.trustStore=/path_to_trustStore/trustStore_name.jks -Djavax.net.ssl.trustStorePassword=trustStore_password-
com.sun.management.jmxremote.ssl: Set totrueto enable SSL for JMX connections between DSE and the agent. If enabled,com.sun.management.jmxremote.ssl.need.client.authmust also be set totrueto enable full security. -
com.sun.management.jmxremote.ssl.need.client.auth: Set totrueto enable two-way certificate authentication. -
keyStore_name: Name of the SSL keystore. -
keyStore_password: Password for the keystore indicated byjavax.net.ssl.keyStore. -
trustStore_name: Name of the SSL truststore. -
trustStore_password: Password for the truststore indicated byjavax.net.ssl.trustStore.
-
-
Start DSE on each node in the cluster:
sudo service dse startWait for the nodes to fully start up (
UNstatus) before continuing. -
On the node where the agent is installed, edit the
datastax-agent-env.shfile. -
Configure the JVM options to use SSL encryption for agent-to-DSE communication:
JVM_OPTS="$JVM_OPTS -Xmx1024M" JVM_OPTS="$JVM_OPTS -Djavax.net.ssl.keyStore=/path_to_trustStore/trustStore_name.jks" JVM_OPTS="$JVM_OPTS -Djavax.net.ssl.keyStorePassword=trustStore_password" JVM_OPTS="$JVM_OPTS -Djavax.net.ssl.trustStore=/path_to_keyStore/keyStore_name.jks" JVM_OPTS="$JVM_OPTS -Djavax.net.ssl.trustStorePassword=keyStore_password" JVM_OPTS="$JVM_OPTS -Ddatastax.agent.jmx.usessl=true"-
datastax.agent.jmx.usessl: Add this setting and set totrueto enable SSL encryption for the agent. -
keyStoreandtrustStoreoptions: The keystore for DSE is the truststore for the agent (and vice versa), as shown in the preceding example. ThekeyStorevariable points to the trustStore, and thekeyStorePasswordvariable uses the trustStore password. The opposite is true for thetrustStorevariable.
-
-
Restart the DataStax Agent to apply the changes.
-
Repeat for all other agents in the cluster that require SSL encryption.
-
After restarting all agents and nodes, check agent and node statuses in OpsCenter to verify that all agents are running and that all nodes are available.