无法启动卡桑德拉
Posted
技术标签:
【中文标题】无法启动卡桑德拉【英文标题】:can not start cassandra 【发布时间】:2014-02-20 05:49:39 【问题描述】:我在使用 Cassandra 时遇到问题。当我尝试 cassandra/bin cassandra -f 以下异常时:
INFO 10:50:18,090 reading saved cache /var/lib/cassandra/saved_caches/system-schema_columns-KeyCache-b.db
java.lang.OutOfMemoryError: Requested array size exceeds VM limit
Dumping heap to java_pid7545.hprof ...
Heap dump file created [105901433 bytes in 0.574 secs]
ERROR 10:50:18,668 Exception encountered during startup
java.lang.OutOfMemoryError: Requested array size exceeds VM limit
at org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:394)
at org.apache.cassandra.utils.ByteBufferUtil.readWithLength(ByteBufferUtil.java:355)
at org.apache.cassandra.service.CacheService$KeyCacheSerializer.deserialize(CacheService.java:352)
at org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:119)
at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:267)
at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:411)
at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:383)
at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:314)
at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:268)
at org.apache.cassandra.db.Keyspace.open(Keyspace.java:110)
at org.apache.cassandra.db.Keyspace.open(Keyspace.java:88)
at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:474)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:226)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:442)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:485)
java.lang.OutOfMemoryError: Requested array size exceeds VM limit
at org.apache.cassandra.utils.ByteBufferUtil.read(ByteBufferUtil.java:394)
at org.apache.cassandra.utils.ByteBufferUtil.readWithLength(ByteBufferUtil.java:355)
at org.apache.cassandra.service.CacheService$KeyCacheSerializer.deserialize(CacheService.java:352)
at org.apache.cassandra.cache.AutoSavingCache.loadSaved(AutoSavingCache.java:119)
at org.apache.cassandra.db.ColumnFamilyStore.<init>(ColumnFamilyStore.java:267)
at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:411)
at org.apache.cassandra.db.ColumnFamilyStore.createColumnFamilyStore(ColumnFamilyStore.java:383)
at org.apache.cassandra.db.Keyspace.initCf(Keyspace.java:314)
at org.apache.cassandra.db.Keyspace.<init>(Keyspace.java:268)
at org.apache.cassandra.db.Keyspace.open(Keyspace.java:110)
at org.apache.cassandra.db.Keyspace.open(Keyspace.java:88)
at org.apache.cassandra.db.SystemKeyspace.checkHealth(SystemKeyspace.java:474)
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:226)
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:442)
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:485)
Exception encountered during startup: Requested array size exceeds VM limit
Cassandra 2.0 ubuntu 12.04
感谢您提前帮助解决此问题。
【问题讨论】:
您使用的机器有多少内存,cassandra 是否在虚拟机中运行,您的堆大小/永久大小是多少,此错误是在您第一次启动 cassandra 时产生的,还是出现在 C* 运行了一段时间后你重启了? @LyubenTodorov 我的机器配置是 ram 4GB,ubuntu 12.04,jdk 7,cassandra 2.0,重启 cassandra 时出错 【参考方案1】:您需要减小 cassandra.yaml 中密钥缓存的大小。但要重新开始:
rm -rf /var/lib/cassandra/saved_caches/*
【讨论】:
【参考方案2】:在cassandra环境文件中增加VM内存配置
它存在于 cassandra "conf/cassandra-env.sh" 的 conf 文件夹中
【讨论】:
以上是关于无法启动卡桑德拉的主要内容,如果未能解决你的问题,请参考以下文章