基于AnolisOS8.6+阿里PolarDB-X部署ZABBIX6.0

测试环境

AnolisOS-8.6-x86_64-minimal.iso
Virtual Box,2 vCPU, 4G RAM, 40 vDisk

软件包

https://openpolardb.com/download?type=PolarDB-X

安装依赖

yum install -y libaio* ncurses-devel
sudo ln -s /usr/lib64/libncurses.so.6.1 /usr/lib64/libncurses.so.5
sudo ln -s /usr/lib64/libtinfo.so.6.1 /usr/lib64/libtinfo.so.5

PolarDB-X安装

rpm -ivh t-polardbx-engine-2.4.0-a6d7022.el7.x86_64.rpm

创建并切换到polarx用户
useradd -ms /bin/bash polarx
echo “polarx:polarx” | chpasswd
echo “polarx ALL=(ALL) NOPASSWD: ALL” >> /etc/sudoers
su - polarx

创建必要目录
mkdir polardbx-enginecd polardbx-engine && mkdir log mysql run data tmp

mkdir polardbx-engine/log
mkdir polardbx-engine/tmp
mkdir polardbx-engine/run
touch /home/polarx/polardbx-engine/log/alert.log
创建my.cnf配置文件

[mysqld]
basedir = /opt/polardbx_engine
log_error_verbosity = 2
default_authentication_plugin = mysql_native_password
gtid_mode = ON
enforce_gtid_consistency = ON
log_bin = mysql-binlog
binlog_format = row
binlog_row_image = FULL
master_info_repository = TABLE
relay_log_info_repository = TABLE

datadir = /home/polarx/polardbx-engine/data
tmpdir = /home/polarx/polardbx-engine/tmp
socket = /home/polarx/polardbx-engine/tmp.mysql.sock
log_error = /home/polarx/polardbx-engine/log/alert.log
port = 4886
cluster_id = 1234
cluster_info = 127.0.0.1:14886@1

[mysqld_safe]
pid_file = /home/polarx/polardbx-engine/run/mysql.pid

初始化
/opt/polardbx_engine/bin/mysqld --defaults-file=my.cnf --initialize-insecure

启动
/opt/polardbx_engine/bin/mysqld_safe --defaults-file=my.cnf &

登录数据库
/opt/polardbx_engine/bin/mysql -h127.0.0.1 -P4886 -uroot

安装ZABBIX 6.0

https://repo.zabbix.com/zabbix/6.0/rhel/8/x86_64/zabbix-release-6.0-4.el8.noarch.rpm
rpm -ivh zabbix-release-6.0-4.el8.noarch.rpm
yum clean all
yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent

创建数据库
create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user ‘zabbix’@‘192.168.1.0/255.255.255.0’ identified WITH mysql_native_password by ‘PolarX@2024!’;
grant all on zabbix.* to ‘zabbix’@‘192.168.1.0/255.255.255.0’;
set global log_bin_trust_function_creators=1;
导入数据库
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | /opt/polardbx_engine/bin/mysql -h 192.168.1.37 -P4886 --default-character-set=utf8mb4 -uzabbix -p zabbix
编辑zabbix配置文件
vi /etc/zabbix/zabbix_server.conf
DBHost=192.168.1.37
DBUser=zabbix
DBPassword=PolarX@2024!
DBPort=4886

grep -v “^$|#” /etc/zabbix/zabbix_server.conf

vi /etc/httpd/conf/httpd.conf
ServerName 192.168.1.37:80

vi /etc/php-fpm.d/zabbix.conf
php_value[date.timezone] = Asia/Shanghai

启动zabbix服务
systemctl restart zabbix-server zabbix-agent httpd php-fpm
systemctl enable zabbix-server zabbix-agent httpd php-fpm
systemctl status zabbix-server zabbix-agent httpd php-fpm

访问zabbix WEB,注意修改数据库配置
http://192.168.1.37/zabbix

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值