zabbix基于docker安装
# zabbix5.0基于docker安装
# 1.安装Docker-MySQL
docker run --name mysql-server -t \
-v /etc/localtime:/etc/localtime:ro \
-e MYSQL_DATABASE="zabbix" \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="hadoop" \
-e MYSQL_ROOT_PASSWORD="hadoop" \
-d mysql:5.7 \
--character-set-server=utf8 --collation-server=utf8_bin
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# 2.安装Docker-Java Agent
docker run --name zabbix-java-gateway -t \
-v /etc/localtime:/etc/localtime:ro \
-d zabbix/zabbix-java-gateway:latest
1
2
3
2
3
# 3.安装Docker-Zabbix
docker run --name zabbix-server-mysql -t \
-e DB_SERVER_HOST="mysql-server" \
-e MYSQL_DATABASE="zabbix" \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="hadoop" \
-e MYSQL_ROOT_PASSWORD="hadoop" \
-e ZBX_JAVAGATEWAY="zabbix-java-gateway" \
--link mysql-server:mysql \
--link zabbix-java-gateway:zabbix-java-gateway \
-p 10051:10051 \
-v /etc/localtime:/etc/localtime:ro \
-d zabbix/zabbix-server-mysql:latest
1
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
# 4.安装Docker-Nginx
docker run --name zabbix-web-nginx-mysql -t \
-e DB_SERVER_HOST="mysql-server" \
-e MYSQL_DATABASE="zabbix" \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="hadoop" \
-e MYSQL_ROOT_PASSWORD="hadoop" \
--link mysql-server:mysql \
--link zabbix-server-mysql:zabbix-server \
-p 80:8080 \
-v /etc/localtime:/etc/localtime:ro \
-d zabbix/zabbix-web-nginx-mysql:latest
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
这时候访问IP:80应该能打开zabbix的登录页面,账号密码分别是Admin:zabbix