一、关闭防火墙:
systemctl stop firewalld.service #停止firewalld服务
systemctl disable firewalld.service #设置开机默认不启动
二、关闭selinux:
getenforce #查看状态
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
三、安装docker:
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo(阿里仓库)
yum install docker-ce
systemctl start docker
systemctl enable docker
四、开始部署各部件:
1.mysql
docker run --name mysql-server -t \
-e MYSQL_DATABASE="zabbix" \
-e MYSQL_USER="zabbix" \
-e MYSQL_PASSWORD="zabbix" \
-e MYSQL_ROOT_PASSWORD="zabbix" \
-d mysql:5.7 --character-set-server=utf8 --collation-server=utf8_bin
2.zabbix-web-nginx-mysql
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="zabbix" \
-e MYSQL_ROOT_PASSWORD="zabbix" \
-e PHP_TZ="Asia/Shanghai" \
--link mysql-server:mysql \
--link zabbix-server-mysql:zabbix-server \
-p 2121:2020 \
--restart unless-stopped \
-d zabbix/zabbix-web-nginx-mysql:centos-5.0.0
3.zabbix-server-mysql
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" \
-e MYSQL_ROOT_PASSWORD="zabbix" \
-e ZBX_JAVAGATEWAY="zabbix-java-gateway" \
--link mysql-server:mysql \
--link zabbix-java-gateway:zabbix-java-gateway \
-p 10051:10051 \
--restart unless-stopped \
-d zabbix/zabbix-server-mysql:centos-5.0.0
4.zabbix-agent
docker run --name zabbix-agent --link zabbix-server-mysql:zabbix-server-mysql -e ZBX_SERVER_HOST="zabbix-server-mysql" -e ZBX_SERVER_PORT=10051 -e ZBX_HOSTNAME="zabbix_agent" -p 10050:10050 -d zabbix/zabbix-agent:centos-5.0.0
5.zabbix-java-gateway
docker run --name zabbix-java-gateway -t --restart unless-stopped -d zabbix/zabbix-java-gateway:centos-5.0.0
五、性能优化:
StartPollers=20
StartPollersUnreachable=20
StartIPMIPollers=10
StartTrappers=20
StartPingers=10
StartDiscoverers=20
StartHTTPPollers=10
VMwareCacheSize=64M
CacheSize=1024M
StartDBSyncers=16
HistoryCacheSize=256M
HistoryIndexCacheSize=32M
TrendCacheSize=64M
LogSlowQueries=3000
六、中文问题:
cat /usr/share/zabbix/include/defines.inc.php|grep fonts
目录有了变化,在目录/usr/share/zabbix/assets/fonts/放入字体文件simkai.ttf,把名字换为DejaVuSans.ttf
网友评论