zabbix-docker安装
Posted lazy-sang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了zabbix-docker安装相关的知识,希望对你有一定的参考价值。
创建目录/data/zabbix
新建docker-compose.yml文件,执行docker-compose up -d
version: ‘3‘
services:
zabbix_mysql:
container_name: "zabbix_mysql"
restart: "always"
image: mariadb
ports:
- "3306:3306"
volumes:
- /data/docker/mysql-data:/var/lib/mysql
- /etc/localtime:/etc/localtime
environment:
MYSQL_ROOT_PASSWORD: "mysqlpss123"
MYSQL_USER: "zabbix"
MYSQL_PASSWORD: "mysqlpss123"
MYSQL_DATABASE: "zabbix"
zabbix_server:
container_name: "zabbix_server"
restart: "always"
image: zabbix/zabbix-server-mysql
ports:
- "10051:10051"
volumes:
- /etc/localtime:/etc/localtime:ro
- /data/docker/zabbix:/usr/lib/zabbix
- /etc/localtime:/etc/localtime
depends_on:
- zabbix_mysql
links:
- zabbix_mysql:mysql
environment:
DB_SERVER_HOST: "mysql"
MYSQL_USER: "zabbix"
MYSQL_DATABASE: "zabbix"
MYSQL_PASSWORD: "mysqlpss123"
zabbix_nginx_web:
container_name: "zabbix_nginx_web"
restart: "always"
image: zabbix/zabbix-web-nginx-mysql
ports:
- "8443:443"
- "10000:8080"
volumes:
- /etc/localtime:/etc/localtime
depends_on:
- zabbix_mysql
- zabbix_server
links:
- zabbix_mysql:mysql
- zabbix_server:zabbix_server
environment:
DB_SERVER_HOST: "mysql"
MYSQL_USER: "zabbix"
MYSQL_PASSWORD: "mysqlpss123"
MYSQL_DATABASE: "zabbix"
ZBX_SERVER_HOST: "zabbix_server"
php_TZ: "Asia/Shanghai"
zabbix-agent-a:
image: zabbix/zabbix-agent
links:
- zabbix_server:zabbix_server
container_name: zabbix-agent-a
restart: always
volumes:
- /etc/localtime:/etc/localtime
depends_on:
- zabbix_server
environment:
- ZBX_HOSTNAME=zabbix-agent-a
- ZBX_SERVER_HOST=zabbix_server
以上是关于zabbix-docker安装的主要内容,如果未能解决你的问题,请参考以下文章
shell bash如何判断docker是否安装(检测docker安装检查docker安装docker版本)