cassandra connection error: Unable to connect to any servers

cassandra connection error: Unable to connect to any servers

cassandra 不适用于我的 VM。

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")})

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

听起来好像服务器在几分钟后宕机了。您应该检查日志以了解原因

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

how to add swap on ubuntu