wind wind - 1 year ago 129
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', {'': error(111, "Tried connecting to [('', 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: ","
storage_port: 7000
rpc_port: 9160
endpoint_snitch: SimpleSnitch

my /etc/hosts file contains: node01 node02 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
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 107.38 KB 256 62.5% 0526a2e1-e6ce-4bb4-abeb-b9e33f72510a rack1
UN 106.85 KB 256 73.0% 0b7b76c2-27e8-490f-8274-571d00e60c20 rack1
UN 83.1 KB 256 64.5% 6c8d80ec-adbb-4be1-b255-f7a0b63e95c2 rack1


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.