gpt4 book ai didi

cassandra - 无法在 Mac 上启动 Cassandra DSC - 启动本地 jmx 服务器时出错

转载 作者:行者123 更新时间:2023-12-04 17:33:38 27 4
gpt4 key购买 nike

我正在尝试在我的 Mac OSX 10.10 上运行 Cassandra。我已经安装了 dsc-cassandra-2.1.9。
一些 cassandra.yaml 设置是:
监听地址:127.0.0.1
rpc_address: 127.0.0.1
rpc_port: 9160

但是,当我启动 cassandra 时,它失败了:

$ ./bin/cassandra 
...

WARN [main] 2015-10-08 23:01:43,226 CLibrary.java:70 - JNA link failure, one or more native method will be unavailable.
WARN [main] 2015-10-08 23:01:43,227 CassandraDaemon.java:81 - JMX is not enabled to receive remote connections. Please see cassandra-env.sh for more info.
ERROR [main] 2015-10-08 23:02:58,707 CassandraDaemon.java:116 - Error starting local jmx server:
java.io.IOException: Cannot bind to URL [rmi://localhost:7199/jmxrmi]: javax.naming.ServiceUnavailableException [Root exception is java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Operation timed out]
at javax.management.remote.rmi.RMIConnectorServer.newIOException(RMIConnectorServer.java:826) ~[na:1.7.0_51]
at javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:431) ~[na:1.7.0_51]
at org.apache.cassandra.service.CassandraDaemon.maybeInitJmx(CassandraDaemon.java:112) [apache-cassandra-2.1.9.jar:2.1.9]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:216) [apache-cassandra-2.1.9.jar:2.1.9]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:537) [apache-cassandra-2.1.9.jar:2.1.9]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:626) [apache-cassandra-2.1.9.jar:2.1.9]
Caused by: javax.naming.ServiceUnavailableException: null

有人可以帮忙解决这个问题吗?

更新上述问题-

按照下面的答案中的建议设置 JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=127.0.0.1"后,cassandra 似乎正在运行,但是 nodetool 似乎没有报告正确的状态:
$ ps -ef|grep cass
0 49292 1 0 8:53PM ttys001 0:13.04 /usr/bin/java -ea -javaagent:./bin/../lib/jamm-0.3.0.jar -XX:+CMSClassUnloadingEnabled -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms4096M -Xmx4096M -Xmn800M -XX:+HeapDumpOnOutOfMemoryError -Xss256k -XX:StringTableSize=1000003 -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1 -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+UseTLAB -XX:CompileCommandFile=./bin/../conf/hotspot_compiler -XX:CMSWaitDuration=10000 -XX:+UseCondCardMark -Djava.net.preferIPv4Stack=true -Djava.rmi.server.hostname=127.0.0.1 -Dcassandra.jmx.local.port=7199 -XX:+DisableExplicitGC -Dlogback.configurationFile=logback.xml -Dcassandra.logdir=./bin/../logs -Dcassandra.storagedir=./bin/../data -cp ./bin/../conf:./bin/../build/classes/main:./bin/../build/classes/thrift:./bin/../lib/ST4-4.0.8.jar:./bin/../lib/airline-0.6.jar:./bin/../lib/antlr-runtime-3.5.2.jar:./bin/../lib/apache-cassandra-2.1.9.jar:./bin/../lib/apache-cassandra-clientutil-2.1.9.jar:./bin/../lib/apache-cassandra-thrift-2.1.9.jar:./bin/../lib/commons-cli-1.1.jar:./bin/../lib/commons-codec-1.2.jar:./bin/../lib/commons-lang3-3.1.jar:./bin/../lib/commons-math3-3.2.jar:./bin/../lib/compress-lzf-0.8.4.jar:./bin/../lib/concurrentlinkedhashmap-lru-1.4.jar:./bin/../lib/disruptor-3.0.1.jar:./bin/../lib/guava-16.0.jar:./bin/../lib/high-scale-lib-1.0.6.jar:./bin/../lib/jackson-core-asl-1.9.2.jar:./bin/../lib/jackson-mapper-asl-1.9.2.jar:./bin/../lib/jamm-0.3.0.jar:./bin/../lib/javax.inject.jar:./bin/../lib/jbcrypt-0.3m.jar:./bin/../lib/jline-1.0.jar:./bin/../lib/jna-4.0.0.jar:./bin/../lib/json-simple-1.1.jar:./bin/../lib/libthrift-0.9.2.jar:./bin/../lib/logback-classic-1.1.2.jar:./bin/../lib/logback-core-1.1.2.jar:./bin/../lib/lz4-1.2.0.jar:./bin/../lib/metrics-core-2.2.0.jar:./bin/../lib/netty-all-4.0.23.Final.jar:./bin/../lib/reporter-config-2.1.0.jar:./bin/../lib/slf4j-api-1.7.2.jar:./bin/../lib/snakeyaml-1.11.jar:./bin/../lib/snappy-java-1.0.5.2.jar:./bin/../lib/stream-2.5.2.jar:./bin/../lib/super-csv-2.1.0.jar:./bin/../lib/thrift-server-0.3.7.jar org.apache.cassandra.service.CassandraDaemon

$ ./bin/nodetool status
objc[52026]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/bin/java and /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
nodetool: Failed to connect to '127.0.0.1:7199' - NameNotFoundException: 'jmxrmi'.

而 cqlsh 似乎正在工作:
$ ./bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.1.9 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh>

最佳答案

面临同样的错误,下面是解决方案。

停止 Cassandra
ps -ef | grep cassandra | grep -v grep | awk '{print $2}' | xargs kill -9

在 cassandra-env.sh 中修改以下内容:-

  • 取消注释 JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname="并更改为
    JVM_OPTS="$JVM_OPTS -Djava.rmi.server.hostname=127.0.0.1"
  • 将 LOCAL_JMX=yes 更改为 LOCAL_JMX=no
  • 将真更改为假
    JVM_OPTS="$JVM_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

  • 如果您仍然看到任何问题,请检查 JMX_PORT="XXX"指定的端口是否被占用。或者,您只需将其更改为 JMX_PORT="9909"并重新启动 cassandra。

    关于cassandra - 无法在 Mac 上启动 Cassandra DSC - 启动本地 jmx 服务器时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33031214/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com