본문 바로가기
Operating System

Ubuntu/Debian OS 머신에 와탭(Whatap) 서버 에이전트 설치

강철지그·2022년 5월 26일·조회 1,801

1. 개요

우분투 또는 데비안 머신에 와탭 인프라 에이전트를 설치하는 방법이다. 아래 예시는 데비안 환경에서 리포지토리를 등록한 뒤 whatap-infra 패키지를 설치하고, 라이선스와 서버 정보를 설정해 에이전트를 실행하는 흐름으로 정리했다.

명령은 대부분 관리자 권한이 필요하므로 sudo를 사용한다. <제공된 라이선스><와탭서버> 값은 와탭 콘솔 또는 설치 안내에서 제공받은 값으로 바꿔 입력해야 한다.


2. 설치 파일용 리포지토리 설정

2.1. 커맨드 (whatap_repo.sh)

wget https://repo.whatap.io/debian/release.gpg -O - | sudo apt-key add -
wget https://repo.whatap.io/debian/whatap-repo_1.0_all.deb
sudo dpkg -i whatap-repo_1.0_all.deb
sudo apt-get update

첫 번째 명령에서 apt-key is deprecated 경고가 보일 수 있다. 이는 최신 Debian/Ubuntu 계열에서 apt-key 사용을 권장하지 않는다는 경고이며, 아래 예시처럼 패키지 목록 갱신이 정상적으로 끝나면 이어서 설치를 진행할 수 있다.

2.2. 실행 결과

debian@debian-1:~/whatap$ ./whatap_repo.sh
--2022-05-26 11:50:27--  https://repo.whatap.io/debian/release.gpg
Resolving repo.whatap.io (repo.whatap.io)... Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
54.192.175.116, 54.192.175.117, 54.192.175.85, ...
Connecting to repo.whatap.io (repo.whatap.io)|54.192.175.116|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1735 (1.7K) [binary/octet-stream]
Saving to: `STDOUT'

-                                                100%[==========================================================================================================>]   1.69K  --.-KB/s    in 0s

2022-05-26 11:50:32 (62.5 MB/s) - written to stdout [1735/1735]

OK
--2022-05-26 11:50:33--  https://repo.whatap.io/debian/whatap-repo_1.0_all.deb
Resolving repo.whatap.io (repo.whatap.io)... 99.86.207.28, 99.86.207.40, 99.86.207.78, ...
Connecting to repo.whatap.io (repo.whatap.io)|99.86.207.28|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1988 (1.9K) [application/x-debian-package]
Saving to: `whatap-repo_1.0_all.deb'

whatap-repo_1.0_all.deb                          100%[==========================================================================================================>]   1.94K  --.-KB/s    in 0s

2022-05-26 11:50:38 (4.60 MB/s) - `whatap-repo_1.0_all.deb' saved [1988/1988]

(데이터베이스 읽는중 ...현재 175038개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack whatap-repo_1.0_all.deb ...
Unpacking whatap-repo (1.0) over (1.0) ...
whatap-repo (1.0) 설정하는 중입니다 ...
기존:1 http://security.debian.org/debian-security bullseye-security InRelease
무시:2 http://repo.whatap.io/debian unstable/ InRelease
받기:3 http://repo.whatap.io/debian unstable/ Release [1,295 B]
받기:4 http://repo.whatap.io/debian unstable/ Release.gpg [490 B]
받기:5 http://repo.whatap.io/debian unstable/ Packages [29.7 kB]
기존:6 http://deb.debian.org/debian bullseye InRelease
받기:7 http://deb.debian.org/debian bullseye-updates InRelease [39.4 kB]
내려받기 41.1 k바이트, 소요시간 9초 (4,458 바이트/초)
패키지 목록을 읽는 중입니다... 완료

3. 패키지 설치

리포지토리 설정과 패키지 목록 갱신이 끝나면 whatap-infra 패키지를 설치한다.

sudo apt-get install whatap-infra

3.1. 실행 결과

debian@debian-1:~/whatap$ sudo apt-get install whatap-infra
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료
다음 새 패키지를 설치할 것입니다:
  whatap-infra
0개 업그레이드, 1개 새로 설치, 0개 제거 및 3개 업그레이드 안 함.
9,350 k바이트 아카이브를 받아야 합니다.
이 작업 후 25.7 M바이트의 디스크 공간을 더 사용하게 됩니다.
받기:1 http://repo.whatap.io/debian unstable/ whatap-infra 2.2.0 [9,350 kB]
내려받기 9,350 k바이트, 소요시간 11초 (858 k바이트/초)
Selecting previously unselected package whatap-infra.
(데이터베이스 읽는중 ...현재 175038개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../whatap-infra_2.2.0_amd64.deb ...
Unpacking whatap-infra (2.2.0) ...
whatap-infra (2.2.0) 설정하는 중입니다 ...

4. 에이전트 실행

4.1. 커맨드 (start_agent.sh)

echo "license=<제공된 라이선스>" | sudo tee /usr/whatap/infra/conf/whatap.conf
echo "whatap.server.host=<와탭서버>" | sudo tee -a /usr/whatap/infra/conf/whatap.conf
echo "createdtime=`date +%s%N`" | sudo tee -a /usr/whatap/infra/conf/whatap.conf
sudo service whatap-infra restart

tee 명령으로 /usr/whatap/infra/conf/whatap.conf 파일에 설정을 기록한다. 첫 번째 줄은 파일을 새로 쓰고, 이후 줄은 -a 옵션으로 기존 내용 뒤에 추가한다. 따라서 라이선스와 서버 값을 잘못 입력했다면 파일 내용을 확인한 뒤 다시 실행하는 것이 좋다.

4.2. 실행 결과

debian@debian-1:~/whatap$ ./start_agent.sh
license=<제공된 라이선스>
whatap.server.host=<와탭서버>
createdtime=1653533812163583595

4.3. 실행 확인

서비스 재시작 후에는 다음 명령으로 에이전트 상태를 확인할 수 있다.

sudo service whatap-infra status

서비스가 정상적으로 실행 중이라면 와탭 콘솔에서도 해당 서버가 수집 대상으로 표시되는지 함께 확인한다. 콘솔에 바로 보이지 않는 경우에는 라이선스, whatap.server.host 값, 서버의 외부 통신 가능 여부를 우선 점검한다.

관련 글

댓글 1

로그인 후 댓글을 남길 수 있습니다.

  • unnamedunnamed· 2022년 6월 22일
    좋은 정보 감사합니다.