docker用docker-compose快速搭建zabbix最新版
Posted the丶only
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了docker用docker-compose快速搭建zabbix最新版相关的知识,希望对你有一定的参考价值。
扩展文章:zabbix通过自定义脚本监控docker服务,容器
编写docker-compose.yml文件
根据需求更改自己的配置,这里配置mysql为5.7版本,其他版本默认为最新的。由于80已被占用,这里为8088端口登录。
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:
- /data/mysql:/var/lib/mysql
- /etc/localtime:/etc/localtime
- /etc/timezone:/etc/timezone
zabbix-server-mysql:
image: zabbix/zabbix-server-mysql: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: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:
- 8088: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:
运行docker
docker-compose up -d
运行成功后,浏览器输入,192.168.152.132:8088 即可访问。
默认账号:Admin 密码:zabbix
以上是关于docker用docker-compose快速搭建zabbix最新版的主要内容,如果未能解决你的问题,请参考以下文章
13docker-compose快速构建搭建wordpress
利用Docker-Compose快速搭建个人博客(5分钟简单操作)
halo搭建炫酷个人博客快速部署:docker+docker-compose+nginx
docker-compose快速搭建lnmp+redis服务器环境