测试环境
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@-0g1JaUY_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