介绍地址:https://www.zabbix.com/documentation/current/en/manual/installation/containers
1.为 Zabbix 组件容器创建专用网络
docker network create --subnet 172.20.0.0/16 --ip-range 172.20.240.0/20 zabbix-net
2.启动空的MySQL服务器实例
docker run -p 3306:3306 \ --name mysql-server -t \ -v /etc/timezone:/etc/timezone \ -v /etc/localtime:/etc/localtime \ -v /mnt/mysql/conf:/etc/mysql/conf.d \ -v /mnt/mysql/logs:/logs \ -v /mnt/mysql/data:/var/lib/mysql \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ -e TZ=Asia/Shanghai \ --network=zabbix-net \ --restart unless-stopped \ -d mysql:8.0 \ --character-set-server=utf8 --collation-server=utf8_bin \ --default-authentication-plugin=mysql_native_password
3.启动Zabbix Java Gateway实例【可选,不监控jvm性能你跑什么跑】
docker run --name zabbix-java-gateway -t \ --network=zabbix-net \ --restart unless-stopped \ -d zabbix/zabbix-java-gateway:alpine-6.2-latest
4.启动Zabbix Server 实例并将该实例与创建的Mysql Server 实例链接
docker run --name zabbix-server-mysql -t \ -e DB_SERVER_HOST="mysql-server" \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ -e PHP_TZ="Asia/Shanghai" \ -e ZBX_JAVAGATEWAY="zabbix-java-gateway" \ //未启动Java Gateway可选 -v /etc/timezone:/etc/timezone \ -v /etc/localtime:/etc/localtime \ --network=zabbix-net \ -p 10051:10051 \ --restart unless-stopped \ -d zabbix/zabbix-server-mysql:alpine-6.2-latest
5.启动Zabbix Web界面并将实例与创建的Mysql Server和Zabbix Server实例链接
1.Nginx Web
docker run --name zabbix-web-nginx-mysql -t \ -e ZBX_SERVER_HOST="zabbix-server-mysql" \ -e DB_SERVER_HOST="mysql-server" \ -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ -e PHP_TZ="Asia/Shanghai" \ -v /etc/timezone:/etc/timezone \ -v /etc/localtime:/etc/localtime \ --network=zabbix-net \ -p 80:8080 \ --restart unless-stopped \ -d zabbix/zabbix-web-nginx-mysql:alpine-6.2-latest
2.Apache Web
docker run --name zabbix-web-apache-mysql -t \ -e ZBX_SERVER_HOST="zabbix-server-mysql" \ -e DB_SERVER_HOST="mysql-server" -e MYSQL_DATABASE="zabbix" \ -e MYSQL_USER="zabbix" \ -e MYSQL_PASSWORD="zabbix_pwd" \ -e MYSQL_ROOT_PASSWORD="root_pwd" \ -e PHP_TZ="Asia/Shanghai" \ -v /etc/timezone:/etc/timezone \ -v /etc/localtime:/etc/localtime \ --network=zabbix-net \ --restart unless-stopped \ -p 80:80 -d zabbix/zabbix-web-apache-mysql:alpine-6.2-latest
标签:etc,部署,MYSQL,Zabbix,server,--,zabbix,mysql,Docker From: https://www.cnblogs.com/fanqisoft/p/17051981.html