Zabbix容器版安装

Posted Tenyearsme

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Zabbix容器版安装相关的知识,希望对你有一定的参考价值。

Zabbix安装

官方文档 : https://www.zabbix.com/cn/download

中文字体乱码

上传 字体文件到 /usr/share/fonts 重命名为:DejaVuSans.ttf

容器版安装

docker-compose.yml 文件内容如下

version: "3.8"
services:
  mysql-server:
    image: mysql:8.0
    container_name: mysql-server
    restart: always
    environment:
      MYSQL_DATABASE: zabbix
      MYSQL_USER: zabbix
      MYSQL_PASSWORD: 123456qaz!@#
      MYSQL_ROOT_PASSWORD: 123456qaz!@#
    command:
      - --character-set-server=utf8
      - --collation-server=utf8_bin
      - --default-authentication-plugin=mysql_native_password
    networks:
      - zabbix-net
    volumes:
      - "/root/zabbix/mysqldata:/var/lib/mysql"
      - "/etc/localtime:/etc/localtime"
    ports:
      - "3306:3306"

  zabbix-java-gateway:
    image: zabbix/zabbix-java-gateway
    container_name: zabbix-java-gateway
    volumes:
      - "/etc/localtime:/etc/localtime"
    ports:
      - "10052:10052"
    restart: always
    networks:
      - zabbix-net

  zabbix-server-mysql:
    image: zabbix/zabbix-server-mysql
    container_name: zabbix-server-mysql
    networks:
      - zabbix-net
    restart: always
    depends_on:
      - mysql-server
    environment:
      DB_SERVER_HOST: mysql-server
      MYSQL_DATABASE: zabbix
      MYSQL_USER: zabbix
      MYSQL_PASSWORD: 123456qaz!@#
      MYSQL_ROOT_PASSWORD: 123456qaz!@#
      ZBX_JAVAGATEWAY: zabbix-java-gateway
      ZBX_JAVAGATEWAY_ENABLE: "true"
    ports:
      - "10051:10051"
    volumes:
      - "/etc/localtime:/etc/localtime"
      - "/root/zabbix/alertscripts:/usr/lib/zabbix/alertscripts"
      - "/root/zabbix/externalscripts:/usr/lib/zabbix/externalscripts"
    links:
      - mysql-server:mysql
      - zabbix-java-gateway:zabbix-java-gateway

  zabbix-web-nginx-mysql:
    image: zabbix/zabbix-web-nginx-mysql
    container_name: zabbix-web-nginx-mysql
    networks:
      - zabbix-net
    restart: always
    depends_on:
      - mysql-server
      - zabbix-server-mysql
    environment:
      DB_SERVER_HOST: mysql-server
      MYSQL_DATABASE: zabbix
      MYSQL_USER: zabbix
      MYSQL_PASSWORD: 123456qaz!@#
      MYSQL_ROOT_PASSWORD: 123456qaz!@#
      ZBX_SERVER_HOST: zabbix-server
      php_TZ: "Asia/Shanghai"
    ports:
      - "8080:8080"
    volumes:
      - "/etc/localtime:/etc/localtime"
      - "/usr/share/fonts/:/usr/share/zabbix/assets/fonts/"
    links:
      - mysql-server:mysql
      - zabbix-server-mysql:zabbix-server

  zabbix-agent:
    image: zabbix/zabbix-agent
    container_name: zabbix-agent
    restart: always
    privileged: true
    environment:
      ZBX_HOSTNAME: "Zabbix server"
      ZBX_SERVER_HOST: "172.18.0.1"
      ZBX_SERVER_PORT: 10051
    ports:
      - "10050:10050"
    volumes:
      - "/etc/localtime:/etc/localtime"
    networks:
      - zabbix-net

networks:
  zabbix-net:
    ipam:
      driver: default
      config:
        - subnet: "172.18.0.0/16"

以上是关于Zabbix容器版安装的主要内容,如果未能解决你的问题,请参考以下文章

Zabbix容器版安装

Zabbix容器版安装

安装window 版zabbix-agent

Zabbix3.0版Graphtree的安装配置

zabbix6.0安装教程:从容器中安装

zabbix6.0安装教程:从容器中安装