cqlsh控制台中的NoHostAvailable错误 [英] NoHostAvailable error in cqlsh console
问题描述
我以后可以摆脱此错误,但是我不确定我所做的是正确的.1)
I was able to get rid of this error later but i am not sure what i did is correct. 1 )
CREATE KEYSPACE myKeySpace WITH replication =
{'class': 'NetworkTopologyStrategy', 'dc1': '1', 'dc2': '2'}
AND durable_writes = true;
执行创建表,然后选择表.这会在控制台中引发"NoHostAvailable:"错误.
Execute create table and select table after this. This throws "NoHostAvailable:" error in the console.
2)如果我将create语句更改为下面的语句,则选择查询有效.
2 ) If I change the create statement to the below one, the select query works.
CREATE KEYSPACE myKeySpace WITH replication =
{'class': 'NetworkTopologyStrategy', 'datacenter1': '1', 'dc2': '2'}
AND durable_writes = true;
如果我有一个默认的datacenter1,它可以工作.我无法理解为什么仅在给datacenter1时它才起作用.请帮忙.
If I have a default datacenter1, it works. I'm not able to understand why it is only working when I give datacenter1. Please help.
推荐答案
执行 nodetool状态
时,您看到哪个数据中心?
Which data centers do you see when you execute a nodetool status
?
您指定为键空间 的复制因子(RF)的数据中心必须在 cassandra-rackdc.properties
或 cassandra-拓扑.properties
文件(取决于您配置的Snitch).
The data centers that you specify as the replication factor (RF) for your keyspace must be predefined in either your cassandra-rackdc.properties
or cassandra-topology.properties
files (depending the Snitch you configured).
这篇关于cqlsh控制台中的NoHostAvailable错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!