使用最小化安装即可。
如果在Esxi虚拟机中安装,请选用BIOS固件(不要选建议的EFI,否则无法安装)。
安装完毕CentOS9之后,在root权限下执行如下指令
yum update -y
systemctl stop firewalld.service
systemctl disable firewalld.service
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
yum remove -y mysql
find / -name mysql
然后将找到的全删掉
rm -rf /var/lib/selinux/targeted/active/modules/100/mysql
yum install wget -y
wget https://dev.mysql.com/get/mysql80-community-release-el8-1.noarch.rpm
yum install mysql80-community-release-el8-1.noarch.rpm -y
yum install -y mysql-community-server --nogpgcheck
修改/etc/my.cnf
vi /etc/my.cnf
取消此行注释
default-authentication-plugin=mysql_native_password
systemctl enable mysqld
systemctl start mysqld
注意:最后一行zabbix-agent2,与官方包(zabbix-agent)不一致。
rpm -Uvh https://repo.zabbix.com/zabbix/6.4/rhel/9/x86_64/zabbix-release-6.4-1.el9.noarch.rpm
yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2
grep 'temporary password' /var/log/mysqld.log
[root@CentOS9 ~]# grep 'temporary password' /var/log/mysqld.log
2023-09-27T07:00:22.581536Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: *(dqflf!;33A
mysql -uroot -p
password
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'Abc@123.com';
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'Abc@123.com';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
这里需要多等一等,时间比较久。
mysql -uroot -p
password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
vi /etc/zabbix/zabbix_server.conf
取消DBPassword注释,并赋值
DBPassword=Abc@123.com
systemctl restart zabbix-server zabbix-agent2 httpd php-fpm
systemctl enable zabbix-server zabbix-agent2 httpd php-fpm
yum install langpacks-zh_CN.noarch
http://x.x.x.x/zabbix/
Admin
zabbix