can';t使用jconsole连接到cassandra

can';t使用jconsole连接到cassandra,cassandra,jmx,jconsole,Cassandra,Jmx,Jconsole,我在远程服务器上安装了一个cassandra。机器有两个IP-内部和外部。在cassandra的jvm选项中,我将java.rmi.server.hostname设置为内部ip。nodetool连接很好。但是,我无法通过外部ip使用jconsole进行连接-它挂起很长时间,然后(在调试模式下)打印一个带有超时的java.net.ConnectException。这不是防火墙问题-服务器上没有防火墙,而且我可以使用telnet连接到外部ip和jmx端口。我还尝试通过ssh隧道连接到内部ip,但结果

我在远程服务器上安装了一个cassandra。机器有两个IP-内部外部。在cassandra的jvm选项中,我将java.rmi.server.hostname设置为内部ip。nodetool连接很好。但是,我无法通过外部ip使用jconsole进行连接-它挂起很长时间,然后(在调试模式下)打印一个带有超时的java.net.ConnectException。这不是防火墙问题-服务器上没有防火墙,而且我可以使用telnet连接到外部ip和jmx端口。我还尝试通过ssh隧道连接到内部ip,但结果仍然是一样的


有人能帮我吗?

conf/cassandra env.sh

JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=public_name"

conf/cassandra env.sh

JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=public_name"

很可能您尚未配置远程JMX

很可能您尚未配置远程JMX

默认情况下,Cassandra只允许从本地主机访问JMX。要启用远程JMX连接,您需要更改
“LOCAL_JMX=yes”到“LOCAL_JMX=no”
此属性来自Cassandra-env.sh文件
(可选)如果要启用身份验证,可以设置与身份验证相关的属性,否则仅对其进行注释


希望这对你有帮助

默认情况下,Cassandra只允许从本地主机访问JMX。要启用远程JMX连接,您需要更改
“LOCAL_JMX=yes”到“LOCAL_JMX=no”
此属性来自Cassandra-env.sh文件
(可选)如果要启用身份验证,可以设置与身份验证相关的属性,否则仅对其进行注释


希望这对你有帮助

关键点是
JVM\u OPTS=“$JVM\u OPTS-Djava.rmi.server.hostname=x.x.x.x”

我在这里粘贴我的完整片段以帮助他人:

LOCAL_JMX=no

# Specifies the default port over which Cassandra will be available for
# JMX connections.
# For security reasons, you should not expose this port to the internet.  Firewall it if needed.
JMX_PORT="7199"

if [ "$LOCAL_JMX" = "yes" ]; then
  JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.local.port=$JMX_PORT"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
else
  JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.remote.port=$JMX_PORT"
  # if ssl is enabled the same port cannot be used for both jmx and rmi so either
  # pick another value for this property or comment out to use a random port (though see CASSANDRA-7087 for origins)
  JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=192.168.42.101"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl=false"

  # turn on JMX authentication. See below for further options
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

  # jmx ssl options
  #JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl=true"
  #JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl.need.client.auth=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>"
  #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>"
fi
LOCAL_JMX=no
#指定Cassandra可用于的默认端口
#JMX连接。
#出于安全原因,您不应将此端口公开给internet。如果需要,可以安装防火墙。
JMX_PORT=“7199”
如果[“$LOCAL_JMX”=“yes”];然后
JVM_OPTS=“$JVM_OPTS-Dcassandra.jmx.local.port=$jmx_port”
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.authenticate=false”
其他的
JVM_OPTS=“$JVM_OPTS-Dcassandra.jmx.remote.port=$jmx_port”
#如果启用了ssl,则同一端口不能同时用于jmx和rmi,因此
#为该属性选择另一个值或注释以使用随机端口(尽管有关起源,请参见CASSANDRA-7087)
JVM_OPTS=“$JVM_OPTS-Djava.rmi.server.hostname=192.168.42.101”
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.rmi.port=$JMX_port”
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote”
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl=false”
#打开JMX身份验证。更多选项见下文
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.authenticate=false”
#jmx ssl选项
#JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl=true”
#JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl.need.client.auth=true”
#JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl.enabled.protocols=”
#JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl.enabled.cipher.suites=”
#JVM_OPTS=“$JVM_OPTS-Djavax.net.ssl.keyStore=/path/to/keyStore”
#JVM_OPTS=“$JVM_OPTS-Djavax.net.ssl.keystrepassword=”
#JVM_OPTS=“$JVM_OPTS-Djavax.net.ssl.trustStore=/path/to/trustStore”
#JVM_OPTS=“$JVM_OPTS-Djavax.net.ssl.trustStorePassword=”
fi

关键点是
JVM\u OPTS=“$JVM\u OPTS-Djava.rmi.server.hostname=x.x.x.x”

我在这里粘贴我的完整片段以帮助他人:

LOCAL_JMX=no

# Specifies the default port over which Cassandra will be available for
# JMX connections.
# For security reasons, you should not expose this port to the internet.  Firewall it if needed.
JMX_PORT="7199"

if [ "$LOCAL_JMX" = "yes" ]; then
  JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.local.port=$JMX_PORT"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
else
  JVM_OPTS="$JVM_OPTS -Dcassandra.jmx.remote.port=$JMX_PORT"
  # if ssl is enabled the same port cannot be used for both jmx and rmi so either
  # pick another value for this property or comment out to use a random port (though see CASSANDRA-7087 for origins)
  JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=192.168.42.101"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote"
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl=false"

  # turn on JMX authentication. See below for further options
  JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

  # jmx ssl options
  #JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl=true"
  #JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.ssl.need.client.auth=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>"
  #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>"
fi
LOCAL_JMX=no
#指定Cassandra可用于的默认端口
#JMX连接。
#出于安全原因,您不应将此端口公开给internet。如果需要,可以安装防火墙。
JMX_PORT=“7199”
如果[“$LOCAL_JMX”=“yes”];然后
JVM_OPTS=“$JVM_OPTS-Dcassandra.jmx.local.port=$jmx_port”
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.authenticate=false”
其他的
JVM_OPTS=“$JVM_OPTS-Dcassandra.jmx.remote.port=$jmx_port”
#如果启用了ssl,则同一端口不能同时用于jmx和rmi,因此
#为该属性选择另一个值或注释以使用随机端口(尽管有关起源,请参见CASSANDRA-7087)
JVM_OPTS=“$JVM_OPTS-Djava.rmi.server.hostname=192.168.42.101”
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.rmi.port=$JMX_port”
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote”
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl=false”
#打开JMX身份验证。更多选项见下文
JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.authenticate=false”
#jmx ssl选项
#JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl=true”
#JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl.need.client.auth=true”
#JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl.enabled.protocols=”
#JVM_OPTS=“$JVM_OPTS-Dcom.sun.management.jmxremote.ssl.enabled.cipher.suites=”
#JVM_OPTS=“$JVM_OPTS-Djavax.net.ssl.keyStore=/path/to/keyStore”
#JVM_OPTS=“$JVM_OPTS-Djavax.net.ssl.keystrepassword=”
#JVM_OPTS=“$JVM_OPTS-Djavax.net.ssl.trustStore=/path/to/trustStore”
#JVM_OPTS=“$JVM_OPTS-Djavax.net.ssl.trustStorePassword=”
fi

谢谢,这是真正丢失的一个。谢谢,这是真正丢失的一个。