rokcylinux9.1需要最小化初始化安装环境及安装相关软件依赖包,见上篇笔记
一、创建数据库
rpm -Uvh mysql80-community-release-el9-1.noarch.rpm
yum install -y mysql-server
systemctl enable mysqld --now
systemctl status mysqld
mysql -u root
首次登录寻找密码
vim /var/log/mysqld.log
是一段特殊文本组成
利用该密码登录
ALTER USER ‘root’@‘localhost’ IDENTIFIED BY ‘Cmcc@2022’;
二、
dnf check-update
dnf install dnf-utils
三、
导入zabbix安装源仓库
rpm -Uvh https://repo.zabbix.com/zabbix/6.2/rhel/9/x86_64/zabbix-release-6.2-3.el9.noarch.rpm
更新仓库
dnf clean all
四、安装Zabbix server,Web前端,agent
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent
五、#### 在数据库主机上运行以下代码
# mysql -uroot -p
password
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by ‘Password@2022’;
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> flush privileges;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
不报错就说明没问题
Disable log_bin_trust_function_creators option after importing database schema.
mysql -uroot -p
Password@2022
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
vim /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=Cmcc@2022
DBPort=3306
启动Zabbix server和agent进程,并为它们设置开机自启:
systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm
shell> service zabbix-server stop
shell> service zabbix-server restart
shell> service zabbix-server status
系统提示:
You are not able to choose some of the languages, because locales for them are not installed on the web server.
手动安装中文语言包:
安装zh_CN语言包
dnf install langpacks-zh_CN.noarch
安装glibc-common实现对语言包的识别:
dnf reinstall glibc-common
测试安装是否成功?
locale -a | grep zh_CN
解决中文字体乱码
cd /usr/share/zabbix/assets/fonts
上传到改目录下,备份重命名
系统提示:
You are not able to choose some of the languages, because locales for them are not installed on the web server.
手动安装中文语言包:
安装zh_CN语言包
dnf install langpacks-zh_CN.noarch
安装glibc-common实现对语言包的识别:
dnf reinstall glibc-common
测试安装是否成功?
locale -a | grep zh_CN
解决中文字体乱码
cd /usr/share/zabbix/assets/fonts