【发布时间】:2016-10-22 13:04:12
【问题描述】:
我创建了具有以下配置的 2 节点 cassandra 集群。
节点 1:
cassandra-topology.properties:
192.168.1.177=DC1:RAC1
192.168.1.134=DC2:RAC2
cassandra.yml:
cluster_name: 'TestCluster'
num_tokens: 256
listen_address:
rpc_address: localhost
- seeds: "192.168.1.177,192.168.1.134"
endpoint_snitch: GossipingPropertyFileSnitch
节点 2:
cassandra-topology.properties:
192.168.1.177=DC1:RAC1
127.0.0.1=DC2:RAC2 # Also tried 192.168.1.134 ip
cassandra.yml:
cluster_name: 'TestCluster'
num_tokens: 256
listen_address:
rpc_address: localhost
- seeds: "192.168.1.177"
endpoint_snitch: GossipingPropertyFileSnitch
我可以使用“nodetool status”命令看到两个节点都已启动并正在运行。我创建的 Keyspace 如下:
> CREATE KEYSPACE testReplication WITH replication = {'class': NetworkTopologyStrategy', 'DC1' : '2', 'DC2' : '2'};
我还可以创建复制到两个节点的表,但是当我尝试在表上“插入”或“选择”时,cqlsh 给出了“NoHostAvailable:”, 但 system.log 没有显示任何内容。
任何帮助将不胜感激。
谢谢。
【问题讨论】:
标签: cassandra database-replication