带有AssertionError,IOException(断开的管道)和OutOfMemoryError(堆)的Cassandra节点

时间:2016-01-30 14:11:20

标签: java cassandra cassandra-2.0 cql cqlsh

我们正在使用带有两个数据中心的六个节点的Cassandra 2.0.3(每个节点有3个节点)。我们的一个节点经常出现以下连续错误。

  • java.lang.AssertionError
  • java.io.IOException:Broken pipe
  • java.lang.OutOfMemoryError:Java堆空间

    ERROR [Native-Transport-Requests:4836102] 2016-01-26 18:50:41,905 ErrorMessage.java (line 222) Unexpected exception during request
    java.lang.AssertionError: /172.31.x.x
            at org.apache.cassandra.service.StorageProxy.submitHint(StorageProxy.java:919)
            at org.apache.cassandra.service.StorageProxy.mutate(StorageProxy.java:534)
            at org.apache.cassandra.service.StorageProxy.mutateWithTriggers(StorageProxy.java:578)
            at org.apache.cassandra.cql3.statements.BatchStatement.execute(BatchStatement.java:171)
            at org.apache.cassandra.cql3.statements.BatchStatement.execute(BatchStatement.java:156)
            at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:188)
            at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:222)
            at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:119)
            at org.apache.cassandra.transport.Message$Dispatcher.messageReceived(Message.java:304)
            at org.jboss.netty.handler.execution.ChannelUpstreamEventRunnable.doRun(ChannelUpstreamEventRunnable.java:43)
            at org.jboss.netty.handler.execution.ChannelEventRunnable.run(ChannelEventRunnable.java:67)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            at java.lang.Thread.run(Thread.java:744)
     WARN [GossipTasks:1] 2016-01-26 18:50:46,742 Gossiper.java (line 612) Gossip stage has 35 pending tasks; skipping status check (no nodes will be marked down)
     INFO [ScheduledTasks:1] 2016-01-26 18:50:41,905 StatusLogger.java (line 70) ReadStage                        32       163       32554805         0                 0
    ERROR [Native-Transport-Requests:4836140] 2016-01-26 18:52:19,743 ErrorMessage.java (line 222) Unexpected exception during request
    java.io.IOException: Broken pipe
            at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
            at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
            at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
            at sun.nio.ch.IOUtil.write(IOUtil.java:51)
            at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
            at org.jboss.netty.channel.socket.nio.SocketSendBufferPool$UnpooledSendBuffer.transferTo(SocketSendBufferPool.java:203)
            at org.jboss.netty.channel.socket.nio.AbstractNioWorker.write0(AbstractNioWorker.java:202)
            at org.jboss.netty.channel.socket.nio.AbstractNioWorker.writeFromTaskLoop(AbstractNioWorker.java:152)
            at org.jboss.netty.channel.socket.nio.AbstractNioChannel$WriteTask.run(AbstractNioChannel.java:335)
            at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:366)
            at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:290)
            at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:90)
            at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            at java.lang.Thread.run(Thread.java:744)
    ERROR [ReplicateOnWriteStage:178749] 2016-01-26 18:52:19,673 CassandraDaemon.java (line 187) Exception in thread Thread[ReplicateOnWriteStage:178749,5,main]
    java.lang.OutOfMemoryError: Java heap space
            at org.apache.cassandra.io.compress.CompressedRandomAccessReader.(CompressedRandomAccessReader.java:79)
            at org.apache.cassandra.io.compress.CompressedRandomAccessReader.open(CompressedRandomAccessReader.java:43)
            at org.apache.cassandra.io.util.CompressedPoolingSegmentedFile.createReader(CompressedPoolingSegmentedFile.java:48)
            at org.apache.cassandra.io.util.PoolingSegmentedFile.getSegment(PoolingSegmentedFile.java:39)
            at org.apache.cassandra.io.sstable.SSTableReader.getFileDataInput(SSTableReader.java:1195)
            at org.apache.cassandra.db.columniterator.SSTableNamesIterator.createFileDataInput(SSTableNamesIterator.java:96)
            at org.apache.cassandra.db.columniterator.SSTableNamesIterator.read(SSTableNamesIterator.java:109)
            at org.apache.cassandra.db.columniterator.SSTableNamesIterator.(SSTableNamesIterator.java:62)
            at org.apache.cassandra.db.filter.NamesQueryFilter.getSSTableColumnIterator(NamesQueryFilter.java:87)
            at org.apache.cassandra.db.filter.QueryFilter.getSSTableColumnIterator(QueryFilter.java:62)
            at org.apache.cassandra.db.CollationController.collectAllData(CollationController.java:250)
            at org.apache.cassandra.db.CollationController.getTopLevelColumns(CollationController.java:53)
            at org.apache.cassandra.db.ColumnFamilyStore.getTopLevelColumns(ColumnFamilyStore.java:1487)
            at org.apache.cassandra.db.ColumnFamilyStore.getColumnFamily(ColumnFamilyStore.java:1306)
            at org.apache.cassandra.db.Keyspace.getRow(Keyspace.java:332)
            at org.apache.cassandra.db.SliceByNamesReadCommand.getRow(SliceByNamesReadCommand.java:55)
            at org.apache.cassandra.db.CounterMutation.makeReplicationMutation(CounterMutation.java:100)
            at org.apache.cassandra.service.StorageProxy$8$1.runMayThrow(StorageProxy.java:1134)
            at org.apache.cassandra.service.StorageProxy$DroppableRunnable.run(StorageProxy.java:1936)
            at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
            at java.lang.Thread.run(Thread.java:744)


请你告诉我背后的原因

1)StorageProxy.submitHint中的java.lang.AssertionError。这与在单个节点中累积的更多提示有关吗?

2)java.io.IOException:管道损坏。什么是套接字连接丢失在这里?这也是由于提示吗?

3)java.lang.OutOfMemoryError:Java堆空间。这是由于内存中的更多关键缓存/索引还是其他任何内容?

编辑>>>>>>>>>>> 堆分析器的结果:

泄漏嫌疑人系统概述

click here to view memory usage in graph

问题疑似1

One instance of "org.apache.cassandra.db.ColumnFamilyStore" loaded by "sun.misc.Launcher$AppClassLoader @ 0x613e088a0" occupies 2,118,988,808 (24.81%) bytes. The memory is accumulated in one instance of "com.google.common.collect.RegularImmutableSet" loaded by "sun.misc.Launcher$AppClassLoader @ 0x613e088a0".

Keywords
org.apache.cassandra.db.ColumnFamilyStore
com.google.common.collect.RegularImmutableSet
sun.misc.Launcher$AppClassLoader @ 0x613e088a0

问题疑似2

616 instances of "java.lang.Thread", loaded by "<system class loader>" occupy 3,523,257,240 (41.25%) bytes.

Biggest instances:

java.lang.Thread @ 0x638299c08 ReadStage:632 - 134,347,752 (1.57%) bytes.
java.lang.Thread @ 0x63b00a200 ReadStage:637 - 134,280,896 (1.57%) bytes.
java.lang.Thread @ 0x634369e48 ReadStage:653 - 134,280,880 (1.57%) bytes.
java.lang.Thread @ 0x63a414ff0 ReadStage:635 - 134,280,880 (1.57%) bytes.
java.lang.Thread @ 0x63bba72d0 ReadStage:641 - 134,280,880 (1.57%) bytes.
java.lang.Thread @ 0x637262780 ReadStage:628 - 133,078,144 (1.56%) bytes.
java.lang.Thread @ 0x634a218c0 ReadStage:654 - 132,945,704 (1.56%) bytes.
java.lang.Thread @ 0x638299d40 ReadStage:633 - 131,541,840 (1.54%) bytes.
java.lang.Thread @ 0x6372626b0 ReadStage:659 - 127,398,120 (1.49%) bytes.
java.lang.Thread @ 0x63beb4318 ReadStage:648 - 123,054,816 (1.44%) bytes.
java.lang.Thread @ 0x638299ba0 ReadStage:631 - 119,311,688 (1.40%) bytes.
java.lang.Thread @ 0x63801ec40 ReadStage:630 - 117,908,592 (1.38%) bytes.
java.lang.Thread @ 0x63bba7408 ReadStage:644 - 114,369,344 (1.34%) bytes.
java.lang.Thread @ 0x638732808 ReadStage:656 - 113,170,032 (1.32%) bytes.
java.lang.Thread @ 0x6387314f8 ReadStage:655 - 111,166,192 (1.30%) bytes.
java.lang.Thread @ 0x63beb42b0 ReadStage:647 - 103,886,728 (1.22%) bytes.
java.lang.Thread @ 0x6372627e8 ReadStage:629 - 92,193,112 (1.08%) bytes.
java.lang.Thread @ 0x63b893688 ReadStage:638 - 86,715,880 (1.02%) bytes.


Keywords
java.lang.Thread
Details »

问题可疑3

4,072 instances of "byte[]", loaded by "<system class loader>" occupy 1,810,992,728 (21.20%) bytes. 

Keywords
byte[]

1 个答案:

答案 0 :(得分:0)

我建议使用Java命令行参数-XX启动问题节点:+ HeapDumpOnOutOfMemoryError

这将在磁盘上输出堆转储,稍后您可以使用分析器打开该转储,并查看您获取OutOfMemoryError的确切原因。