基于Redhat8.5 部署zabbix5.4

仓库配置

本地源配置

复制代码
mount /dev/sr0 /mnt    //先挂载


vim /etc/fatab    //编辑挂载文件 以便于开机自动挂载

/dev/sr0 /mnt iso9660 defaults 0 0


mount -a    


编辑yum 仓库   vim /etc/yum.repo.d/redhat.repo

[BaseOS]
name=baseos
baseurl=file:///mnt/BaseOS
gpgcheck=0

[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0
~           

编辑阿里云网络源 vim /etc/yum.repo.d/aliyun.repo

复制代码
[Zabbix]
name=zabbix
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.4/rhel/8/x86_64/
gpgcheck=0


yum makecache  //加载

安装zabbix5.4

复制代码
dnf install https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm 

查看软件包

复制代码
dnf list | grep ^zabbix

安装软件包

复制代码
yum install zabbix-web-mysql.noarch zabbix-apache-conf.noarch httpd zabbix-sql-scripts.noarch 
yum install zabbix-server-mysql.x86_6  mariadb zabbix-web-service.x86_64 -y

启动数据库

复制代码
systemctl enabled --now mariadb

登录数据库

复制代码
[root@localhost ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.28-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

创建zabbix 用户以及zabbix 数据库

复制代码
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by '123456';

导入zabbix 数据库

复制代码
cd /usr/share/doc/zabbix-sql-scripts/mysql/
zcat create.sql.gz | mysql -uzabbix -p123456 zabbix

查看数据库表

复制代码
[root@localhost yum.repos.d]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 17
Server version: 10.3.28-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use zabbix
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [zabbix]> show tables;

编辑配置文件

vim /etc/zabbix/zabbix_server.conf

复制代码
DBPassword=123456  //指定密码

vim /etc/php-fpm.d/zabbix.conf

复制代码
php_value[date.timezone] = Asia/shanghai   // 指定时区

启动服务

复制代码
systemctl enable --now httpd.service php-fpm.service zabbix-server.service zabbix-agent2.service  zabbix-web-service.service 

使用浏览器访问服务

检查是否全ok

相关推荐
ZKNOW甄知科技几秒前
ITR服务流全解析:从框架到治理的系统化指南
大数据·运维·人工智能·科技·低代码·用户运营·敏捷流程
墨倾许4 分钟前
从零搭建运维学习环境(2026):WSL + Docker + Git + VS Code 完全指南
运维·git·学习·docker·容器·bash
量子炒饭大师5 分钟前
【Linux系统编程】Cyberpunk在霓虹丛林中构建堡垒 ——【Linux环境配置 与 基础指令】
linux·运维·microsoft·linux指令
ALM专业人士9 分钟前
【ALM】Polarion Project Templating and Updating功能升级,多项目批量更新一键搞定!
运维·汽车
王琦03189 分钟前
第四章 Web服务器(1)
运维·服务器
jimy19 分钟前
Oracle的always free oci实例,standard em2.1.micro,保活脚本
服务器·oracle
LinuxGeek10249 分钟前
Linux 内核 “Copy Fail” 漏洞(CVE-2026-31431)修复方案
linux·运维·服务器
月白风清江有声12 分钟前
下载电影开字幕(不是实时的ployer)
linux·学习
minji...14 分钟前
Linux 网络基础(三)HTTP的请求方法(GET/POST),HTTP表单、临时和永久重定向状态码、Cookie、查询参数、Web根目录
linux·运维·服务器·网络·c++·http
小茬粥14 分钟前
COLT_CMDB_nvidia_gpu_20260508.sh
linux·服务器·windows