docker安装zabbix4.4.6
如果对运维课程感兴趣,可以在b站上搜索我的账号: 运维实战课程,可以关注我,学习更多免费的运维实战技术视频
1.规划:
192.168.171.128 mysql5.7 zabbix-server-mysql4.4 zabbix-web-apache4.4 zabbix-agent4.4
192.168.171.129 zabbix-agent4.4
192.168.171.130 zabbix-agent4.4
2.安装zabbix-server端:(在192.168.171.128上)
1)上传zabbix-server端相关镜像、配置文件和相关部署脚本的压缩包zabbix4.4.6.zip到/data目录
[root@localhost ~]# cd /data/
[root@localhost data]# ls zabbix4.4.6.zip
zabbix4.4.6.zip
[root@localhost data]# unzip zabbix4.4.6.zip
[root@localhost data]# ls
zabbix4.4.6 zabbix4.4.6.zip
[root@localhost data]# cd zabbix4.4.6
[root@localhost zabbix4.4.6]# ls
conf scripts zabbix4.4.6-images
[root@localhost zabbix4.4.6]# ls conf/
99-zabbix.ini httpd.conf my.cnf php.ini zabbix_agentd.conf zabbix.conf zabbix_server.conf
[root@localhost zabbix4.4.6]# ls scripts/
run_1_mysql.sh run_2_zabbix-server.sh run_3_zabbix-web.sh run_4_zabbix-agent.sh
[root@localhost zabbix4.4.6]# ls zabbix4.4.6-images/
mysql5.7.27.tar zabbix-agent-4.4.6.tar zabbix-server-mysql-4.4.6.tar zabbix-web-apache-mysql-4.4.6.tar
[root@localhost zabbix4.4.6]# cd zabbix4.4.6-images/
[root@localhost zabbix4.4.6-images]# ls
mysql5.7.27.tar zabbix-agent-4.4.6.tar zabbix-server-mysql-4.4.6.tar zabbix-web-apache-mysql-4.4.6.tar
[root@localhost zabbix4.4.6-images]# for i in `ls`;do docker load -i $i;done #导入镜像
[root@localhost zabbix4.4.6-images]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
zabbix/zabbix-agent latest 7658221988ba 18 hours ago 14.5MB
zabbix/zabbix-web-apache-mysql latest 766799691c3c 19 hours ago 133MB
zabbix/zabbix-server-mysql latest 42e8b8fa6acc 19 hours ago 64.7MB
mysql 5.7.27 383867b75fd2 5 months ago 373MB
[root@localhost zabbix4.4.6-images]# cd ..
[root@localhost zabbix4.4.6]# ls
conf scripts zabbix4.4.6-images
2)安装mysql5.7:
[root@localhost zabbix4.4.6]# cat conf/my.cnf
[client]
port=3306
default-character-set=utf8
[mysqld]
user=mysql
#datadir = /data/mysql/data
character_set_server=utf8
lower_case_table_names=1
server-id=1
gtid_mode=ON
enforce-gtid-consistency=ON
log_slave_updates=1
slow_query_log=ON
long_query_time=1
log-bin=mysql-bin
#log_error=/data/mysql/data/alert.log
innodb_buffer_pool_size=5000000000
max_connections=3000
expire_logs_days=20
[mysql]
default-character-set=utf8
[root@localhost zabbix4.4.6]# cat scripts/run_1_mysql.sh
#!/bin/bash
docker run -d --net=host --restart=always --name=mysql5.7.27 -v /etc/localtime:/etc/localtime -v /data/zabbix4.4.6/conf/my.cnf:/etc/my.cnf -v /data/m