如何防止Cassandra 2.0.11在启动时耗尽内存?

如何防止Cassandra 2.0.11在启动时耗尽内存?,cassandra,out-of-memory,Cassandra,Out Of Memory,我正在尝试使用以下配置为测试目的设置单节点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 le

我正在尝试使用以下配置为测试目的设置单节点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
rpc_地址:10.0.2.108
收听地址:10.0.2.108
端点_告密者:SimpleSnitch
种子提供程序:
#被视为联系人的主机地址。
#Cassandra节点使用此主机列表来相互查找和学习
#环的拓扑结构。如果正在运行,则必须更改此选项
#多个节点!
-类名:org.apache.cassandra.locator.SimpleSeedProvider
参数:
#种子实际上是一个以逗号分隔的地址列表。
#例:“,”
-种子: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    
INFO[main]2014-11-09 13:00:10808 tdisruptrserver.java(第209行)将使用org.apache.cassandra.concurrent。JMXEnabledThreadPoolExecutor@173b9122所有选择器线程的[正在运行,池大小=16,活动线程=0,排队任务=0,已完成任务=0]。。错误[main]2014-11-09 13:00:11000启动期间遇到Cassandrademon.java(第513行)异常
java.lang.OutOfMemoryError:java堆空间
位于com.thinkaurelius.thrift.tdisruptrserver$SelectorThread.(tdisruptrserver.java:543)
位于com.thinkaurelius.thrift.tdisruptrserver。(tdisruptrserver.java:228)
位于org.apache.cassandra.thrift.thshadisruptrserver。(thshadisruptrserver.java:51)
位于org.apache.cassandra.thrift.thshadisruptrserver$Factory.buildTServer(thshadisruptrserver.java:105)
位于org.apache.cassandra.thrift.TServerCustomFactory.buildTServer(TServerCustomFactory.java:56)
位于org.apache.cassandra.thrift.ThriftServer$ThriftServerThread.(ThriftServer.java:130)
位于org.apache.cassandra.thrift.ThriftServer.start(ThriftServer.java:56)
位于org.apache.cassandra.service.cassandrademon.start(cassandrademon.java:449)
位于org.apache.cassandra.service.cassandrademon.activate(cassandrademon.java:509)
位于org.apache.cassandra.service.cassandrademon.main(cassandrademon.java:585)
信息[StorageServiceShutdownHook]2014-11-09 13:00:11055 Server.java(第182行)停止侦听CQL客户端
信息[StorageServiceShutdownHook]2014-11-09 13:00:11056 Gossiper.java(第1307行)宣布关闭
信息[StorageServiceShutdownHook]2014-11-09 13:00:13057 MessagingService.java(第701行)正在等待消息服务停止
INFO[ACCEPT-/10.0.2.108]2014-11-09 13:00:13058 MessagingService.java(第941行)MessagingService已终止ACCEPT()线程

机器的总内存为4 GB。

这是由解决的错误。在2.0.11中,可以通过将rpc_max_threads设置设置为默认值Integer.max_value以外的值来修复该问题

HsHA服务器已更改,现在使用rpc_max_threads值为每个选择器线程分配处理程序。因此,当OOM尝试分配Integer.MAX_值处理程序时,OOM