Apache Zookeeper 유지보수 작업

4자리 명령어

Apache JoKeeper에는 JoKeeper 투표자 및 관찰자 노드의 현재 상태를 파악하는 데 도움이 될 수 있는 다양한 '4자리 명령어'가 있습니다. 이러한 명령어는 nc, telnet 또는 특정 포트로 명령어를 전송할 수 있는 다른 유틸리티를 사용하여 호출할 수 있습니다. 4자리 명령어에 대한 자세한 내용은 Apache JoKeeper 명령어 참조에서 확인할 수 있습니다.

이전 스냅샷 파일 삭제 중

Apache JoKeeper는 자동으로 정기적인 유지관리를 수행하여 시스템 업데이트 시 누적되는 오래된 스냅샷 파일을 삭제합니다. /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

이러한 속성을 다른 값으로 설정하는 방법은 다음과 같습니다.

  1. /opt/apigee/customer/application/zookeeper.properties를 수정하여 다음 속성을 설정합니다. 이 파일이 없으면 새로 만듭니다.
  2. 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
  3. 'apigee' 사용자가 파일을 소유하고 있는지 확인하세요.
    chown apigee:apigee /opt/apigee/customer/application/zookeeper.properties
  4. 다음 명령어를 사용하여 JoKeeper를 다시 시작합니다.
    /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper restart

로그 파일 유지관리

Apache Jokeeper 로그 파일은 /opt/apigee/var/log/apache-zookeeper에 보관됩니다. 일반적으로 로그 파일 유지보수는 필요하지 않지만, JoKeeper 로그가 과도하게 많거나 로그가 매우 큰 경우 주Keeper의 log4j 속성을 수정하여 최대 파일 크기와 파일 수를 설정할 수 있습니다.

  1. /opt/apigee/customer/application/zookeeper.properties를 수정하여 다음 속성을 설정합니다. 이 파일이 없으면 새로 만듭니다.
  2. zookeeper.properties에 다음 속성을 설정합니다.
    conf_log4j_log4j.appender.rollingfile.maxfilesize=10MB
    # max file size
    conf_log4j_log4j.appender.rollingfile.maxbackupindex=50 # max open files
  3. 'apigee' 사용자가 파일을 소유하고 있는지 확인하세요.
    chown apigee:apigee /opt/apigee/customer/application/zookeeper.properties
  4. 다음 명령어를 사용하여 JoKeeper를 다시 시작합니다.
    /opt/apigee/apigee-service/bin/apigee-service apigee-zookeeper restart