【Zabbix7.0安装】在Linux Rocky8系统下安装

参考官方原文

https://www.zabbix.com/cn/download?zabbix=7.0&os_distribution=rocky_linux&os_version=8&components=server_frontend_agent&db=mysql&ws=nginx

一、安装包下载

1、安装镜像源并切换PHP

rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/8/x86_64/zabbix-release-7.0-3.el8.noarch.rpm
dnf clean all
dnf module switch-to php:8.0

2、下载好6个包

dnf install --nogpgcheck zabbix-server-mysql -y
dnf install zabbix-web-mysql -y
dnf install zabbix-nginx-conf -y
dnf install zabbix-sql-scripts -y
dnf install zabbix-selinux-policy -y
dnf install zabbix-agent2 -y

3、检查一下

dnf install zabbix-server-mysql zabbix-web-mysql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2

二、mysql数据库安装

dnf install mysql -y
dnf install mysql-server -y
systemctl start mysqld && systemctl enable mysqld
mysql_secure_installation
Would you like to setup VALIDATE PASSWORD component? N
123456
123456
Remove anonymous users? N
Disallow root login remotely? N
Remove test database and access to it? N
Reload privilege tables now? Y

三、mysql数据库配置

mysql -uroot -p123456 -e "create database zabbix character set utf8mb4 collate utf8mb4_bin;"
mysql -uroot -p123456 -e "create user zabbix@localhost identified by 'zabbix';"
mysql -uroot -p123456 -e "grant all privileges on zabbix.* to zabbix@localhost;"
mysql -uroot -p123456 -e "set global log_bin_trust_function_creators = 1;"
mysql -uroot -p123456 -e "show tables from zabbix;"
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -pzabbix zabbix
mysql -uroot -p123456 -e "set global log_bin_trust_function_creators = 0;"

四、配置zabbix连接服务器的密码

sed -i 's/# DBPassword=.*$/DBPassword=zabbix/' /etc/zabbix/zabbix_server.conf

五、配置Nginx

1、 编辑配置文件

/etc/nginx/conf.d/zabbix.conf uncomment and set ‘listen’ and ‘server_name’ directives.

vi /etc/nginx/conf.d/zabbix.conf

listen 8080;
server_name 127.0.0.1;

2、关闭防火墙

systemctl stop firewalld && systemctl disable firewalld

也可以放行端口

firewall-cmd --add-port=80/tcp --permanent
firewall-cmd --add-port=10050/tcp --permanent
firewall-cmd --add-port=8080/tcp --permanent
firewall-cmd --add-port=3306/tcp --permanent
firewall-cmd --reload

六、启用并设置开机自启

systemctl restart zabbix-server zabbix-agent2 nginx php-fpm && systemctl enable zabbix-server zabbix-agent2 nginx php-fpm

七、更换字体,否则图表乱码

cd /usr/share/zabbix/assets/fonts/

把windows上的一个字体改名为graphfont.ttf 覆盖上去
控制面板\外观和个性化\字体

八、进入Zabbix前端页面(8080端口)

数据库账号密码
zabbix/zabbix

主机名称随便给,例如zabbix-server

Zabbix登录账号密码
Admin/zabbix

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值