【问题标题】:cassandra connection error: Unable to connect to any serverscassandra连接错误:无法连接到任何服务器
【发布时间】:2016-03-02 08:19:22
【问题描述】:

cassandra 不适用于我的虚拟机。

cqlsh
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})

当我使用命令时:

cassandra
......
INFO  07:55:31 Enqueuing flush of local: 578 (0%) on-heap, 0 (0%) off-heap
INFO  07:55:31 Writing Memtable-local@2014850649(0.081KiB serialized bytes, 4 ops, 0%/0% of on/off-heap limit)
INFO  07:55:31 Completed flushing /var/lib/cassandra/data/system/local-7ad54392bcdd35a684174e047860b377/tmp-la-305-big-Data.db (0.000KiB) for commitlog position ReplayPosition(segmentId=1448697324414, position=105487)
INFO  07:55:31 Enqueuing flush of local: 51468 (0%) on-heap, 0 (0%) off-heap
INFO  07:55:31 Writing Memtable-local@280469114(8.354KiB serialized bytes, 259 ops, 0%/0% of on/off-heap limit)
INFO  07:55:31 Completed flushing /var/lib/cassandra/data/system/local-7ad54392bcdd35a684174e047860b377/tmp-la-306-big-Data.db (0.000KiB) for commitlog position ReplayPosition(segmentId=1448697324414, position=117466)
INFO  07:55:32 Node localhost/127.0.0.1 state jump to normal
INFO  07:55:32 Compacted (64dd8610-95a5-11e5-af1d-a752adc4283f) 4 sstables to [/var/lib/cassandra/data/system/compaction_history-b4dbb7b4dc493fb5b3bfce6e434832ca/la-91-big,] to level=0.  20,658 bytes to 20,029 (~96% of original) in 2,376ms = 0.008039MB/s.  0 total partitions merged to 225.  Partition merge counts were {1:225, }

那么cqlsh就可以工作了:

cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.2.1 | CQL spec 3.3.0 | Native protocol v4]
Use HELP for help.
cqlsh>

但几分钟后,cqlsh 已关闭:

cqlsh
Connection error: ('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})

任何人都可以帮助我!提前致谢!

【问题讨论】:

  • 服务器上的日志文件可能会告诉您您需要了解的内容。
  • @Raedwald 在日志文件中没有发现错误

标签: database cassandra cql


【解决方案1】:

听起来几分钟后服务器就宕机了。你应该检查日志的原因

【讨论】:

    【解决方案2】:

    我找到了根本原因:内存不够。我创建了 linux 交换,然后一切正常。

    how to add swap on ubuntu

    【讨论】:

    • 您能否列出创建 linux swap 的步骤。我也面临同样的问题
    • 非常感谢@pangpang
    猜你喜欢
    • 2018-10-23
    • 2018-08-10
    • 2017-02-16
    • 2016-01-05
    • 2019-06-28
    • 2020-06-06
    • 2016-05-20
    • 2021-06-09
    • 2019-10-08
    相关资源
    最近更新 更多