2014-09-26 122 views
3

我正在嘗試使用hadoop map-reduce在cassandra中存儲的數據運行分析。爲此,我使用可通過maven依賴項cassandra-all獲得的類CqlInputFormat。目前,我們在生產環境中一直使用這種依賴關係的2.0.10版本。另外,我們使用版本爲2.1.1的caassandra-driver-coreHadoop地圖作業失敗,出現com.datastax.driver.core.exceptions.NoHostAvailableException

現在,當我向我的jobtracker提交一個簡單的map-reduce作業時,我的所有mapper任務都會失敗,並顯示以下異常。

這裏需要注意的另一件重要的事情是,如果我使用cassandra-all 2.0.6中的CqlPagingInputFormat,那麼一切正常。但是這個輸入格式在後面的版本中已經被刪除了。

com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: 10.40.242.174:9042 (com.datastax.driver.core.exceptions.DriverException: Timeout while trying to acquire available connection (you may want to increase the driver number of per-host connections))) 
    at com.datastax.driver.core.exceptions.NoHostAvailableException.copy(NoHostAvailableException.java:65) 
    at com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException(DefaultResultSetFuture.java:258) 
    at com.datastax.driver.core.Cluster.connect(Cluster.java:267) 
    at org.apache.cassandra.hadoop.cql3.CqlRecordReader.initialize(CqlRecordReader.java:137) 
    at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.initialize(MapTask.java:521) 
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:763) 
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:364) 
    at org.apache.hadoop.mapred.Child$4.run(Child.java:255) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at javax.security.auth.Subject.doAs(Subject.java:415) 
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1190) 
    at org.apache.hadoop.mapred.Child.main(Child.java:249) 
Caused by: com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: 10.40.242.174:9042 (com.datastax.driver.core.exceptions.DriverException: Timeout while trying to acquire available connection (you may want to increase the driver number of per-host connections))) 
    at com.datastax.driver.core.RequestHandler.sendRequest(RequestHandler.java:103) 
    at com.datastax.driver.core.SessionManager.execute(SessionManager.java:446) 
    at com.datastax.driver.core.SessionManager.executeQuery(SessionManager.java:482) 
    at com.datastax.driver.core.SessionManager.executeAsync(SessionManager.java:88) 
    at com.datastax.driver.core.AbstractSession.executeAsync(AbstractSession.java:60) 
    at com.datastax.driver.core.Cluster.connect(Cluster.java:260) 
    ... 9 more 

任何輸入是最受歡迎的。

+0

似乎Cassandra是不活躍或者您沒有提供有效的端點。你能發佈代碼嗎? – 2014-12-16 21:38:15

+0

我使用Cassandra v2.0.11和'caassandra-driver-core' v2.1.4,並且遇到同樣的問題......當我使用'cassandra-all' v2.0.5中的'CqlPagingInputFormat'時,它工作正常。你解決了你的問題嗎?你能分享這個解決方案嗎? – 2015-03-29 12:03:40

+0

如果它很重要:我將'InputCQLPageRowSize'設置爲MAX 'CqlConfigHelper.setInputCQLPageRowSize(job.getConfiguration(),「」+ Integer.MAX_VALUE);' – 2015-03-29 12:26:06

回答