好几年没有看过zabbix,上次用的时候还是zabbix3.4,现在都zabbix5.2版本了,学习一下新功能
官方文档
https://www.zabbix.com/documentation/current/manual/installation/containers
系统版本
[root@centos8 ~]# cat /etc/redhat-release
CentOS Linux release 8.1.1911 (Core)
一,Docker安装,参考如下
https://blog.csdn.net/tongzidane/article/details/114288781
二,部署zabbix5.2
Docker方式安装Zabbix 5.2
镜像拉取
##拉取mysql镜像
docker pull mariadb
[root@centos8 ~]# docker pull mariadb
Using default tag: latest
latest: Pulling from library/mariadb
345e3491a907: Pull complete
57671312ef6f: Pull complete
5e9250ddb7d0: Pull complete
2d512e2ff778: Pull complete
57c1a7dc2af9: Pull complete
5f1da40ab8a2: Pull complete
5d5cfc668726: Pull complete
deb86f297614: Pull complete
6861f77e80d5: Pull complete
81a5dea1514d: Pull complete
e3b5cf124c10: Pull complete
3352c2c9d21c: Pull complete
Digest: sha256:36288c675a192bd0a8a99cd6ba0780e31df85f0bfd0cbb204837cd108be3d236
Status: Downloaded newer image for mariadb:latest
docker.io/library/mariadb:latest
[root@centos8 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mariadb latest 992bce5ed710 2 weeks ago 401MB
##拉取zabbix-server-mysql镜像
docker pull zabbix/zabbix-server-mysql:latest
[root@centos8 ~]# docker pull zabbix/zabbix-server-mysql:latest
latest: Pulling from zabbix/zabbix-server-mysql
339de151aab4: Pull complete
f631b1b5e31a: Pull complete
9c555ae5b032: Pull complete
ac80e4490b6c: Pull complete
Digest: sha256:6bec8592526f43d54db144b148d45685eabc12d51d1fa515d1b735ce34e4694b
Status: Downloaded newer image for zabbix/zabbix-server-mysql:latest
docker.io/zabbix/zabbix-server-mysql:latest
[root@centos8 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
zabbix/zabbix-server-mysql latest ba1175483a3d 10 days ago 67.3MB
##拉取zabbix-web-nginx-mysql镜像
docker pull zabbix/zabbix-web-nginx-mysql:latest
[root@centos8 ~]# docker pull zabbix/zabbix-web-nginx-mysql:latest
latest: Pulling from zabbix/zabbix-web-nginx-mysql
339de151aab4: Already exists
782ecaf67b99: Pull complete
7e87601c45c6: Pull complete
415b40336497: Pull complete
ca1ec5ade9b4: Pull complete
Digest: sha256:c9928b41b4c2798bf27267e44bc9b9a8019e5c12628c14443c179e8aaee6792b
Status: Downloaded newer image for zabbix/zabbix-web-nginx-mysql:latest
docker.io/zabbix/zabbix-web-nginx-mysql:latest
[root@centos8 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
zabbix/zabbix-web-nginx-mysql latest e4182c95f636 10 days ago 164MB
##拉取zabb镜像ix/zabbix-java-gateway
docker pull zabbix/zabbix-java-gateway:latest
[root@centos8 ~]# docker pull zabbix/zabbix-java-gateway:latest
latest: Pulling from zabbix/zabbix-java-gateway
339de151aab4: Already exists
2884aa2ef96a: Pull complete
022bb4435248: Pull complete
929378030ac2: Pull complete
a02efb8a4605: Pull complete
71479db6efd8: Pull complete
Digest: sha256:cf8fe0237cf14c35f86b6f1d3c3d7993067fc8dabff4a33c1ffa8d63568e8588
Status: Downloaded newer image for zabbix/zabbix-java-gateway:latest
docker.io/zabbix/zabbix-java-gateway:latest
[root@centos8 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
zabbix/zabbix-java-gateway latest 2a453b9e8ba2 10 days ago 83.6MB
##拉取zabbix/zabbix-agent镜像
docker pull zabbix/zabbix-agent:latest
Docker安装Mariadb
docker run -itd --name zabbix-mysql \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="mariadb@0509" \
-e MYSQL_ROOT_PASSWORD="mariadb@0509" \
-v /www/server/zabbix/mysql/data/:/var/lib/mysql/ \
-p 3307:3306 \
mariadb \
--character-set-server=utf8 \
--collation-server=utf8_unicode_ci
Docker安装Zabbix-Server
docker run -itd --name "zabbix-server" \
--link zabbix-mysql:mysql \
-e DB_SERVER_HOST="172.17.0.1" \
-e DB_SERVER_PORT=3307 \
-e MYSQL_DATABASE="zabbix" \
-e MYSQL_ROOT_PASSWORD="mariadb@0509" \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="mariadb@0509" \
-v /www/server/zabbix/zabbix-server/alertscripts/:/usr/lib/zabbix/alertscripts/ \
-v /www/server/zabbix/zabbix-server/externalscripts/:/usr/lib/zabbix/externalscripts/ \
-p 10051:10051 \
zabbix/zabbix-server-mysql
Docker安装Zabbix-Web-Nginx-Mysql
docker run -itd --name zabbix-web \
--link zabbix-mysql:mysql \
--link zabbix-server:zabbix-server \
-e DB_SERVER_HOST=172.17.0.1 \
-e DB_SERVER_PORT=3307 \
-e MYSQL_USER=zabbix \
-e MYSQL_PASSWORD=mariadb@0509 \
-e MYSQL_DATABASE=zabbix \
-e ZBX_SERVER_HOST=zabbix-server \
-e PHP_TZ="Asia/Shanghai" \
-p 8880:8080 \
-p 8443:8443 \
zabbix/zabbix-web-nginx-mysql
登录管理界面
http://192.168.43.150:8880/
User: Admin
Passwd: zabbix
登录后的页面展示