0

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

Sachin
  • 71
  • 2
  • 14
  • show use the output of nodetool status – Ashraful Islam Sep 13 '17 at 11:01
  • sachin@user-PC:~/elassandraDemo/elassandra-2.4.2/bin$ ./nodetool status twitter Datacenter: DC1 =============== Status=Up/Down |/ State=Normal/Leaving/Joining/Moving -- Address Load Tokens Owns (effective) Host ID Rack UN 127.0.0.1 186.72 KB 8 0.0% 089a9ce4-7676-4b14-9773-58aa5913fa34 r1 – Sachin Sep 13 '17 at 11:08

2 Answers2

3

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:

  • SimpleStrategy: Use for a single data center only. If you ever intend more than one data center, use the NetworkTopologyStrategy.
  • NetworkTopologyStrategy: Highly recommended for most deployments because it is much easier to expand to multiple data centers when required by future expansion.
Ashraful Islam
  • 12,470
  • 3
  • 32
  • 53
0

'dc1' at the time of creating the keyspace should be the Datacenter name when you use nodetool status

isaura almar
  • 406
  • 5
  • 11