docker-library / cassandra

Docker Official Image packaging for Cassandra
Apache License 2.0
263 stars 281 forks source link

Allow separate configuration of broadcast_rpc_address #164

Closed jfharden closed 6 years ago

jfharden commented 6 years ago

I would very much like it if we could have the option of providing CASSANDRA_BROADCAST_RPC_ADDRESS as a separate env var so we can have a separate network interface for internode communication.

Imagine a server with 2 network interfaces:

eth0: 192.168.0.2 eth1: 10.0.0.2

Clients want to talk to the node on 192.168.0.2 but internode communication should be over the 10.0.0.2 interface, I would need to set

CASSANDRA_LISTEN_ADDRESS=10.0.0.2 CASSANDRA_BROADCAST_ADDRESS=10.0.0.2

CASSANDRA_RPC_ADDRESS=192.168.0.2 CASSANDRA_BROADCAST_RPC_ADDRESS=192.168.0.2

The only part missing in the out of the box docker configuration is being able to set the broadcast_rpc_address independently. Since the broadcast_address is for in-cluster communication and broadcast_rpc_address is for client to cluster communication it seems sensible to me to enable this separation.

If you're happy with the principal I'm happy to do a PR for this?

tianon commented 6 years ago

https://github.com/docker-library/cassandra/blob/16adc2232c7bdd7a55a0591d987c18325b122298/docker-entrypoint.sh#L52

This is already how it works -- if you don't set CASSANDRA_BROADCAST_RPC_ADDRESS, it defaults to the value of CASSANDRA_BROADCAST_ADDRESS.

jfharden commented 6 years ago

Ah yeah sorry, ok slightly different request, could you update the dockerhub page to include that as an option that can be set.