rocky linux9.1安装zabbix 6.2

rokcylinux9.1需要最小化初始化安装环境及安装相关软件依赖包,见上篇笔记

一、创建数据库
rpm -Uvh mysql80-community-release-el9-1.noarch.rpm

rokcylinux9.1安装mysql8.0

yum install -y mysql-server

启动mysql服务并设置开机自动启动

systemctl enable mysqld --now

检查MySQL服务器是否正在运行

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;

导入初始架构和数据,系统将提示您输入新创建的密码。
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix

不报错就说明没问题

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;

为Zabbix server配置数据库

vim /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=Cmcc@2022

DBPort=3306

启动Zabbix server和agent进程

启动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

上传到改目录下,备份重命名
rocky linux9.1安装zabbix 6.2_第1张图片

你可能感兴趣的:(个人学习笔记,zabbix,mysql,运维)