OpsCenter 5.1.3 告诉代理错误的主机 IP

OpsCenter 5.1.3 告诉代理错误的主机 IP

当向集群添加新的 Cassandra 节点时,我们还会启动 DataStax 代理。一段时间后,代理显示不再连接。每当我们重新启动代理时,都会记录以下错误:

ERROR [Initialization] 2015-12-15 10:42:25,309 Can't connect to Cassandra, retrying soon.
 com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.10.1:9042 (com.datastax.driver.core.TransportException: [/192.168.10.1:9042] Cannot connect))

IP 地址 192.168.10.1 是broadcast_addressCassandra 节点的 IP 地址。IPrpc_address地址不同,这就是代理无法连接到节点的原因。OpsCenter 向代理发送了错误的 IP,如日志文件中所示(重新格式化以提高可读性):

INFO [StompConnection receiver] 2015-12-15 10:42:23,492 Got new config from OpsCenter: { :cassandra_port 9042, :rollups300_ttl 7776000, :destinations [], :restore_req_update_period 1, :cassandra_rpc_interface "192.168.10.1", :rollups60_ttl 7776000, :thrift_port 9160, :ec2_metadata_api_host "169.254.169.254", :metrics_enabled 1, :backup_staging_dir "", :rollups7200_ttl 7776000, :ssl_keystore nil, :metrics_ignored_column_families "", :cassandra_log_location "/var/log/cassandra/system.log", :config_md5 "49a3234ff4e1eca80f3b2c2027ae5d9c", :jmx_port 7199, :provisioning 0, :use_ssl 1, :max_pending_repairs 5, :rollups86400_ttl -1, :api_port "61621", :storage_keyspace "OpsCenter", :hosts ["192.168.10.1"], :metrics_ignored_solr_cores "", :metrics_ignored_keyspaces "system, system_traces, system_auth, dse_auth, OpsCenter", :rollup_subscriptions [], :cassandra_install_location ""}

重新启动 OpsCenter 并重新启动代理后,正确的 IP 将被发送到代理,并且不再记录任何错误。

当节点加入时,system.peers 表不包含新节点的条目。之后,它包含正确的地址。

除了每次添加新节点时重新启动 OpsCenter 之外,我们如何才能让新代理使用正确的地址(rpc_address)?

更新:在 address.yaml 中设置主机不起作用

刚刚尝试hosts: ["192.168.8.1"]在 中设置 (即节点的 rpc_address) /var/lib/datastax-agent/conf/address.yaml。行为完全相同。似乎该主机被 OpsCenter 提供的内容覆盖:

INFO [main] 2015-12-22 08:55:15,207 Loading conf files: /var/lib/datastax-agent/conf/address.yaml
INFO [main] 2015-12-22 08:55:15,258 Java vendor/version: Java HotSpot(TM) 64-Bit Server VM/1.8.0_45
INFO [main] 2015-12-22 08:55:15,258 DataStax Agent version: 5.1.3
INFO [main] 2015-12-22 08:55:15,282 Default config values: {... :agent_rpc_broadcast_address "192.168.10.1", ... :hosts ["192.168.8.1"]}
...
INFO [StompConnection receiver] 2015-12-22 08:55:21,015 Got new config from OpsCenter: {... :cassandra_rpc_interface "192.168.10.1", ... :hosts ["192.168.10.1"] ...}
...
ERROR [Initialization] 2015-12-22 08:55:22,926 Can't connect to Cassandra, retrying soon.
 com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s) tried for query failed (tried: /192.168.10.1:9042 (com.datastax.driver.core.TransportException: [/192.168.10.1:9042] Cannot connect))
...
WARN [Initialization] 2015-12-22 08:55:32,652 Resetting cluster because {:hosts ["192.168.8.1"]} changed to {:hosts ["192.168.10.1"], :local_interface "192.168.10.1"}

相关内容