wind wind - 6 months ago 65
Linux Question

cassandra 3.4 on virtual box not starting

I am using mac osx. i created 3 virtual box by virtualbox. I've installed centos7 minimal version on each of the virtual box.
Then i installed cassandra on each of the box. After installation it was starting by cqlsh and nodetool status command.
But after then when i was trying to link each other and edit cassandra.yaml file its started showing

('Unable to connect to any servers', {'127.0.0.1': error(111, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})


i've edited the cassandra.yaml file as follows:

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


my /etc/hosts file contains:

192.168.56.102 node01
192.168.56.103 node02
192.168.56.104 node03


Please tell me whats wrong i'm doing? My cassandra cluster not working.

solution: I got the solution from AKKI. The problem was enpoint_snitch. I made the endpoint_snitch=GossipingPropertyFileSnitch and it fixed. My now output is as follows:

[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

Answer

I had faced similar problem, I tried the following solution:

In Cassandra.yaml file check if you have,

start_rpc = true

Changed my endpoint snitch to

endpoint_snitch: GossipingFilePropertySnitch

Opened all ports Cassandra uses on my 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).

Command to open ports on CentOs 7(Find it according to your OS):

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

Then Restart your systems

Also it seems that you are changing the Cassandra.Yaml file after starting cassandra. Make sure you edit your Cassandra.yaml file on all nodes before starting Cassandra Also remember to start the seed node first.