4 文字コマンド
Apache ZooKeeper には、ZooKeeper のボーターノードとオブザーバ ノードの現在のステータスの判定に役立つ「4 文字コマンド」がいくつかあります。これらのコマンドは、nc
、telnet
、または特定のポートにコマンドを送信できる別のユーティリティを使用して呼び出すことができます。4 文字のコマンドの詳細については、Apache ZooKeeper コマンド リファレンスをご覧ください。
古いスナップショット ファイルを削除する
Apache ZooKeeper は、システム更新が行われるたびに蓄積される古いスナップショット ファイルを削除するために、定期的なメンテナンスを自動的に実行します。このプロセスは、/opt/apigee/apigee-zookeeper/conf/zoo.cfg
の次の設定によって制御されます。
## The number of snapshots to retain in dataDir: autopurge.snapRetainCount=5 # Purge task interval in hours. # Set to "0" to disable auto purge feature. autopurge.purgeInterval=120
これらのプロパティに異なる値を設定するには:
/opt/apigee/customer/application/zookeeper.properties
を編集して次のプロパティを設定します。このファイルが存在しない場合は作成します。zookeeper.properties
で次のプロパティを設定します。# Set the snapshot count. In this example set it to 10: conf_zoo_autopurge.snapretaincount=10 # Set the purge interval. In this example, set is to 240 hours: conf_zoo_autopurge.purgeinterval=240
- ファイルの所有者を「apigee」ユーザーにします。
chown apigee:apigee /opt/apigee/customer/application/zookeeper.properties
- ZooKeeper を再起動します。
/opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper restart
ログファイルのメンテナンス
Apache Zookeeper のログファイルは、/opt/apigee/var/log/apache-zookeeper
に保存されます。通常、ログファイルのメンテナンスは不要ですが、ZooKeeper ログの数が多すぎる場合や、ログが非常に大きい場合は、ZooKeeper の log4j プロパティを変更して最大ファイルサイズとファイル数を設定できます。
/opt/apigee/customer/application/zookeeper.properties
を編集して次のプロパティを設定します。このファイルが存在しない場合は作成します。zookeeper.properties
で次のプロパティを設定します。conf_log4j_log4j.appender.rollingfile.maxfilesize=10MB # max file size conf_log4j_log4j.appender.rollingfile.maxbackupindex=50 # max open files
- ファイルの所有者を「apigee」ユーザーにします。
chown apigee:apigee /opt/apigee/customer/application/zookeeper.properties
- ZooKeeper を再起動します。
/opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper restart