我正在尝试使用以下配置设置一个单节点 cassandra 实例以进行测试:
rpc_address: 10.0.2.108
listen_address: 10.0.2.108
endpoint_snitch: SimpleSnitch
seed_provider:
# Addresses of hosts that are deemed contact points.
# Cassandra nodes use this list of hosts to find each other and learn
# the topology of the ring. You must change this if you are running
# multiple nodes!
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
# seeds is actually a comma-delimited list of addresses.
# Ex: "<ip1>,<ip2>,<ip3>"
- seeds: 10.0.2.108
我已经通过多种方式更改了配置,但我总是收到 OutOfMemoryException:
INFO [main] 2014-11-09 13:00:10,808 TDisruptorServer.java (line 209) Going to use org.apache.cassandra.concurrent.JMXEnabledThreadPoolExecutor@173b9122[Running, pool size = 16, active threads = 0, queued tasks = 0, completed tasks = 0] for all of the Selector threads.. ERROR [main] 2014-11-09 13:00:11,000 CassandraDaemon.java (line 513) Exception encountered during startup
java.lang.OutOfMemoryError: Java heap space
at com.thinkaurelius.thrift.TDisruptorServer$SelectorThread.<init>(TDisruptorServer.java:543)
at com.thinkaurelius.thrift.TDisruptorServer.<init>(TDisruptorServer.java:228)
at org.apache.cassandra.thrift.THsHaDisruptorServer.<init>(THsHaDisruptorServer.java:51)
at org.apache.cassandra.thrift.THsHaDisruptorServer$Factory.buildTServer(THsHaDisruptorServer.java:105)
at org.apache.cassandra.thrift.TServerCustomFactory.buildTServer(TServerCustomFactory.java:56)
at org.apache.cassandra.thrift.ThriftServer$ThriftServerThread.<init>(ThriftServer.java:130)
at org.apache.cassandra.thrift.ThriftServer.start(ThriftServer.java:56)
at org.apache.cassandra.service.CassandraDaemon.start(CassandraDaemon.java:449)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:509)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:585)
INFO [StorageServiceShutdownHook] 2014-11-09 13:00:11,055 Server.java (line 182) Stop listening for CQL clients
INFO [StorageServiceShutdownHook] 2014-11-09 13:00:11,056 Gossiper.java (line 1307) Announcing shutdown
INFO [StorageServiceShutdownHook] 2014-11-09 13:00:13,057 MessagingService.java (line 701) Waiting for messaging service to quiesce
INFO [ACCEPT-/10.0.2.108] 2014-11-09 13:00:13,058 MessagingService.java (line 941) MessagingService has terminated the accept() thread
机器总内存为4 GB。
最佳答案
这是 https://issues.apache.org/jira/browse/CASSANDRA-8116 解决的错误。在 2.0.11 中,可以通过将 rpc_max_threads 设置设置为默认值 Integer.MAX_VALUE 以外的值来修复此问题。
HsHA 服务器已更改,现在使用 rpc_max_threads 值来为每个选择器线程分配处理程序。因此,当它尝试分配 Integer.MAX_VALUE 处理程序时会出现 OOM
关于cassandra - 如何防止 Cassandra 2.0.11 在启动时内存不足?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26828124/