Hadoop map jobs fail with com.datastax.driver.core.exceptions.NoHostAvailableException

↘锁芯ラ 提交于 2019-12-12 13:28:19

问题


I am trying to run analytics using hadoop map-reduce over data stored inside cassandra. For this, I am using the class CqlInputFormat available through the maven dependency cassandra-all. Currently we have been using 2.0.10 version of this dependency in our production environment. Also, we are using caassandra-driver-core having version 2.1.1.

Now, when I submit a simple map-reduce job to my jobtracker, all my mapper tasks fail with the below exception.

Another important thing to note here is that, if I use CqlPagingInputFormat available in 2.0.6 of cassandra-all, everything works fine. But this input format has been removed in the later versions.

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

Any inputs are most welcome.


回答1:


I have had the exactly same problem when using cassandra-all-2.0.10, but the problem has been resolved by using the version cassandra-all-2.0.12.

I think the correction is in this commit: Potentially use non-local hosts in CqlConfigHelper



来源:https://stackoverflow.com/questions/26056282/hadoop-map-jobs-fail-with-com-datastax-driver-core-exceptions-nohostavailableexc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!