others linux服务器运维 django3 监控 k8s golang 数据库 大数据 前端 devops 理论基础 java oracle 运维日志

rockylinux 8.10 系统安装 zabbix7 数据库使用oceanbase

访问量:21 创建时间:2025-12-13

php8.2安装

[root@localhost ~]# dnf module switch-to php:8.2
rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rocky/8/x86_64/zabbix-release-latest-7.0.el8.noarch.rpm
dnf clean all
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

上传oceanbase-all-in-one-4.3.5到系统,这里用单机数据库演示,oceanbase请自行安装。

echo "* hard nofile 655360" >> /etc/security/limits.conf
echo "* soft nofile 655360" >> /etc/security/limits.conf
echo "* soft nproc 65535" >> /etc/security/limits.conf
echo "* hard nproc 65535" >> /etc/security/limits.conf
echo "* soft  stack  unlimited" >> /etc/security/limits.conf
echo "* soft  stack  unlimited" >> /etc/security/limits.conf
echo "*           soft  core   unlimit" >> /etc/security/limits.conf
echo "*           hard  core   unlimit" >> /etc/security/limits.conf
echo "*           soft  fsize  unlimited" >> /etc/security/limits.conf
echo "*           hard  fsize  unlimited" >> /etc/security/limits.conf
echo "*           soft  data   unlimited" >> /etc/security/limits.conf
echo "*           hard  data   unlimited" >> /etc/security/limits.conf

tar xf oceanbase-all-in-one-4.3.5_bp5_20251117.el8.x86_64.tar.gz 
cd oceanbase-all-in-one
./bin/install.sh 
obd demo
obclient -h127.0.0.1 -P2883 -uroot@sys -p'iyyjXE2Rhr3bmFBSIMcE' -Doceanbase -A
obclient(root@sys)[oceanbase]> create database zabbix character set utf8mb4 collate utf8mb4_bin;

obclient(root@sys)[oceanbase]> exit
dnf -y install mysql
[root@localhost ~]# mysql -uroot@sys#demo -piyyjXE2Rhr3bmFBSIMcE -h127.0.0.1 -P2883  zabbix
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 928514056
Server version: 5.6.25 OceanBase_CE 4.3.5.5 (r105000012025111711-c10174c0486c38f64a2222486986bbe15d5da0dc) (Built Nov 17 2025 12:20:08)

mysql> exit

[root@localhost ~]# zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql  --default-character-set=utf8mb4 -uroot@sys#demo -piyyjXE2Rhr3bmFBSIMcE -h127.0.0.1 -P2883  zabbix
####通过vim修改配置文件,修改内容如egrep显示
[root@localhost ~]# vim /etc/zabbix/zabbix_server.conf
[root@localhost ~]# egrep -v '^#|^$' /etc/zabbix/zabbix_server.conf 
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/run/zabbix/zabbix_server.pid
SocketDir=/run/zabbix
DBHost=127.0.0.1
DBName=zabbix
DBUser=root@sys#demo
DBPassword=iyyjXE2Rhr3bmFBSIMcE
DBPort=2883
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
LogSlowQueries=3000
StatsAllowedIP=127.0.0.1
EnableGlobalScripts=0
Include=/etc/zabbix/zabbix_server.d/*.conf
[root@localhost ~]# systemctl restart zabbix-server zabbix-agent httpd php-fpm
[root@localhost ~]# systemctl enable zabbix-server zabbix-agent httpd php-fpm

故障

Unable to start Zabbix server due to unsupported MySQL database version (5.06.25).
[root@localhost ~]# obclient -h127.0.0.1 -P2883 -uroot@proxysys -p'9z3fw4kq0K'  -A
Welcome to the OceanBase.  Commands end with ; or \g.
Your OceanBase connection id is 928514399
Server version: 5.6.25
obclient(root@proxysys@proxysys)[(none)]> alter proxyconfig set mysql_version='8.0.30';
Query OK, 0 rows affected (0.002 sec)

obclient(root@proxysys@proxysys)[(none)]> show proxyconfig like '%mysql_version%';
+---------------+--------+--------------------------------------------------------------------------------------------------------------------------+-------------+---------------+-------+--------------+
| name          | value  | info                                                                                                                     | need_reboot | visible_level | range | config_level |
+---------------+--------+--------------------------------------------------------------------------------------------------------------------------+-------------+---------------+-------+--------------+
| mysql_version | 8.0.30 | returned version for mysql mode, default value is 5.6.25. If set, proxy will send new version when user connect to proxy | false       | USER          |       | LEVEL_VIP    |
+---------------+--------+--------------------------------------------------------------------------------------------------------------------------+-------------+---------------+-------+--------------+
1 row in set (0.003 sec)
[root@localhost ~]# systemctl disable --now firewalld.service

访问http://IP/zabbix

默认账号密码Admin zabbix

登陆评论: 使用GITHUB登陆