选择安装的版本如图片所示
镜像下载地址:CentOS Stream
下载Zabbix
root 123456
Admin 123456
root 12456
zabbix password
zabbix password
前端WEB默认登录Admin zabbix
根据自己的需求在配置文件或者图形界面中将网络改为静态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
查看IP信息是否更改完成
ifconfig
测试连通性
ping www.baidu.com
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
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
#yum remove -y mysql
#find / -name mysql
#rm -rf
#wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
#yum install mysql80-community-release-el8-1.noarch.rpm
#yum module disable mysql
#yum install mysql-community-server --nogpgchec
vim /etc/my.cnf
default-authentication-plugin=mysql_native_password
把这一行的注释去掉,没有的话直接加上,如下所示
#systemctl restart mysqld #重启
#service mysqld status #查看状态
#service enable mysqld #设置开机自启
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"; #修改密码
#rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
#dnf clean all
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2
#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;
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
#password
#mysql -uroot -p
#输入密码 123456
#mysql> set global log_bin_trust_function_creators = 0;
#mysql> quit;
DBPassword=password #130行
#systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
#systemctl enable zabbix-server zabbix-agent2 httpd php-fpm