SNR#2846 로그프레소 런처 배포

버전: 4.0.2502.0

로그프레소를 설치, systemd 등록, 구동, 중지할 수 있는 런처 기능이 공식 배포되었습니다. 기존에 사용하던 run.sh, config.sh 를 대체합니다. 구체적인 사용법은 다음과 같습니다.

  • 사전 준비
    • 로그프레소 설치 명령을 수행하기 위해선 root 권한이 필요합니다. 권한이 없을 경우 오류 메시지를 표시합니다.
      $ ./logpresso install server
      error: install requires root privileges.
      
    • 런처를 사용하기 위해선 JAVA_HOME 변수를 설정해야 합니다.
      $ export JAVA_HOME=/opt/logpresso/jdk-11.0.14.1-jemalloc
      
      • JAVA_HOME 변수를 설정하지 않으면 오류 메시지를 표시합니다.
      $ sudo ./logpresso
      Error: JAVA_HOME is not defined correctly.
      We cannot execute
      
    • systemctl 기능을 사용하기 위해선 로그프레소 설치 경로에 jre 심볼릭 링크를 생성해야 합니다.
      $ ln -s jdk-11.0.14.1-jemalloc jre
      
      • jre 심볼릭 링크가 없을 경우 아래와 같이 구동에 실패합니다.
      $ systemctl start logpresso
      Job for logpresso.service failed because the control process exited with error code.
      See "systemctl status logpresso.service" and "journalctl -xeu logpresso.service" for details.
      
  • 설정 파일 생성
    • 신규 설치를 하는 경우든 기존에 run.sh를 쓰다가 런처로 전환하는 경우든, 런처를 통해 로그프레소를 구동하기 위해서는 런처 설정 파일이 필요합니다. logpresso install config 명령을 수행하면 logpresso.conf 파일을 생성합니다.
      $ ./logpresso install config
      configuration file is created: /logpresso/etc/logpresso.conf
      $ vi ./etc/logpresso.conf
      
    • 설정 파일에서 필요한 항목을 설정합니다. 예를 들어 로그프레소 셸 SSH 접근을 허용하려면 아래와 같이 logpresso.conf 파일을 수정합니다.
      # Parameter:    -Daraqne.ssh.server
      # Default:      disabled
      # Value:        disabled | enabled
      SSH_OPEN="enabled"
      
  • 로그프레소 설치
    • install server 명령어로 로그프레소 서버를 설치할 수 있습니다.
      $ ./logpresso install server
      
  • 로그프레소 systemd 등록
    • install systemd-service로 로그프레소를 systemd에 등록할 수 있습니다. systemd에 등록하면 systemctl을 통해 로그프레소를 시작하거나 중지할 수 있으며, 서버 부팅 시 자동으로 시작되도록 systemctl enable 설정을 할 수 있습니다.
      $ ./logpresso install systemd-service
      
  • 로그프레소 구동 및 중지
    • start 명령어로 로그프레소를 구동합니다.
      $ ./logpresso start
      
    • stop 명령어로 로그프레소를 중지합니다.
      $ ./logpresso stop