0

I am using DSE Cassandra and want to use solr_query so created the Keyspace as follows:

create keyspace demo with replication = {'class': 'NetworkTopologyStrategy', 'Solr': 3};

Created the following table:

create table demo.onlinetransactions 
( unique_tran_id text, user_id text, account_type text, 
account_id text, create_ts timestamp, data text, 
primary key (unique_tran_id) );

However when I try to insert record in this table I am getting error as mentioned below:

insert into demo.onlinetransactions (unique_tran_id, user_id, 
account_type, account_id, create_ts, data) 
values ('trans1', 'user1', 'creditcard', 
'1234567890123451', '2015-01-01 09:00:00', '{amount:100.00,vendor:Amazon}');

Error:

NoHostAvailable: ('Unable to complete the operation against any hosts',
{<Host: 127.0.0.1 dc0>: Unavailable('Error from server: code=1000
[Unavailable exception] 
message="Cannot achieve consistency level ONE" 
info={\'required_replicas\': 1, \'alive_replicas\': 0, 
      \'consistency\': \'ONE\'}',)})

What configuration settings do I need to verify for me to be able to insert records in the keyspace with "NetworkTopologyStrategy" and "Solr" setting?

Also I am able to insert records when the keyspace as follows (however this is not using Solr which I want to use.):

CREATE KEYSPACE user WITH replication = 
{'class': 'SimpleStrategy', 'replication_factor': '3'}  
AND durable_writes = true;
Virendra
  • 101
  • 8
  • Is your datacenter named Solr? If not then you need to use your datacenter name as this field has nothing to do with Solr. It is important to note that if you have Solr enabled in DSE all you need to do is create a core for the C* table and index. – mando222 Aug 31 '16 at 14:47
  • Just wanted to know where can I find the Datacenter name. I tried the names from "cassandra-topology.properties" file. Is this the location from where I can get the Datacenter name. Like xx.0.0.xx=DC1:RAC1 I specified DC1 still got the error. – Virendra Aug 31 '16 at 15:47

1 Answers1

2

After specifying the correct Data Center name in the KeySpace the solr_query worked with NetworkTopologyStrategy as replication strategy.

Virendra
  • 101
  • 8