【问题标题】:cassandra 3.4 on virtual box not starting虚拟盒子上的 cassandra 3.4 未启动
【发布时间】: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.

标签: linux cassandra


【解决方案1】:

我也遇到过类似的问题, 我尝试了以下解决方案:

在 Cassandra.yaml 文件中检查是否有,

start_rpc = true

将我的端点告密者更改为

endpoint_snitch: GossipingFilePropertySnitch

打开 Cassandra 在我的 CentOS 上使用的所有端口

Cassandra inter-node ports
Port number Description
7000    Cassandra inter-node cluster communication.
7001    Cassandra SSL inter-node cluster communication.
7199    Cassandra JMX monitoring port.


Cassandra client port
Port number Description
9042    Cassandra client port.
9160    Cassandra client port (Thrift).

在 CentOs 7 上打开端口的命令(根据您的操作系统查找):

>sudo firewall-cmd --zone=public --add-port=9042/tcp --permanent
>sudo firewall-cmd –reload

然后重启你的系统

您似乎在启动 cassandra 后正在更改 Cassandra.Yaml 文件。 确保在启动 Cassandra 之前在所有节点上编辑 Cassandra.yaml 文件 还要记得先启动种子节点。

【讨论】:

  • 非常感谢亲爱的。它现在正在工作。问题是endpoint_snitch:GossipingFilePropertySnitch ..非常感谢您解决问题。 :) :)
  • 您好,亲爱的,我用您的解决方案编辑了我的问题并编写了输出。请重新加载问题并检查输出结果。它显示每个节点拥有 62%、73%、64%。可以吗?我认为应该是 33,33,33% 。对吗??
  • 是的,没错。你可以在这里阅读更多信息:docs.datastax.com/en/cassandra/2.1/cassandra/architecture/…
  • 亲爱的Akki,我在这里遇到了另一个问题stackoverflow.com/questions/37643249/…你能看看这里吗???
猜你喜欢
  • 2015-10-02
  • 2014-02-22
  • 1970-01-01
  • 2016-08-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-09-24
相关资源
最近更新 更多