全网最详细Centos 9 Stream安装部署最新Zabbix 6.4

该文详细介绍了在Centos9stream操作系统上安装Zabbix6.4和MySQL8的过程,包括网络配置、关闭防火墙和SELinux、初始化MySQL、设置数据库、安装Zabbix组件以及登录Zabbix前端的步骤。
摘要由CSDN通过智能技术生成

选择安装的版本如图片所示

一、信息汇总

1、服务器系统Centos 9 stream

镜像下载地址:CentOS Stream

2、Zabbix官网指南

下载Zabbix

3、服务器用户信息整合

①服务器用户

root  123456

Admin  123456

②MySQL用户

root  12456

zabbix  password

③Zabbix6.4用户

zabbix  password

前端WEB默认登录Admin  zabbix

4、网络配置

根据自己的需求在配置文件或者图形界面中将网络改为静态IP,然后重启一下网络。

centos stream 9使用新网络设置方式,使用了新的NetworkManager,所以相比centos7、8设置不同。

①进入网卡配置文件,修改如下位置即可

vim /etc/NetworkManager/system-connections/enp2s0.nmconnection
[ipv4]
address1=172.20.20.200/24,172.20.20.254  #分别表示IP、子网掩码、网关
dns=114.114.114.114;
method=manual  #method是类型,默认的是auto 

 ②重启网络

#nmcli connection reload
#nmcli connection down ens2s0
#nmcli connection up ens2s0

③查看网络信息,并测试网络和DNS

查看IP信息是否更改完成

ifconfig

 测试连通性

ping www.baidu.com

二、关闭防火墙、SELINUX

1、关闭防火墙

①只关闭此次

systemctl stop firewalld

②永久关闭

systemctl disable firewalld

③查看firewalld服务状态,active为dead,则表示已经永久关闭

systemctl status firewalld

2、关闭SElinux

①临时关闭

setenforce 0

②永久关闭

vim /etc/selinux/config 

将文件内SELINUX=enforcing这行改为SELINUX=disabled或者SELINUX=permissive,然后保存退出,重启centos 9生效

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled  #改这里
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

③查看状态是否关闭

getenforce

三、安装MYSQL8

#yum remove -y mysql
#find / -name mysql
#rm -rf
#wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
#yum install -y mysql80-community-release-el8-1.noarch.rpm
#yum module disable mysql
#yum install -y mysql-community-server --nogpgchec

四、初始化MYSQL

1、修改my.cnf

vim /etc/my.cnf
default-authentication-plugin=mysql_native_password 

把这一行的注释去掉,没有的话直接加上,如下所示

 2、重启mysql并设置开机自启动

#systemctl restart mysqld  #重启
#systemctl status mysqld   #查看状态
#systemctl enable mysqld  #设置开机自启

五、MYSQL密码配置

1、修改root密码,第一次登录时查找登录密码

①查找默认密码

grep 'temporary password' /var/log/mysqld.log 

查找的密码例如为:b6aeg+rg8e!Y

②修改密码

#mysql -u root -p  #输入查找到的默认密码登录
#alter user root@"localhost" identified with mysql_native_password by "root_21ROOT"; #先创建复杂密码 
#SHOW VARIABLES LIKE 'validate_password%'; #查看、修改密码策略
#set global validate_password.policy=0;
#set global validate_password.mixed_case_count=0;
#set global validate_password.number_count=0;
#set global validate_password.special_char_count=0;
#set global validate_password.length=0;
#SHOW VARIABLES LIKE 'validate_password%';
#alter user root@"localhost" identified with mysql_native_password by "123456";  #修改密码

六、安装Zabbix6.4

1、安装zabbix存储库

#rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
#dnf clean all

2、安装Zabbix server,Web前端,agent2

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

七、创建初始数据库

1、确保数据库服务器已启动并正在运行,执行如下命令

#mysql -uroot -p
#123456
#mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
#mysql> create user zabbix@localhost identified with mysql_native_password by "password";
#mysql> grant all privileges on zabbix.* to zabbix@localhost;
#mysql> set global log_bin_trust_function_creators = 1;
#mysql> use mysql;  #删除空用户名。更新权限
#mysql> delete from user where user=' ';
#mysql> flush privileges;
#mysql> quit;

2、导入初始架构和数据,系统将提示您输入新创建的密码

 zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

#password

3、导入数据库架构后禁用log_bin_trust_function_creators选项

#mysql -uroot -p
#输入密码 123456
#mysql> set global log_bin_trust_function_creators = 0;
#mysql> quit;

八、为Zabbix server配置数据库

1、编辑配置文件/etc/zabbix/zabbix_server.conf

DBPassword=password #130行

2、启动Zabbix server和agent进程,并为它们设置开机自启

#systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
#systemctl enable zabbix-server zabbix-agent2 httpd php-fpm

九、登录Zabbix WEB前端配置

1、浏览器输入 172.20.20.200/zabbix ,语言选择中文,下一步

2、下一步

3、输入密码为:password,下一步

 

4、输入主机名称,下一步

5、下一步

6、完成

7、前端WEB默认账号:Admin,密码 :zabbix

 8、完成

Zabbix 6.4 是一个开源的网络监控和报警系统。它引入了对 Line 消息应用程序的 Webhook 集成,允许将 Zabbix 事件转发到 Line Messenger。[1] 要在 CentOS 8 / RHEL 8 / Oracle Linux 8 / Alma Linux 8/ Rocky Linux 8 上安装 Zabbix 6.4,您可以使用以下步骤: 1. 安装 Zabbix 存储库: 使用以下命令安装 Zabbix 存储库 ``` rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/8/x86_64/zabbix-release-6.4-1.el8.noarch.rpm ``` 2. 清理缓存: 使用以下命令清理缓存 ``` dnf clean all ``` 3. 安装 Zabbix 服务器: 使用以下命令安装 Zabbix 服务器 ``` dnf install zabbix-server-mysql ``` 4. 配置数据库: 使用以下命令为 Zabbix 创建数据库和用户 ``` mysql -u root -p create database zabbix character set utf8 collate utf8_bin; grant all privileges on zabbix.* to zabbix@localhost identified by 'password'; flush privileges; exit; ``` 5. 导入初始数据库模式和数据: 使用以下命令导入初始数据库模式和数据 ``` zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -u zabbix -p zabbix ``` 6. 配置 Zabbix 服务器: 打开 `/etc/zabbix/zabbix_server.conf` 文件,设置数据库密码和其他必要的配置 7. 启动 Zabbix 服务器: 使用以下命令启动 Zabbix 服务器 ``` systemctl start zabbix-server ``` 8. 配置 Zabbix 前端: 打开 `/etc/httpd/conf.d/zabbix.conf` 文件,按需修改 Zabbix 前端的配置 9. 启动 Apache 服务: 使用以下命令启动 Apache 服务 ``` systemctl start httpd ``` 10. 访问 Zabbix 前端: 在浏览器中访问 Zabbix 前端,输入您在步骤 4 中设置的数据库信息,完成安装和配置。 这样就完成了在 CentOS 8 / RHEL 8 / Oracle Linux 8 / Alma Linux 8/ Rocky Linux 8 上安装 Zabbix 6.4 的过程。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Zabbix之2023 Zabbix6.4最新高级特性、优缺点及其实现原理总结](https://blog.csdn.net/zhouruifu2015/article/details/130933529)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [一步到位教你在centos8stream搭建zabbix6.4+nginx+maridb10.6+php7.4](https://blog.csdn.net/m0_56055257/article/details/131260948)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论 16
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

陪我养猪吧

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值