Error during inserting data: NoHostAvailable:

本秂侑毒 提交于 2019-12-23 20:29:35

问题


I try to learn basics of Apache Cassandra. I found this simple example of application at https://docs.datastax.com/en/cql/3.1/cql/ddl/ddl_music_service_c.html

So I created a keyspace, then I created a table, and now I am trying to add some data to the database.

But when I try to Insert data I have got an error: "NoHostAvailable:" That's it. No more information.

So far I've tried to update python driver (NoHostAvailable exception connecting to Cassandra from python) but it didn't work.

What I do wrong? Or is it a problem with cqlsh?


回答1:


OK. I've found the answer. The NetworkTopologyStrategy is not suited for running on a single node. After changing replication strategy on SimpleStrategy everything started to work.




回答2:


Just met same problem. check the keyspace's replication setting, if using NetworkTopologyStrategy, ensure the dc name is correct.



来源:https://stackoverflow.com/questions/39904798/error-during-inserting-data-nohostavailable

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