链接:CentOS 7 安装docker及docker-compose

使用docker-compose安装zabbix-server
version: "3"
services:
  mysql-server:
    image: mysql:5.7
    container_name: mysql-server
    command: --character-set-server=utf8  --interactive_timeout=120 --wait_timeout=120 --log_warnings=1  --collation-server=utf8_bin --sql_mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION --lower_case_table_names=1
    restart: always 
    environment:
      - MYSQL_DATABASE=zabbix
      - MYSQL_USER=zabbix
      - MYSQL_PASSWORD=zabbix
      - MYSQL_ROOT_PASSWORD=zabbix
    ports:
      - 3306:3306
    volumes:
      - ./zabbix-mysql:/var/lib/mysql
      - /etc/localtime:/etc/localtime
      - /etc/timezone:/etc/timezone
  zabbix-server-mysql:
    image: zabbix/zabbix-server-mysql:centos-5.0-latest
    container_name: zabbix-server-mysql
    ulimits:
       nproc: 65535
       nofile:
        soft: 20000
        hard: 40000
    privileged: true
    cap_add: 
     - ALL
    restart: always
    environment:
      - DB_SERVER_HOST=mysql-server
      - MYSQL_USER=zabbix
      - ZBX_CACHESIZE=4096M
      - MYSQL_PASSWORD=zabbix
      - MYSQL_DATABASE=zabbix
      - MYSQL_ROOT_PASSWORD=zabbix
    ports:
      - 10051:10051
    sysctls:
     - net.ipv4.ip_local_port_range=1024 65000
     - net.ipv4.conf.all.accept_redirects=0
     - net.ipv4.conf.all.secure_redirects=0
     - net.ipv4.conf.all.send_redirects=0
    links:
      - mysql-server:mysql
    depends_on:
      - mysql-server
    volumes:
      - /etc/localtime:/etc/localtime
      - /etc/timezone:/etc/timezone
      - zabbix-server-conf:/etc/zabbix
      - zabbix-server-alertscripts:/usr/lib/zabbix/alertscripts
​
  zabbix-web:
    image: zabbix/zabbix-web-nginx-mysql:centos-5.0-latest
    environment:
      - DB_SERVER_HOST=mysql-server
      - MYSQL_USER=zabbix
      - PHP_TZ=Asia/Shanghai
      - MYSQL_PASSWORD=zabbix
      - MYSQL_DATABASE=zabbix
      - MYSQL_ROOT_PASSWORD=zabbix
    restart: always
    ports:
      - 80:8080
    volumes:
      - /etc/localtime:/etc/localtime
      - /etc/timezone:/etc/timezone
    links:
      - mysql-server:mysql
      - zabbix-server-mysql:zabbix-server
    depends_on:
      - mysql-server
      - zabbix-server-mysql
  zabbix-agent:
    image: zabbix/zabbix-agent
    privileged: true
    restart: always
    cap_add: 
    - ALL
    volumes:
     - /etc/timezone:/etc/timezone
    environment:
      ZBX_SERVER_HOST: zabbix-server-mysql
    ports:
      - '10050:10050'
volumes:
  zabbix-server-conf:
  zabbix-server-alertscripts:

更多请参考官方gtihub:https://github.com/zabbix/zabbix-docker

配置zabbix安装源
rpm -Uvh rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all
yum makecache

官网提供地址: https://www.zabbix.com/download

安装zabbix-agent
yum install zabbix-agent2
字体问题处理

进入挂在的字体目录直接下载(这里笔者使用的是黑体字库)

curl -o DejaVuSans.ttf https://www.xxshell.com/download/sh/zabbix/ttf/msyh.ttf
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐