部署Zabbix4.0

场景:生产环境部署zabbix监控

部署过程

1. 官方安装文档

https://www.zabbix.com/download?zabbix=4.0&os_distribution=centos&os_version=6&db=MySQL

2. 选择合适的rpm源,注意区分版本

选择rpm源

3. 安装rpm源
# rpm -i https://repo.zabbix.com/zabbix/4.0/rhel/6/x86_64/zabbix-release-4.0-1.el6.noarch.rpm
4.安装数据库文件、前端、agent
# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
5.安装及配置数据库

(1)安装Mysql5.7的yum源

# wget https://dev.mysql.com/get/mysql80-community-release-el6-1.noarch.rpm
# rpm -ivh /opt/mysql80-community-release-el6-1.noarch.rpm  

(2)修改配置文件
修改mysql-community.repo的mysql57-community段中,将enabled=0改成enabled=1

# vim /etc/yum.repos.d/mysql-community.repo
# Enable to use MySQL 5.7
[mysql57-community]
name=MySQL 5.7 Community Server
baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/6/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql

(3)安装mysql

# yum install mysql-community-server

(4)启动mysql

# /etc/init.d/mysqld start

(5)mysql会分配随机密码,需要查看默认密码并进行修改才能正常使用,否则登录mysql运行任何命令都会提示"You must reset your password using ALTER USER statement before executing this statement."

# grep password /var/log/mysqld.log
2018-12-12T02:59:05.242383Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: VheTj&HWk372

初始密码:VheTj&HWk372

# mysql -uroot -p

(6)添加zabbix用户、调整用户验证模式、授权

mysql> alter user 'root'@'localhost' identified by '123456';
mysql> create user 'zabbix'@'localhost' identified by 'Zabbix@123';
mysql> ALTER USER 'zabbix'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Zabbix@123';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> flush privileges;
6.启动zabbix-server
# service zabbix-server start

完成
大功告成

7.登录

地址:http://xx.xx.xx.xx/
默认用户密码:Admin/zabbix

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值