我正在使用 DSE Cassandra 并想使用 solr_query 所以创建了 Keyspace,如下所示:
create keyspace demo with replication = {'class': 'NetworkTopologyStrategy', 'Solr': 3};
创建了下表:
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) );
但是,当我尝试在此表中插入记录时,出现如下错误:
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}');
错误:
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\'}',)})
我需要验证哪些配置设置才能使用“NetworkTopologyStrategy”和“Solr”设置在密钥空间中插入记录?
我还可以在键空间如下时插入记录(但是这不是使用我想使用的 Solr。):
CREATE KEYSPACE user WITH replication =
{'class': 'SimpleStrategy', 'replication_factor': '3'}
AND durable_writes = true;