基于AnolisOS8.6+单机版TiDB部署ZABBIX5.0

测试环境

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

优化SSH连接数

vi /etc/ssh/sshd_config
MaxSessions 20
systemctl restart sshd

在线TiDB单机部署集群

社区版地址:https://cn.pingcap.com/product-community
下载并安装TiUP
curl --proto ‘=https’ --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
声明全局环境变量:
source .bash_profile
编辑拓扑架构
vi tidb-topo.yaml

*global:
user: “tidb”
ssh_port: 22
deploy_dir: “/tidb-deploy”
data_dir: “/tidb-data”
pd_servers:

  • host: 192.168.1.27
    tidb_servers:
  • host: 192.168.1.27
    tikv_servers:
  • host: 192.168.1.27
    monitoring_servers:
  • host: 192.168.1.27
    grafana_servers:
  • host: 192.168.1.27
    alertmanager_servers:
  • host: 192.168.1.27*

部署集群
tiup list tidb
tiup cluster deploy wentidb v5.4.3 /root/tidb-topo.yaml --user root -p

启动集群
tiup cluster start wentidb --init

The root password of TiDB database has been changed.
The new password is: '5@-0g1
JaUY_84EB9L’.
Copy and record it to somewhere safe, it is only displayed once, and will not be stored.
The generated password can NOT be get and shown again.*

检查集群
tiup cluster list
tiup cluster display wentidb

连接TiDB[可选]
yum -y install mysql
mysql --host 192.168.1.27 --port 4000 -u root -p

修改root密码
use mysql;
select User,Host,authentication_string from mysql.user;
alter user ‘root’@‘%’ identified by ‘root’;
flush privileges;

安装ZABBIX

https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
rpm -ivh zabbix-release-5.0-1.el8.noarch.rpm
yum clean all
yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent

创建数据库
create database zabbix character set utf8 collate utf8_bin;
create user ‘zabbix’@‘192.168.1.0/255.255.255.0’ identified by ‘zabbix’;
grant all on zabbix.* to ‘zabbix’@‘192.168.1.0/255.255.255.0’;
导入数据库
zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz | mysql -h 192.168.1.28 -P4000 -uzabbix -p zabbix
编辑zabbix配置文件
vi /etc/zabbix/zabbix_server.conf
DBHost=192.168.1.27
DBUser=zabbix
DBPassword=zabbix
DBPort=4000

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

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

注意:初始帐号和密码。
帐号:Admin
密码:zabbix

测试总结

最开始有尝试过ZABBIX6.0 LTS测试,但总是报错,未定位原因。所以改为用ZABBIX5.0 LTS做测试。
TiDB v7.5.1+ZABBIX6.0
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql -h 192.168.1.28 -P4000 -uzabbix -p zabbix

ERROR 1064 (42000) at line 2114: You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 14 near "trigger hosts_name_upper_insert

  • 35
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值