NoHostAvailableException批量将数据加载到Cassandra时 [英] NoHostAvailableException while bulk loading data into Cassandra

查看:82
本文介绍了NoHostAvailableException批量将数据加载到Cassandra时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将100万LUBM数据集加载到Cassandra中。但是,在插入约200,000次后,我仍然收到此Exception。

I'm trying to load 1 Million LUBM dataset into Cassandra. But, I keep getting this Exception after about 200,000 inserts.


线程 main中的异常com.datastax.driver.core.exceptions.NoHostAvailableException:所有尝试查询的主机均失败(尝试过:localhost / 127.0.0.1(com.datastax.driver.core.exceptions.DriverException:读取期间超时))

Exception in thread "main" com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: localhost/127.0.0.1 (com.datastax.driver.core.exceptions.DriverException: Timeout during read))

服务器还活着。我仍然可以使用Datastax Dev Center执行CQL查询。在此之前,我遇到了WriteTimeoutException,因此在.yaml中进行了一些调整

The server is still alive. I can still execute CQL queries using Datastax Dev Center. Prior to this, I was getting WriteTimeoutException and hence I tweaked some options in .yaml

以下是我系统的规格:

CPU- Intel I5-2 cores |
内存-4GB |
硬盘-500 GB 4个驱动器。

CPU- Intel I5 - 2 cores| Memory- 4GB | Hard Disk- 500 GB 4 Drives.

我有一个OWL文件,可以从中读取数据并将其插入Cassandra。我的工作量参差不齐。有时,根据条件,我需要从该行中检索数据并将新数据附加到该数据并将其写入同一行。这不一定是导致此问题的原因,因为在20万次插入过程中,这种情况一定已经发生了很多次。

I have an OWL file from which the data is read and is inserted into Cassandra. I have mixed workloads. Sometimes, based upon a condition, I need to retrieve the data from the row and append the new data to it and write it to the same row. This mustn't be the cause for this problem because this condition must have occurred plenty of times during the 200k inserts.

我正在使用外部硬盘存储提交日志。
parallel_reads设置为16。
parallel_writes设置为32。
read_timeout已设置为10000,如write_timeout。
MAX_HEAP_SIZE = 2G
HEAP_NEWSIZE = 200M

I'm using an external hard disk for storing commitlogs. concurrent_reads is set to 16. concurrent_writes is set to 32. read_timeout has been set to 10000 and so as write_timeout. MAX_HEAP_SIZE="2G" HEAP_NEWSIZE="200M"

一旦出现帽子异常,我就会看到此模式的日志

As soon as I get hat exception, I see this log with this pattern

    INFO [MemoryMeter:1] 2014-03-25 16:28:56,498 Memtable.java (line 449) CFS(Keyspace='rdf', ColumnFamily='lubm1m.lubm1m_teacherof_idx') liveRatio is 15.733535462912831 (just-counted was 15.733535462912831).  calculation took 91ms for 665 cells
 INFO [MemoryMeter:1] 2014-03-25 16:30:01,560 Memtable.java (line 449) CFS(Keyspace='system', ColumnFamily='sstable_activity') liveRatio is 15.896188158961882 (just-counted was 15.896188158961882).  calculation took 37ms for 411 cells
 INFO [ScheduledTasks:1] 2014-03-25 16:33:22,252 GCInspector.java (line 116) GC for ParNew: 15581 ms for 1 collections, 395151608 used; max is 1038876672
 INFO [ScheduledTasks:1] 2014-03-25 16:33:24,894 StatusLogger.java (line 55) Pool Name                    Active   Pending      Completed   Blocked  All Time Blocked
 INFO [ScheduledTasks:1] 2014-03-25 16:33:26,956 StatusLogger.java (line 70) ReadStage                         0         0         343094         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:26,957 StatusLogger.java (line 70) RequestResponseStage              0         0              1         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:26,996 StatusLogger.java (line 70) ReadRepairStage                   0         0              0         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,004 StatusLogger.java (line 70) MutationStage                     0         0         601747         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,024 StatusLogger.java (line 70) ReplicateOnWriteStage             0         0              0         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,031 StatusLogger.java (line 70) GossipStage                       0         0              0         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,066 StatusLogger.java (line 70) AntiEntropyStage                  0         0              0         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,067 StatusLogger.java (line 70) MigrationStage                    0         0              0         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,098 StatusLogger.java (line 70) MemtablePostFlusher               0         0             52         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,099 StatusLogger.java (line 70) MemoryMeter                       0         0            139         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,100 StatusLogger.java (line 70) FlushWriter                       0         0             31         0                16
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,101 StatusLogger.java (line 70) MiscStage                         0         0              0         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,130 StatusLogger.java (line 70) PendingRangeCalculator            0         0              1         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,133 StatusLogger.java (line 70) commitlog_archiver                0         0              0         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,134 StatusLogger.java (line 70) InternalResponseStage             0         0              0         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,142 StatusLogger.java (line 70) HintedHandoff                     0         0              0         0                 0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,223 StatusLogger.java (line 79) CompactionManager                 0         0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,232 StatusLogger.java (line 81) Commitlog                       n/a         0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,262 StatusLogger.java (line 93) MessagingService                n/a       0/0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,262 StatusLogger.java (line 103) Cache Type                     Size                 Capacity               KeysToSave
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,287 StatusLogger.java (line 105) KeyCache                      17212                 51380224                      all
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,335 StatusLogger.java (line 111) RowCache                          0                        0                      all
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,336 StatusLogger.java (line 118) ColumnFamily                Memtable ops,data
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,336 StatusLogger.java (line 121) system.schema_triggers                    0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,337 StatusLogger.java (line 121) system.local                              0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,337 StatusLogger.java (line 121) system.peers                              0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,338 StatusLogger.java (line 121) system.batchlog                           0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,338 StatusLogger.java (line 121) system.NodeIdInfo                         0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,339 StatusLogger.java (line 121) system.compactions_in_progress                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,339 StatusLogger.java (line 121) system.schema_keyspaces                4,1130
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,340 StatusLogger.java (line 121) system.compaction_history            38,11220
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,340 StatusLogger.java (line 121) system.paxos                              0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,340 StatusLogger.java (line 121) system.schema_columns             3361,891818
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,341 StatusLogger.java (line 121) system.schema_columnfamilies         1426,394018
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,341 StatusLogger.java (line 121) system.IndexInfo                          0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,342 StatusLogger.java (line 121) system.range_xfers                        0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,344 StatusLogger.java (line 121) system.peer_events                        0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,344 StatusLogger.java (line 121) system.hints                              0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,345 StatusLogger.java (line 121) system.sstable_activity           1542,196000
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,345 StatusLogger.java (line 121) KeyspaceCumulus.POS_RN_NUM                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,346 StatusLogger.java (line 121) KeyspaceCumulus.DICT_SO_REVERSE                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,346 StatusLogger.java (line 121) KeyspaceCumulus.SPO_RN_DT                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,347 StatusLogger.java (line 121) KeyspaceCumulus.DICT_P_REVERSE                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,347 StatusLogger.java (line 121) KeyspaceCumulus.SPOC                      0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,348 StatusLogger.java (line 121) KeyspaceCumulus.POSC                      0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,348 StatusLogger.java (line 121) KeyspaceCumulus.counter                   0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,349 StatusLogger.java (line 121) KeyspaceCumulus.SCHEMA_O_PROPS                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,350 StatusLogger.java (line 121) KeyspaceCumulus.SCHEMA_D_PROPS                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,350 StatusLogger.java (line 121) KeyspaceCumulus.PREFIX_TO_NS                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,352 StatusLogger.java (line 121) KeyspaceCumulus.POS_RN_DT                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,352 StatusLogger.java (line 121) KeyspaceCumulus.SPO_RN_NUM                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,353 StatusLogger.java (line 121) KeyspaceCumulus.SCHEMA_CLASSES                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,353 StatusLogger.java (line 121) KeyspaceCumulus.OSPC                      0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,354 StatusLogger.java (line 121) KeyspaceCumulus.DICT_SO                   0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,354 StatusLogger.java (line 121) KeyspaceCumulus.DICT_P                    0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,355 StatusLogger.java (line 121) rdf.animal                                0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,355 StatusLogger.java (line 121) rdf.lubm20                                0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,356 StatusLogger.java (line 121) rdf.bsbm50                                0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,356 StatusLogger.java (line 121) rdf.tim                                   0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,357 StatusLogger.java (line 121) rdf.bsbm250                               0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,357 StatusLogger.java (line 121) rdf.lubm1m                    152700,22140112
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,358 StatusLogger.java (line 121) rdf.lubm3                                 0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,358 StatusLogger.java (line 121) system_traces.sessions                    0,0
 INFO [ScheduledTasks:1] 2014-03-25 16:33:27,359 StatusLogger.java (line 121) system_traces.events                      0,0

有什么可能

推荐答案

使用SocketOptions增加套接字超时。您也可以尝试在datastax客户端和服务器端进行配置。另外,看看降低一致性是否有帮助?

increase socket timeout with SocketOptions. You may try to configure it on datastax client and server side as well. Also, see if reducing consistency could be any help?

-Vivek

这篇关于NoHostAvailableException批量将数据加载到Cassandra时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆