无法使用 public IP 启动 Cassandra 服务器(端口 7000 错误)
Can't start Cassandra server with public IP(Port 7000 error)
我正在 centos 6.8 上设置 cassandra 服务器并更改为 public IP
通过使用 方法但是当用 cassandra -f -R 启动服务器时它卡住了,我得到了这个错误:
ERROR [main] 2019-09-10 11:42:31,684 CassandraDaemon.java:749 - Fatal
configuration error
org.apache.cassandra.exceptions.ConfigurationException: Unable to bind to
address /<public ip>:7000. Set listen_address in cassandra.yaml to an
interface you can bind to, e.g., your private IP address on EC2
at org.apache.cassandra.net.MessagingService.getServerSockets(MessagingService.java:739) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.net.MessagingService.listen(MessagingService.java:681) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.net.MessagingService.listen(MessagingService.java:665) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:796) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.StorageService.initServer(StorageService.java:683) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.StorageService.initServer(StorageService.java:632) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:388) [apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:620) [apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:732) [apache-cassandra-3.11.4.jar:3.11.4]
我尝试改变/cassandra.yaml
rpc_address: 0.0.0.0
listen_address: <public ip>
broadcast_rpc_address: <public ip>
但还是卡在了这一点
rpc_address
和broadcast_rpc_address
是客户端的地址,但您需要配置节点间通信。
DataStax documentation says(OSS Cassandra 也一样):
In the cassandra.yaml
, set the listen_address
to the private IP address of the node, and the broadcast_address
to the public IP address of the node. This allows DataStax Enterprise nodes in one EC2 region to bind to nodes in another region, thus enabling multiple datacenter support. For intra-region traffic, DataStax Enterprise switches to the private IP after establishing a connection.
Set the addresses of the seed nodes in the cassandra.yaml
file to that of the public IP. Private IP are not routable between networks. For example:
我正在 centos 6.8 上设置 cassandra 服务器并更改为 public IP 通过使用 方法但是当用 cassandra -f -R 启动服务器时它卡住了,我得到了这个错误:
ERROR [main] 2019-09-10 11:42:31,684 CassandraDaemon.java:749 - Fatal
configuration error
org.apache.cassandra.exceptions.ConfigurationException: Unable to bind to
address /<public ip>:7000. Set listen_address in cassandra.yaml to an
interface you can bind to, e.g., your private IP address on EC2
at org.apache.cassandra.net.MessagingService.getServerSockets(MessagingService.java:739) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.net.MessagingService.listen(MessagingService.java:681) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.net.MessagingService.listen(MessagingService.java:665) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.StorageService.prepareToJoin(StorageService.java:796) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.StorageService.initServer(StorageService.java:683) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.StorageService.initServer(StorageService.java:632) ~[apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.CassandraDaemon.setup(CassandraDaemon.java:388) [apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.CassandraDaemon.activate(CassandraDaemon.java:620) [apache-cassandra-3.11.4.jar:3.11.4]
at org.apache.cassandra.service.CassandraDaemon.main(CassandraDaemon.java:732) [apache-cassandra-3.11.4.jar:3.11.4]
我尝试改变/cassandra.yaml
rpc_address: 0.0.0.0
listen_address: <public ip>
broadcast_rpc_address: <public ip>
但还是卡在了这一点
rpc_address
和broadcast_rpc_address
是客户端的地址,但您需要配置节点间通信。
DataStax documentation says(OSS Cassandra 也一样):
In the
cassandra.yaml
, set thelisten_address
to the private IP address of the node, and thebroadcast_address
to the public IP address of the node. This allows DataStax Enterprise nodes in one EC2 region to bind to nodes in another region, thus enabling multiple datacenter support. For intra-region traffic, DataStax Enterprise switches to the private IP after establishing a connection.Set the addresses of the seed nodes in the
cassandra.yaml
file to that of the public IP. Private IP are not routable between networks. For example: