How to configure cassandra for remote connection

Obama picture Obama · Mar 21, 2016 · Viewed 41.8k times · Source

I am trying to configure Cassandra Datastax Community Edition for remote connection on windows,

Cassandra Server is installed on a Windows 7 PC, With the local CQLSH it connects perfectly to the local server.

But when i try to connect with CQLSH from another PC in the same Network, i get this error message:

Connection error: ('Unable to connect to any servers', {'MYHOST': error(10061, "Tried connecting to [('HOST_IP', 9042)]. Last error: No connection could be made because the target machine actively refused it")})

So i am wondering how to configure correctly (what changes should i make on cassandra.yaml config file) the Cassandra server to allow remote connections.

Thank you in advance!

Answer

ahll picture ahll · May 9, 2018

How about this:

Make these changes in the cassandra.yaml config file:

start_rpc: true

rpc_address: 0.0.0.0

broadcast_rpc_address: [node-ip]

listen_address: [node-ip]

seed_provider:
  - class_name: ...
    - seeds: "[node-ip]"

reference: https://gist.github.com/andykuszyk/7644f334586e8ce29eaf8b93ec6418c4