Apache Cassandra 維護工作

私有雲的邊緣 4.17.05 版

反熵維護

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

在單一區域或單一資料中心 Apigee 安裝中,在一個 Cassandra 節點上使用「nodetool -h localhostpair」指令,確保環環中的所有節點保持一致。在多區域或多資料中心的 Apigee 安裝中,應針對環狀中的每個節點 (適用於所有區域或資料中心) 使用「nodetool -h localhost train -pr」。

如要進一步瞭解「forgotten deletes」和 Cassandra 一致性,以及「nodetool」使用說明,請參閱:

http://wiki.apache.org/cassandra/Operations - 一致性

重要注意事項:除非聯絡 Apigee 客戶成功,否則 Apigee 不建議您新增、移動或移除 Cassandra 節點。Apigee 系統會使用 IP 位址追蹤 Cassandra 節點。如果在 Apigee 環境中繼資料沒有執行對應的更新作業,卻沒有執行對應的更新,會導致不理想的結果。

記錄檔維護

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 # 檔案大小上限
    conf_log4j-server_log4j.appender.r.maxbackupindex=50 # 開啟檔案大小上限
  2. 使用下列指令重新啟動 Cassandra:
    $ /opt/apigee/apigee-service/bin/apigee-service apigee-cassandra restart