`
liunancun
  • 浏览: 33942 次
社区版块
存档分类
最新评论

Docker安装Zabbix

 
阅读更多
docker run -d -p 3306:3306 -e MYSQL_DATABASE="bessky_zabbix" -e MYSQL_USER="bessky_zabbix" -e MYSQL_PASSWORD="123456" -e MYSQL_ROOT_PASSWORD="123456" --name zabbix_mysql mysql:8.0.28 --character-set-server=utf8 --collation-server=utf8_bin --default-authentication-plugin=mysql_native_password

docker run -d -p 10052:10052 --name zabbix_java_gateway zabbix/zabbix-java-gateway

docker run -d -p 10051:10051 -e DB_SERVER_HOST="192.168.99.208" -e MYSQL_DATABASE="bessky_zabbix" -e MYSQL_USER="bessky_zabbix" -e MYSQL_PASSWORD="123456" -e MYSQL_ROOT_PASSWORD="123456" -e ZBX_JAVAGATEWAY="192.168.99.208" --name zabbix_server_mysql zabbix/zabbix-server-mysql

docker run -d -p 8080:8080 -e ZBX_SERVER_HOST="192.168.99.208" -e DB_SERVER_HOST="192.168.99.208" -e MYSQL_DATABASE="bessky_zabbix" -e MYSQL_USER="bessky_zabbix" -e MYSQL_PASSWORD="123456" -e MYSQL_ROOT_PASSWORD="123456" --name zabbix_web_nginx_mysql zabbix/zabbix-web-nginx-mysql

替换字体
docker run -d -p 8080:8080 -v /usr/share/fonts:/usr/share/zabbix/assets/fonts -e ZBX_SERVER_HOST="192.168.99.208" -e DB_SERVER_HOST="192.168.99.208" -e MYSQL_DATABASE="bessky_zabbix" -e MYSQL_USER="bessky_zabbix" -e MYSQL_PASSWORD="123456" -e MYSQL_ROOT_PASSWORD="123456" --name zabbix_web_nginx_mysql zabbix/zabbix-web-nginx-mysql

docker run -d -p 10050:10050 -e ZBX_HOSTNAME="192.168.99.208" -e ZBX_SERVER_HOST="0.0.0.0/0" -e ZBX_ACTIVE_ALLOW=false --name zabbix_agent --privileged zabbix/zabbix-agent

本地网络
docker run -d --net host -e ZBX_HOSTNAME="23.228.89.34" -e ZBX_SERVER_HOST="0.0.0.0/0" -e ZBX_ACTIVE_ALLOW=false --name zabbix_agent --privileged zabbix/zabbix-agent

services:
  zabbix_mysql:
    image: mysql:8.0.32
    container_name: zabbix_mysql
    environment:
      - MYSQL_DATABASE=bessky_zabbix
      - MYSQL_USER=bessky_zabbix
      - MYSQL_PASSWORD=123456
      - MYSQL_ROOT_PASSWORD=123456
      - TZ=Asia/Shanghai
    volumes:
      - /home/data/zabbix/mysql:/var/lib/mysql
    command:
      --character-set-server=utf8
      --collation-server=utf8_bin
      --default-authentication-plugin=mysql_native_password
    ports:
      - 3306:3306
  zabbix_java_gateway:
    image: zabbix/zabbix-java-gateway
    container_name: zabbix_java_gateway
    volumes:
      - /etc/localtime:/etc/localtime
  zabbix_server_mysql:
    image: zabbix/zabbix-server-mysql
    container_name: zabbix_server_mysql
    environment:
      - DB_SERVER_HOST=192.168.99.182
      - MYSQL_DATABASE=bessky_zabbix
      - MYSQL_USER=bessky_zabbix
      - MYSQL_PASSWORD=123456
      - MYSQL_ROOT_PASSWORD=123456
      - ZBX_JAVAGATEWAY=192.168.99.182
      - TZ=Asia/Shanghai
    ports:
      - 10051:10051
    depends_on:
      - zabbix_mysql
  zabbix_web_nginx_mysql:
    image: zabbix/zabbix-web-nginx-mysql
    container_name: zabbix_web_nginx_mysql
    environment:
      - ZBX_SERVER_HOST=192.168.99.182
      - DB_SERVER_HOST=192.168.99.182
      - MYSQL_DATABASE=bessky_zabbix
      - MYSQL_USER=bessky_zabbix
      - MYSQL_PASSWORD=123456
      - MYSQL_ROOT_PASSWORD=123456
      - PHP_TZ=Asia/Shanghai
    volumes:
      - /etc/localtime:/etc/localtime
      - /usr/share/fonts:/usr/share/zabbix/assets/fonts
    ports:
      - 8080:8080
    depends_on:
      - zabbix_mysql
  zabbix_agent2:
    image: zabbix/zabbix-agent2
    container_name: zabbix_agent2
    environment:
      - ZBX_HOSTNAME=192.168.99.182
      - ZBX_SERVER_HOST=0.0.0.0/0
      - ZBX_ACTIVE_ALLOW=false
      - TZ=Asia/Shanghai
    ports:
      - 10050:10050
    depends_on:
      - zabbix_server_mysql
    privileged: true


解决中文乱码
/usr/share/fonts:/usr/share/zabbix/assets/fonts
将中文字体文件 DejaVuSans.ttf 放置到 /usr/share/fonts 目录

默认账号密码
Admin/zabbix

本地安装zabbix-agent2
rpm -Uvh https://repo.zabbix.com/zabbix/6.0/rhel/7/x86_64/zabbix-release-6.0-4.el7.noarch.rpm
yum clean all
yum install zabbix-agent2 zabbix-agent2-plugin-*
systemctl restart zabbix-agent2
systemctl enable zabbix-agent2
vi /etc/zabbix/zabbix_agent2.conf
将Server=127.0.0.1改为Server=0.0.0.0/0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics