APM Tool - Zabbix

Zabbix를 Ubuntu 환경에 Docker로 설치하기

AWS Ec2를 Ubuntu20.4로 생성한다.

zabbix 구성 image들을 다운로드합니다.

docker pull mysql
docker pull zabbix/zabbix-server-mysql
docker pull zabbix/zabbix-web-nginx-mysql
docker pull zabbix/zabbix-java-gateway
docker pull zabbix/zabbix-agent입력하세요

Zabbix 설치하기

1. Mysql

docker run --name mysql-server -t -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="비밀번호" -e MYSQL_ROOT_PASSWORD="root비밀번호" -d mysql --character-set-server=utf8 --collation-server=utf8_bin --default-authentication-plugin=mysql_native_password

패스워드 주의

restart 옵션이 없으므로, zabbix 서버 재부팅시 mysql 부터 시작해야 한다.

2. Zabbix java 게이트웨이

docker run --name zabbix-java-gateway -t --restart unless-stopped -d zabbix/zabbix-java-gateway

3. Zabbix-server-mysql

docker run --name zabbix-server-mysql -t -e DB_SERVER_HOST="mysql-server" -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="비밀번호" -e MYSQL_ROOT_PASSWORD="비밀번호" -e ZBX_JAVAGATEWAY="zabbix-java-gateway" --link mysql-server:mysql --link zabbix-java-gateway:zabbix-java-gateway -p 10051:10051 --restart unless-stopped -d zabbix/zabbix-server-mysql

4. Zabbix-web-nginx

docker run --name zabbix-web-nginx-mysql -t -e DB_SERVER_HOST="mysql-server" -e MYSQL_DATABASE="zabbix" -e MYSQL_USER="zabbix" -e MYSQL_PASSWORD="비밀번호" -e MYSQL_ROOT_PASSWORD="비밀번호" --link mysql-server:mysql --link zabbix-server-mysql:zabbix-server -p 8080:8080 --restart unless-stopped -d zabbix/zabbix-web-nginx-mysql

5. Zabbix agent

docker run --name zabbix-agent --link mysql-server:mysql --link zabbix-server-mysql:zabbix-server -e ZBX_HOSTNAME="Zabbix server" -e ZBX_SERVER_HOST="zabbix-server" -d zabbix/zabbix-agent

6. 설치완료 확인

docker ps

CONTAINER ID   IMAGE                           COMMAND                  CREATED          STATUS          PORTS                                                 NAMES
87f9453b56db   zabbix/zabbix-agent             "/sbin/tini -- /usr/…"   8 minutes ago    Up 8 minutes    10050/tcp                                             zabbix-agent
493d711f412f   zabbix/zabbix-web-nginx-mysql   "docker-entrypoint.sh"   9 minutes ago    Up 9 minutes    0.0.0.0:8080->8080/tcp, :::8080->8080/tcp, 8443/tcp   zabbix-web-nginx-mysql
e2ab514284af   zabbix/zabbix-server-mysql      "/sbin/tini -- /usr/…"   12 minutes ago   Up 12 minutes   0.0.0.0:10051->10051/tcp, :::10051->10051/tcp         zabbix-server-mysql
17511de57c96   zabbix/zabbix-java-gateway      "docker-entrypoint.s…"   13 minutes ago   Up 13 minutes   10052/tcp                                             zabbix-java-gateway
cfcdf969b2ab   mysql                           "docker-entrypoint.s…"   13 minutes ago   Up 13 minutes   3306/tcp, 33060/tcp                                   mysql-server

7. inspect 명령어로 Zabbix agent의 IP주소 확인하기

docker inspect zabbix-agent | grep "IPAddress\": "

  "IPAddress": "172.17.0.6",
                    "IPAddress": "172.17.0.6",

8. Zabbix 설정하기

  1. 좌측 메뉴 > Configuration > Hosts 열기

  2. Zabbix server 클릭

  3. ip를 zabbix agent의 ip 172.17.0.6 으로 변경 후 저장

  4. 잠시 후 초록색이면 정상

좋은 웹페이지 즐겨찾기