【发布时间】:2016-06-01 17:09:40
【问题描述】:
我正在使用 mac osx。我用 virtualbox 创建了 3 个虚拟盒子。我已经在每个虚拟盒子上安装了 centos7 最小版本。 然后我在每个盒子上安装了 cassandra。安装后它是通过 cqlsh 和 nodetool status 命令启动的。 但在那之后,当我试图相互链接并编辑 cassandra.yaml 文件时,它开始显示
('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
我已将 cassandra.yaml 文件编辑如下:
cluster_name: 'Home Cluster'
num_tokens: 256
partitioner: org.apache.cassandra.dht.Murmur3Partitioner
- seeds: "192.168.56.102,192.168.56.103"
storage_port: 7000
listen_address: 192.168.56.102
rpc_address: 192.168.56.102
rpc_port: 9160
endpoint_snitch: SimpleSnitch
我的 /etc/hosts 文件包含:
192.168.56.102 node01
192.168.56.103 node02
192.168.56.104 node03
请告诉我我在做什么错?我的 cassandra 集群不工作。
解决方案:我从 AKKI 获得了解决方案。问题是enpoint_snitch。我制作了 endpoint_snitch=GossipingPropertyFileSnitch 并修复了它。我现在的输出如下:
[root@dbnode2 ~]# nodetool status
Datacenter: dc1
===============
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 192.168.56.101 107.38 KB 256 62.5% 0526a2e1-e6ce-4bb4-abeb-b9e33f72510a rack1
UN 192.168.56.102 106.85 KB 256 73.0% 0b7b76c2-27e8-490f-8274-571d00e60c20 rack1
UN 192.168.56.103 83.1 KB 256 64.5% 6c8d80ec-adbb-4be1-b255-f7a0b63e95c2 rack1
【问题讨论】:
-
简单测试。从每个虚拟框,在命令行上,请确保您可以使用他们的 IP (192.168.56.xxx) ping 其他 2 个 Cassandra。我怀疑这是一个简单的网络问题
-
是的,我可以 ping 成功。一切都好。我可以通过 SSH 连接到每个节点。我真的很想完成集群。但只是卡在这里。找不到任何解决方案。
-
请发布
/var/log/cassandra/system.log的摘录以查看整个异常堆栈跟踪 -
该日志出现在哪里?您似乎正在连接到 127.0.0.1。虽然你的节点有一个 uo if 192.168.56.xxx.