Cassandra : cqlsh noHostAvailable error on select query

Author: priyanka178

I am getting an error :noHostAvailable in cqlsh when I am running select query for a table, although I am able to insert in that table.

When I tried nodetool status command, I found...

 Datacenter: datacenter1


 Status=Up/Down|/ State=Normal/Leaving/Joining/Moving
 --  Address       Load       Tokens       Owns (effective)  Host ID                               

 Rack

 DN  172.22.4.140  ?          256          65.0%             
 UN  127.0.0.1     2.05 MiB   256          69.8%             
 DN  172.22.8.44   ?          256          65.2%             

I only have a setup for single node cluster, how to change this setting to single node, also do I need to alter my keyspace, which I suspect expecting more than one node.

Originally Sourced from: https://stackoverflow.com/questions/57898965/cassandra-cqlsh-nohostavailable-error-on-select-query