DEV
DEV

Reputation: 2176

Unable to setup Cassandra cluster

I am setting up cassandra cluster on centos 6.9 but unfortunately I am not able to do it.

cassandra versiion: 3.10

after running cassandra -R -f

console logs stuck at

INFO  [main] 2017-05-18 16:48:50,724 Server.java:156 - Starting listening for CQL clients on /192.168.22.231:9042 (unencrypted)...
INFO  [main] 2017-05-18 16:48:50,788 ThriftServer.java:116 - Binding thrift service to /192.168.22.231:9160
INFO  [Thread-2] 2017-05-18 16:48:50,794 ThriftServer.java:133 - Listening for thrift clients...

debug.log shows following

    at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:234) [apache-cassandra-3.10.jar:3.10]
DEBUG [MessagingService-Outgoing-/192.168.22.229-Gossip] 2017-05-18 16:54:57,313 OutboundTcpConnection.java:495 - Unable to connect to /192.168.22.229
java.net.NoRouteToHostException: No route to host
        at sun.nio.ch.Net.connect0(Native Method) ~[na:1.8.0_131]
        at sun.nio.ch.Net.connect(Net.java:454) ~[na:1.8.0_131]
        at sun.nio.ch.Net.connect(Net.java:446) ~[na:1.8.0_131]
        at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:648) ~[na:1.8.0_131]
        at org.apache.cassandra.net.OutboundTcpConnectionPool.newSocket(OutboundTcpConnectionPool.java:146) ~[apache-cassandra-3.10.jar:3.10]
        at org.apache.cassandra.net.OutboundTcpConnectionPool.newSocket(OutboundTcpConnectionPool.java:132) ~[apache-cassandra-3.10.jar:3.10]
        at org.apache.cassandra.net.OutboundTcpConnection.connect(OutboundTcpConnection.java:397) [apache-cassandra-3.10.jar:3.10]
        at org.apache.cassandra.net.OutboundTcpConnection.run(OutboundTcpConnection.java:234) [apache-cassandra-3.10.jar:3.10]
(END) 

Please help.

Upvotes: 0

Views: 511

Answers (2)

Jim Wright
Jim Wright

Reputation: 6058

Open the firewall on each node for the other nodes.

Add these lines to /etc/sysconfig/iptables on each node replacing NODE#_IP with the corresponding IP address:

-A INPUT -s NODE1_IP -j ACCEPT
-A INPUT -s NODE2_IP -j ACCEPT
-A INPUT -s NODE3_IP -j ACCEPT

Then restart iptables: service iptables restart

Upvotes: 2

Avinash
Avinash

Reputation: 2191

This can be the problem of firewall also.Try to stop your firewall and test again. For centos 6 following command should work.

service iptables stop

Upvotes: 1

Related Questions