zabbix监控4.4升级至5.0的详细教程

软件发布|下载排行|最新软件

当前位置:首页IT学院IT技术

zabbix监控4.4升级至5.0的详细教程

常来北京   2020-07-27 我要评论

本文着重讲解了zabbix监控4.4升级至5.0的详细教程,本文为大家做详细介绍,希望能够帮助到您,欢迎大家阅读和收藏

1.ZABBIX备份

[root@iZ2zeapnvuohe8p14289u6Z /]# mkdir -p /soft/zabbixback/zabbix-backup
 
[root@iZ2zeapnvuohe8p14289u6Z /]# cp /etc/zabbix/zabbix_server.conf   /soft/zabbixback/zabbix-backup
 
[root@iZ2zeapnvuohe8p14289u6Z /]# cp /etc/zabbix/zabbix_agentd.conf  /soft/zabbixback/zabbix-backup
 
[root@iZ2zeapnvuohe8p14289u6Z /]# cp /etc/zabbix/web/zabbix.conf.php /soft/zabbixback/zabbix-backup
 
[root@iZ2zeapnvuohe8p14289u6Z /]# cp -R /usr/share/zabbix/  /soft/zabbixback/zabbix-backup
 
[root@iZ2zeapnvuohe8p14289u6Z /]# cp –R /usr/share/doc/zabbix-* /soft/zabbixback/zabbix-backup 

2. MariaDB数据库备份

[root@iZ2zeapnvuohe8p14289u6Z /]# mysql # 进入mysql
 
MariaDB [(none)]> select count(8) tables,table_schema from information_schema.tables where table_schema = 'zabbix';
+--------+--------------+
| tables | table_schema |
+--------+--------------+
| 166 | zabbix |
+--------+--------------+
1 row in set (0.00 sec)
 
MariaDB [(none)]> mysqldump -uzabbix -pzabbix --opt --skip-lock-tables zabbix | gzip > /home/backup/zabbix_$(date +%Y%m%d_%H%M%S).sql.gz
 
[root@iZ2zeapnvuohe8p14289u6Z /]# ll /soft/zabbixback
 
总用量 5120
 
-rw-r--r-- 1 root root   20 7月 23 10:48 zabbix_20200726_104832.sql.gz
 
-rw-r--r-- 1 root root 526 7月 23 10:48 zabbix_20200726_104849.sql.gz
 
drwxr-xr-x 3 root root  96 7月 23 10:45 zabbix-backup<br data-filtered="filtered"><br data-filtered="filtered">

3. 停止 zabbix-server,zabbix-agent

[root@iZ2zeapnvuohe8p14289u6Z /]# systemctl stop zabbix-agent zabbix-server

4.卸载旧版本4.4

[root@iZ2zeapnvuohe8p14289u6Z /]# yum remove zabbix-web-* httpd

5. 4.4升级5.0

[root@iZ2zeapnvuohe8p14289u6Z /]# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
 
[root@iZ2zeapnvuohe8p14289u6Z /]# yum clean all
 
[root@iZ2zeapnvuohe8p14289u6Z /]# yum update zabbix-server zabbix-agent -y
 
[root@iZ2zeapnvuohe8p14289u6Z /]# yum-config-manager --enable rhel-server-rhscl-7-rpms

6.编辑zabbix.repo文件

[root@iZ2zeapnvuohe8p14289u6Z /]# vim /etc/yum.repos.d/zabbix.repo

7.安装zabbix前端包

[root@iZ2zeapnvuohe8p14289u6Z /]# yum install zabbix-web-mysql-scl zabbix-apache-conf-scl -y

8.Zabbix前端PHP配置

[root@iZ2zeapnvuohe8p14289u6Z /]# vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

9.启动zabbix的server和agent、并设置为开机启动

[root@iZ2zeapnvuohe8p14289u6Z /]# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
[root@iZ2zeapnvuohe8p14289u6Z /]# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm

Copyright 2022 版权所有 软件发布 访问手机版

声明:所有软件和文章来自软件开发商或者作者 如有异议 请与本站联系 联系我们