问题
i am pretty new to cassandra and i am trying to setup a 2 node cluster in my home VM...i got 2 machines up and running
NAME - IP Address
machine#1 - cassa - 192.168.1.200
machine#2 - cassa2 - 192.168.1.201
i have gotten cassandra up and running on machine#1 but now when i try to bring up cassandra on machine#2 i get below msg
http://pastebin.com/qsRraVb5
here are the things changed on machine#1
cluster_name: 'demo'
data_file_directories:
- /home/cass/cassandra/data
commitlog_directory: /home/cass/cassandra/commitlog
saved_caches_directory: /home/cass/cassandra/saved_caches
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
- seeds: "192.168.1.200"
listen_address: 192.168.1.200
rpc_address: 192.168.1.200
and here is the stuff from machine#2
cluster_name: 'demo'
data_file_directories:
- /home/cass/cassandra/data
commitlog_directory: /home/cass/cassandra/commitlog
saved_caches_directory: /home/cass/cassandra/saved_caches
seed_provider:
- class_name: org.apache.cassandra.locator.SimpleSeedProvider
parameters:
- seeds: "192.168.1.200"
listen_address: 192.168.1.201
rpc_address: 192.168.1.201
any idea what i am missing here ?
also as you can see i can ping machine#1(my seed node) from machine#2
[cass@cassa2 cassandra]$ ping 192.168.1.200
PING 192.168.1.200 (192.168.1.200) 56(84) bytes of data.
64 bytes from 192.168.1.200: icmp_seq=1 ttl=64 time=1.20 ms
64 bytes from 192.168.1.200: icmp_seq=2 ttl=64 time=0.170 ms
64 bytes from 192.168.1.200: icmp_seq=3 ttl=64 time=0.167 ms
^C
--- 192.168.1.200 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2495ms
rtt min/avg/max/mdev = 0.167/0.515/1.208/0.490 ms
[cass@cassa2 cassandra]$
回答1:
It's important to ensure that the Cassandra nodes can communicate with each other, specifically on the intra-node ports found here: http://www.datastax.com/documentation/cassandra/2.1/cassandra/security/secureFireWall_r.html
Even if you don't have a hardware firewall, your Linux server might come with something like Uncomplicated FireWall:
sudo ufw allow 8888
sudo ufw allow 7000
sudo ufw allow 7001
sudo ufw allow 7199
sudo ufw allow 9042
sudo ufw allow 9160
sudo ufw allow 61620
sudo ufw allow 61621
Those are the commands that I had to use to open the ports with UFW on Ubuntu 12.04.
来源:https://stackoverflow.com/questions/26183989/exception-encountered-during-startup-unable-to-gossip-with-any-seeds