jAvA
jAvA

Reputation: 593

How to connect cassandra which is in a docker image from outside the OS

configured docker in a ubuntu OS. installed cassandra node in docker. cassandra node shows ip as 17.7.0.1 and and ubuntu IP as 10.7.108.10. how can i connect connect cassandra from other machine in the same network . I have tried docker run -p 10.7.108.10 9043:9043 cassandra:latest. still lsof -i :9043 not giving any result , neither i'm able to connect from other machines. telnet also not working.

Upvotes: 1

Views: 2213

Answers (1)

Andy Tolbert
Andy Tolbert

Reputation: 11638

If you are exposing the port and want to access it via the host IP of the system running docker, you should configure the broadcast_rpc_address in cassandra.yaml to be that of your ubuntu server (10.7.108.10).

If you are using the official cassandra image you can pass in -e CASSANDRA_BROADCAST_ADDRESS=10.7.108.10 as documented.

Additionally, I see that you are exposing port 9043. Are you explicitly configuring the binary port in that way? It defaults to 9042.

Upvotes: 3

Related Questions