
問題
我無法讓 OpsCenter 連接到 datastax-agent。 datastax-agent 似乎啟動並嘗試連接到 cassandra,失敗是因為它不知道正確的憑證,但它也不會啟動 Jetty 伺服器來從 opscenter 接收憑證。因此它不斷重試,但始終無法連線。當 cassandra 允許所有連接(無需身份驗證)時,我的設定工作正常。
startup.log
以及agent.log
兩者都顯示重複:
錯誤[main] 2015-03-03 21:19:43,106 無法連線到Cassandra,正在重試com.datastax.driver.core.exceptions.AuthenticationException:主機/127.0.0.1:9042 上的驗證錯誤:主機/127. .0.1 :9042 需要身份驗證,但在叢集配置中找不到身份驗證器
設定
我安裝了數據稅務代理(5.1) Ubuntu 14.04.LTS 下來自官方的http://debian.datastax.com/community stable main
EC2 實例上。我的地址.yml看起來像這樣:
stomp_interface:PUBLIC_IP_OF_OPSCENTER_NODE
local_interface:PUBLIC_IP_OF_NODE agent_rpc_OF_OPSCENTER_NODE local_interface:PUBLIC_IP_OF_NODE agent_rpc_OF_OPSCENTER_NODE local_interface:PUBLIC_IP_OF_NODE
agent_rpc_interface:PRIVATE_IP_OF_NODE
agent_rpc_broadcast_address:PUBLIC_IP_OF_NODE
我也嘗試添加,cassandra_install_location: /opt/cassandra
但似乎沒有幫助。 Cassandra (2.1) 透過 tarball 安裝並以 user 身份運行ubuntu
,datastax-agent 也以ubuntu
.
問題
當 cassandra 需要身份驗證時,我缺少什麼來讓 datastax-agent 和 opscenter 進行通訊?
編輯:
啟動startup.log
後:
log4j:WARN No appenders could be found for logger (com.datastax.driver.core.SystemProperties).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
INFO [main] 2015-03-10 11:35:50,361 Loading conf files: /var/lib/datastax-agent/conf/address.yaml
INFO [main] 2015-03-10 11:35:50,412 Java vendor/version: Java HotSpot(TM) 64-Bit Server VM/1.7.0_76
INFO [main] 2015-03-10 11:35:50,412 DataStax Agent version: 5.1.0
INFO [main] 2015-03-10 11:35:50,490 Default config values: { ... }
INFO [main] 2015-03-10 11:35:50,685 Waiting for the config from OpsCenter
INFO [main] 2015-03-10 11:35:50,686 Using XX.XX.XXX.XXX as the cassandra broadcast address
INFO [main] 2015-03-10 11:35:50,686 New JMX connection (127.0.0.1:7199)
INFO [main] 2015-03-10 11:35:50,889 cassandra RPC address is nil
ERROR [main] 2015-03-10 11:35:51,048 Can't connect to Cassandra, retrying
com.datastax.driver.core.exceptions.AuthenticationException: Authentication error on host /127.0.0.1:9042: Host /127.0.0.1:9042 requires authentication, but no authenticator found in Cluster configuration
答案1
尼古拉斯檢查本文檔。將 cassandra 設定為使用內部身份驗證後,cassandra 使用者名稱和密碼將在 opscenterd 伺服器上的 opscenter 叢集設定檔中設定。該檔案名為 .conf
[cassandra] username
The thrift username to Cassandra if thrift authentication is enabled.
[cassandra] password
The thrift password to Cassandra if thrift authentication is enabled.
如果設定正確且您的代理程式仍然無法連接,那麼您也可以檢查您的 address.yaml 中設定的各個 IP 位址對於您的安裝是否正確。
具體來說,cassandra節點可以透過公共介面到達opscenterd伺服器嗎?驗證 local_interface IP 位址是否與 Nodetool 狀態輸出中看到的節點 IP 相符。驗證 opscenterd 伺服器是否可以使用代理 rpc 廣播位址 ip 到達節點上的代理程式。
答案2
您可以嘗試在address.yaml
設定檔中手動設定憑證。
cassandra_user: <username>
cassandra_pass: <password>
請參閱datastax代理配置和5.1升級指南,因為有些參數發生了變化。
答案3
克萊門特的答案對我有用。在 Solaris 11 上使用 5.1。 epoll”作為反應器,但不支援強制使用“select”。)