Apache Cassandra 維護工作

Edge for Private Cloud 4.18.05 版

反熵維護

Apache Cassandra 環狀節點需要定期維護,確保所有節點的一致性。如要執行這項維護作業,請使用 Cassandra「nodetool -h localhost repair」指令。

在單一區域或單一資料中心 Apigee 安裝中,請在一個 Cassandra 節點上使用 nodetool -h localhost repair 指令,確保環中所有節點的一致性。在多區域或多資料中心 Apigee 安裝中,請在環中的每個節點 (跨所有區域或資料中心) 使用 nodetool -h localhost repair -pr。

詳情請參閱下列資源:

記錄檔維護

Cassandra 記錄檔會儲存在每個節點的 /opt/apigee/var/log/cassandra 目錄中。根據預設,系統最多可建立 50 個記錄檔,每個檔案的大小上限為 20 MB。達到上限後,系統會在建立新記錄時刪除舊記錄。

如果發現 Cassandra 記錄檔占用過多空間,可以編輯 log4j 設定,修改分配給記錄檔的空間量。

  1. 編輯 /opt/apigee/customer/application/cassandra.properties,設定下列屬性。如果該檔案不存在,請建立檔案:
    conf_log4j-server_log4j.appender.r.maxfilesize=20MB
    # max file size
    conf_log4j-server_log4j.appender.r.maxbackupindex=50 # max open files
  2. 使用下列指令重新啟動 Cassandra:
    /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra restart