redhat 9 安装zabbix server pgsql

redhat 9 安装zabbix server pgsql

安装zabbix server pgsql

先安装zabbixs server 所需的红帽依赖包

sh 复制代码
  dnf install -y --downloadonly --downloaddir=/home/offline-zabbix7-pg15 nginx php-fpm php-cli

安装rpm包

下载下列的rpm包:zabbix-server pgsql fping
sh 复制代码
# fping
    https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/Packages/f/fping-5.0-4.el9.x86_64.rpm
## postgresql
    https://download.postgresql.org/pub/repos/yum/15/redhat/rhel-9-x86_64/postgresql15-15.7-1PGDG.rhel9.x86_64.rpm
    https://download.postgresql.org/pub/repos/yum/15/redhat/rhel-9-x86_64/postgresql15-contrib-15.7-1PGDG.rhel9.x86_64.rpm
    https://download.postgresql.org/pub/repos/yum/15/redhat/rhel-9-x86_64/postgresql15-libs-15.7-1PGDG.rhel9.x86_64.rpm
    https://download.postgresql.org/pub/repos/yum/15/redhat/rhel-9-x86_64/postgresql15-server-15.7-1PGDG.rhel9.x86_64.rpm

# zabbix
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-web-pgsql-7.0.26-release1.el9.noarch.rpm
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix_agent2-7.0.26-windows-amd64-openssl.msi
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-agent2-7.0.26-release1.el9.x86_64.rpm
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-nginx-conf-7.0.26-release1.el9.noarch.rpm
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-selinux-policy-7.0.26-release1.el9.x86_64.rpm
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-server-pgsql-7.0.26-release1.el9.x86_64.rpm
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-sql-scripts-7.0.26-release1.el9.noarch.rpm
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-web-7.0.26-release1.el9.noarch.rpm
    https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-web-deps-7.0.26-release1.el9.noarch.rpm
将刚刚下载的rpm包上传到服务器/home/offline-zabbix7-pg15
执行下面的命令安装

服务器会自动完成安装

sh 复制代码
dnf install -y *.rpm 

安装数据库,zabbix-server数据初始化

下面一行行执行

sh 复制代码
# 初始化数据库
postgresql-15-setup initdb
systemctl enable --now postgresql-15

# 建库
sudo -u postgres psql
create database zabbix;
create user zabbix with password 'zabbix';
grant all privileges on database zabbix to zabbix;
\q

# 导入zabbix初始化数据
zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u postgres psql -d zabbix

# 授权
sudo -u postgres psql -d zabbix -c "GRANT ALL ON ALL TABLES IN SCHEMA public TO zabbix;"
sudo -u postgres psql -d zabbix -c "GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO zabbix;"

设置数据库本地密码加密方式

vi /var/lib/pgsql/15/data/pg_hba.conf

把 local all all peer 改成local all all trust

重启数据库:systemctl restart postgresql-15

设置zabbixs数据库连接

vi /etc/zabbix/zabbix_server.conf

确保下面的配置

复制代码
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

启动服务端

sh 复制代码
systemctl start zabbix-server
systemctl enable --now nginx
systemctl enable --now php-fpm

开机自启动

sh 复制代码
systemctl enable zabbix-server
systemctl enable nginx
systemctl enable php-fpm
systemctl enable postgresql-15

访问

复制代码
http://你的服务器IP/

账号:Admin
密码:zabbix

zabbix 程序升级

停止服务端

sh 复制代码
#  停服务端
systemctl stop zabbix-server

# 如需也停agent2
systemctl stop zabbix-agent2

运行更新程序

sh 复制代码
dnf update zabbix* -y

启动服务器

sh 复制代码
systemctl start zabbix-server
systemctl start zabbix-agent2
相关推荐
广目软件11 天前
HA分布式架构采集节点变更操作手册20261029
运维·服务器·ansible·zabbix·prometheus
honsor13 天前
机柜式双网口 RS485 温湿度变送器接入 Zabbix 完整教程(含 Modbus 点位)
物联网·zabbix·tcp
honsor15 天前
双网口 + RS485 机柜温湿度传感器,Modbus RTU/TCP 如何接入 Zabbix
网络协议·tcp/ip·zabbix
运维自动化&云计算19 天前
zabbix 7.4.15升级php8.5.12
zabbix
梅菲塔亚19 天前
Zabbix企业级监控系统搭建实战
zabbix
月落汀兰20 天前
服务器出问题没人告警?Zabbix6.0 LNMP 部署,MySQL 监控 + 邮件告警保姆级实战
运维·服务器·zabbix
王琦031823 天前
Zabbix部署
zabbix
王琦031824 天前
zabbix agent 部署与使用
zabbix
Lysander.Jovian24 天前
zabbix监控实战
zabbix
fengkai454525 天前
十三、Zabbix 监控
运维·服务器·zabbix·监控·网络设备