问题
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