Cassandra文档指出你必须指定一个单独的地址来监听,但我认为需要绑定到两个接口是相当普遍的,一个内部接口和一个外部接口供其他节点连接。
文档指出使用0.0.0.0总是错误的,但我想知道人们如何在云环境中解决这个问题,他们希望将私有网络的高速互连用于本地节点,然后将它们与之对等使用公共界面。
以下是配置文件的摘录:
# Address or interface to bind to and tell other Cassandra nodes to connect to.
# You _must_ change this if you want multiple nodes to be able to communicate!
#
# Set listen_address OR listen_interface, not both. Interfaces must correspond
# to a single address, IP aliasing is not supported.
#
# Leaving it blank leaves it up to InetAddress.getLocalHost(). This
# will always do the Right Thing _if_ the node is properly configured
# (hostname, name resolution, etc), and the Right Thing is to use the
# address associated with the hostname (it might not be).
#
# Setting listen_address to 0.0.0.0 is always wrong.
#
# If you choose to specify the interface by name and the interface has an ipv4 and an ipv6 address
# you can specify which should be chosen using listen_interface_prefer_ipv6. If false the first ipv4
# address will be used. If true the first ipv6 address will be used. Defaults to false preferring
# ipv4. If there is only one address it will be selected regardless of ipv4/ipv6.
listen_address: 0.0.0.0
# listen_interface: eth0
# listen_interface_prefer_ipv6: false