TIDB的下载与检查
首先下载安装包
wget http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz
wget http://download.pingcap.org/tidb-latest-linux-amd64.sha256
检查文件完整性,返回 ok 则正确
sha256sum -c tidb-latest-linux-amd64.sha256
解压并进入相应目录下
[root@server1 ~]# tar zxf tidb-latest-linux-amd64.tar.gz
[root@server1 ~]# cd tidb-v5.0.1-linux-amd64/
部署TIDB
启动PD
[root@server1 tidb-v5.0.1-linux-amd64]# /bin/pd-server --name=pd1 --data-dir=pd1 --client-urls="http://172.25.1.1:2379" --peer-urls="http://172.25.1.1:2380" --initial-cluster="pd1=http://172.25.1.1:2380"
启动 TiKV
./bin/tikv-server --pd="172.25.1.1:2379" --addr="172.25.1.1:20160" --data-dir=tikv1
启动 TiDB并打入后台
/bin/tidb-server
使用 MySQL 连接 TiDB
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'Xsm878718250!';
将TiDB集成到zabbix中去
vim /etc/zabbix/zabbix_server.conf
vim /etc/zabbix/web/zabbix.conf.php
重启zabbix服务
systemctl restart zabbix-server
systemctl restart zabbix-agent
网页访问zabbix成功