DataStax Opscenter 代理程式無法連線:“無法找到 cassandra.yaml 設定檔”

DataStax Opscenter 代理程式無法連線:“無法找到 cassandra.yaml 設定檔”

我已在 Windows Server 2012 R2 Datacenter 電腦上安裝了 Datastax Community Edition v2.0.3。在普通安裝後,我無法使用 OpsCenter 連接到資料庫,因為代理無法啟動:頁面頂部顯示「已連接 0 個代理程式(共 1 個)」。我可以使用 CQLSH 連接到資料庫本身。 v2.0.2 不會出現此問題。

我的datastax_opscenter_agent-stderr.log文件包含以下內容:

2013-12-05 16:16:54 Commons Daemon procrun stderr initialized
Exception in thread "Initialization" clojure.lang.ExceptionInfo: throw+: {:type :bad-permissions, :message "Unable to locate the cassandra.yaml configuration file. If your configuration file is not located with the Cassandra install, please set the 'conf_location' option in the Cassandra section of the OpsCenter cluster configuration file and restart opscenterd. Checked the following directories: [\"/etc/dse/cassandra/cassandra.yaml\" \"/etc/cassandra/conf/cassandra.yaml\" \"/etc/cassandra/cassandra.yaml\" \"C:\\\\Program Files\\\\DataStax Community\\\\apache-cassandra\\\\bin\\\\conf\\\\cassandra.yaml\"]"} {:object {:type :bad-permissions, :message "Unable to locate the cassandra.yaml configuration file. If your configuration file is not located with the Cassandra install, please set the 'conf_location' option in the Cassandra section of the OpsCenter cluster configuration file and restart opscenterd. Checked the following directories: [\"/etc/dse/cassandra/cassandra.yaml\" \"/etc/cassandra/conf/cassandra.yaml\" \"/etc/cassandra/cassandra.yaml\" \"C:\\\\Program Files\\\\DataStax Community\\\\apache-cassandra\\\\bin\\\\conf\\\\cassandra.yaml\"]"}, :environment {tar-location "C:\\Program Files\\DataStax Community\\apache-cassandra\\bin\\conf\\cassandra.yaml", conf nil, checked-files ["/etc/dse/cassandra/cassandra.yaml" "/etc/cassandra/conf/cassandra.yaml" "/etc/cassandra/cassandra.yaml" "C:\\Program Files\\DataStax Community\\apache-cassandra\\bin\\conf\\cassandra.yaml"]}}
    at opsagent.util.cassandra_util$cassandra_conf_location.invoke(cassandra_util.clj:118)
    at opsagent.util.cassandra_util$get_cassandra_conf.invoke(cassandra_util.clj:130)
    at opsagent.opsagent$create_thrift_conf_vars.invoke(opsagent.clj:52)
    at opsagent.opsagent$setup_thrift.invoke(opsagent.clj:138)
    at opsagent.jmx$determine_ip.invoke(jmx.clj:333)
    at opsagent.jmx$setup_jmx$fn__1309.invoke(jmx.clj:350)
    at clojure.lang.AFn.run(AFn.java:24)
    at java.lang.Thread.run(Unknown Source) 

實際上目錄cassandra.yaml中有一個文件C:\Program Files\DataStax Community\apache-cassandra\conf,它應該在該目錄中。上面的消息表明它在 中查找C:\\Program Files\\DataStax Community\\apache-cassandra\\bin\\conf\\cassandra.yaml(注意 \bin)。

根據日誌的建議設定conf_location中的選項會導致相同的錯誤。opscenter\conf\clusters\local.conf

透過這一切,Windows 防火牆已關閉。

編輯

我一直在修改一點,現在我在日誌中得到了相同的異常,除了它正在尋找的路徑cassanda.yaml已從

'C:\Program Files\DataStax Community\apache-cassandra\bin\conf\cassandra.yaml'

'C:\Program Files\DataStax Community\utils\conf\cassandra.yaml'

我不知道我做了什麼來改變這一點。

我嘗試將 cassandra.yaml 複製到上面的目錄。這消除了 中的異常datastax_opscenter_agent-stderr.log,但 OpsCenter 仍然顯示「已連接 1 個代理程式中的 0 個」。但是,儀表板現在顯示圖表中的數據。我還可以向架構添加鍵空間,但創建後它不會顯示。不過,可以使用 存取它CLQSH。顯然,cassandra.yaml在兩個不同的地方也不是理想的選擇。

答案1

對於cassandra.yaml的位置,您可以cassandra_conf: "C:\Program Files\DataStax Community\apache-cassandra\bin\conf\cassandra.yaml"在address.yaml中設置,如果需要,請替換為正確的路徑。您需要重新啟動代理服務。

但 OpsCenter 仍顯示「0 個代理程式已連線」。

我會檢查 agent.log 是否有連接到中央 opscenterd 進程的任何錯誤。它正在收集和儲存數據(圖表)這一事實意味著它能夠在某個時刻進行連接。

也可能是 opscenterd 和代理之間的版本不匹配,但只有當您獨立昇級其中一個時才會發生這種情況。版本不符合在 UI 中顯示為非連線。

我還可以向架構添加鍵空間,但創建後它不會顯示。

金鑰空間可能需要一分鐘左右的時間才會顯示在 OpsCenter 中。如果刷新UI後仍然沒有出現,能具體分享一下你是如何創建的嗎?

答案2

我在同等人員的幫助下解決了問題那麼問題

conf_location我在文件中設定時使用引號local.conf,刪除引號解決了問題。

答案3

我在 Windows 7 x64 中安裝 DataStax Community Edition v1.2.15 時遇到了相同的問題。我讓它工作起來,然後在備份和回滾之後,我使用 Beyond Compare 來確定到底是什麼更改真正解決了這個問題。 Rik 的正確答案和等效的SO問題,因此我提供了更完整的答案。

在 C:\Program Files\DataStax Community\opscenter\conf\clusters\local.conf 中,預設內容為 ..

[cassandra]
seed_hosts = 127.0.0.1

.. 應該是 ..

[cassandra]
seed_hosts = 127.0.0.1
conf_location = C:\\Program Files\\DataStax Community\\apache-cassandra\\conf\\cassandra.yaml

重新啟動服務,然後在 OpsCenter 中,如果仍然顯示“0 of 1 Agents”,請按一下“立即修復”連結。就我而言,直到我單擊此鏈接,它才自我更新並顯示“1 of 1”,而沒有任何提示或警報。

相關內容