【问题标题】:connection refused while connecting to Cassandra连接到 Cassandra 时连接被拒绝
【发布时间】:2024-01-19 06:58:01
【问题描述】:

我正在尝试运行 cassandra,但每次连接时都会出现相同的错误...我需要在配置文件或属性文件中编辑什么

('无法连接到任何服务器', {'127.0.0.1:9042': error(61, "尝试连接到 [('127.0.0.1', 9042)]。最后一个错误:连接被拒绝")} )

启动cassandra时出错

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000106116a8c, pid=27359, tid=0x0000000000006e03
#
# JRE version: OpenJDK Runtime Environment (8.0_275) (build 1.8.0_275-bre_2020_11_16_16_16-b00)
# Java VM: OpenJDK 64-Bit Server VM (25.275-b00 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0x564a8c]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/sandhyasingh/hs_err_pid27359.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Abort trap: 6

【问题讨论】:

  • 我以前从未见过这样的错误(使用 Cassandra)。是在system.log 中吗?这有点表明您的堆大小太大或太小。
  • 检查 system.log 文件中的日志。

标签: cassandra


【解决方案1】:

这意味着您正在尝试连接到localhost,但是:

  • Cassandra 没有运行,或者
  • 您已将rpc_address 设置为localhost 以外的其他值

运行此命令查看CQL端口9042绑定到哪个IP地址:

$ sudo lsof -nPi -sTCP:LISTEN

您需要连接到服务器正在侦听客户端的 IP。干杯!

【讨论】:

  • yes cassandra is not running error-# # Java Runtime Environment 检测到致命错误:# # SIGSEGV (0xb) at pc=0x0000000106116a8c, pid=27359, tid=0x0000000000006e03 ## JRE version: OpenJDK Runtime Environment (8.0_275) (build 1.8.0_275-bre_2020_11_16_16_16-b00) # Java VM: OpenJDK 64-Bit Server VM (25.275-b00 mixed mode bsd-amd64 compressed oops) # Problematic frame: # V [libjvm. dylib+0x564a8c]
  • 你能帮帮我吗
【解决方案2】:

带着完全不同的应用程序来到这里,但与build 1.8.0_275-bre_2020_11_16_16_16-b00 完全匹配。更改 Java 版本(转到 1.8.0_292)后,“致命错误”消失了。

【讨论】: