elasticsearchcassandracqlshelassandra

NoHostAvailable:, In elassandra on insert query with Network Topology Strategy


In elassandra on insert query with Network Topology Strategy it show's 'no host available'.

cqlsh>CREATE KEYSPACE IF NOT EXISTS twitter WITH replication={ 'class':'NetworkTopologyStrategy', 'dc1':'1' };

cqlsh>CREATE TABLE twitter.user (
   name text,
   attrs map<text,text>,
   PRIMARY KEY (name)
);

cqlsh>INSERT INTO twitter.user (name,attrs) VALUES ('bob',{'email':'bob@gmail.com','firstname':'bob'});

enter image description here nodetool statusenter image description here

another keyspace using same dc, show's this enter image description here


Solution

  • Change data center name of your keyspace to DC1

    ALTER KEYSPACE twitter WITH replication = {'class': 'NetworkTopologyStrategy', 'DC1' : 1};
    

    Data Center name is case sensitive.


    Edited

    Two replication strategies are available: