1

I get:

JMX is not enabled to receive remote connections. \
  Please see cassandra-env.sh for more info.

and I am not familiar with cassandra-env.sh

I tried nano /etc/cassandra/cassandra-env.sh in the terminal but from there I'm lost

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Nii Joshua
  • 277
  • 3
  • 7
  • Welcome to Stack Overflow! A friendly reminder that this site is for getting help with coding, algorithm, or programming language problems so I voted to have your post moved to https://dba.stackexchange.com instead. Cheers! – Erick Ramirez Oct 26 '22 at 05:55

2 Answers2

2

By default, JMX is only enabled from local, so you can't log in remotely. To change that you need to modify the cassandra-env.sh:

https://docs.datastax.com/en/archived/ddacsecurity/doc/ddacsecurity/secureJmxAuthentication.html

Where you see:

if [ "$LOCAL_JMX" = "yes" ]; then
  JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.local.port=$JMX_PORT"

You'll need to change to no so that it hits the remote loop. Then you'll need to configure the following params:

-Dcassandra.jmx.remote.port=7199
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Djava.rmi.server.hostname=10.101.35.37

If you want SSL then you'll need to configure that as well. JMX is just java, so it's not specific to Cassandra. The configuration is actually found in java documentation:

Remote JMX connection

stevenlacerda
  • 341
  • 1
  • 4
0

You didn't provide a lot of detail in your post but I'm guessing that you saw the warning in the Cassandra system.log.

During startup, Cassandra performs certain checks to make sure that the node is configured correctly. One of the checks it performs is to verify that the JMX port is configured.

In your case, you didn't configure JMX for remote access so the WARN was logged by the StartupChecks.java class. There is no reason to be alarmed by the message. It is completely fine to not allow remote JMX access, particularly since you are most likely just trying Cassandra out for the first time.

Remote access isn't necessary for Cassandra to function. Unless you plan to run management commands like nodetool remotely, it's perfectly fine to leave it as-is. You will still be able to run admin commands locally on your Mac. Cheers!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
  • Thanks Erick but because JMX is not configured for remote connections , I cannot run cqlsh – Nii Joshua Oct 27 '22 at 06:54
  • cqlsh is not a JMX client. cqlsh is an app client which connects on CQL port `9042` -- completely different from the JMX port `7199`. If you post the details of your issue on https://dba.stackexchange.com/questions/ask?tags=cassandra, I'd be happy to help. Cheers! – Erick Ramirez Oct 27 '22 at 07:06