51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

使用docker-compose部署zabbix 案例

1.安装git工具
[root@centos202 demo05]# yum -y install git

	2.拉取代码
[root@centos202 demo05]# git clone https://github.com/zabbix/zabbix-docker.git
[root@centos202 demo05]# 
[root@centos202 demo05]# git clone https://hub.nuaa.cf/zabbix/zabbix-docker.git  # 备用


	3.部署zabbix
[root@centos202 demo05]# ll
total 4
drwxr-xr-x 6 root root 4096 Jun 12 12:49 zabbix-docker
[root@centos202 demo05]# cd zabbix-docker/
[root@centos202 zabbix-docker]# docker-compose -f ./docker-compose_v3_alpine_mysql_latest.yaml up -d

自定义部署zabbix
cat docker-compose.yml

version: '3.3'

services:
   mysql-server:
     image: mysql:8.0
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: root_pwd
       MYSQL_DATABASE: zabbix
       MYSQL_USER: zabbix
       MYSQL_PASSWORD: zabbix_pwd
     networks:
       - zabbix-net
     command: ["--character-set-server=utf8", "--collation-server=utf8_bin", "--default-authentication-plugin=mysql_native_password"]
     
   zabbix-java-gateway:
     image: zabbix/zabbix-java-gateway:alpine-5.4-latest
     restart: always
     networks:
       - zabbix-net
     
   zabbix-server:
     depends_on:
       - mysql-server
     image: zabbix/zabbix-server-mysql:alpine-5.4-latest
     restart: always
     environment:
       DB_SERVER_HOST: mysql-server
       MYSQL_DATABASE: zabbix
       MYSQL_USER: zabbix
       MYSQL_PASSWORD: zabbix_pwd
       MYSQL_ROOT_PASSWORD: root_pwd
       ZBX_JAVAGATEWAY: zabbix-java-gateway
     networks:
       - zabbix-net
     ports:
       - "10051:10051"
       
   zabbix-web-nginx-mysql:
     depends_on:
       - zabbix-server
     image: zabbix/zabbix-web-nginx-mysql:alpine-5.4-latest
     ports:
       - "80:8080"
     restart: always
     environment:
       DB_SERVER_HOST: mysql-server
       MYSQL_DATABASE: zabbix
       MYSQL_USER: zabbix
       MYSQL_PASSWORD: zabbix_pwd
       MYSQL_ROOT_PASSWORD: root_pwd
     networks:
       - zabbix-net

networks:
    zabbix-net:
       # name: baimei-zabbix  # 官方是3.5版本才支持的.但yum安装的话是1.18.0的docker-compose,最高支持3.3版本哟~
       ipam:
         driver: default
         config:
           - subnet: 172.30.100.0/24
             # gateway: 172.30.100.254  # 对于gateway参数目前仅有"version 2"才支持哟~
       labels:
         school.baimei.com: "白眉大叔"
         class.baimei.com: "Linux86"
         auther.baimei.com: "baimei-linux"
赞(6)
未经允许不得转载:工具盒子 » 使用docker-compose部署zabbix 案例