猿创征文 | 国产数据库实战之TiDB 数据库快速入门
一、系统检查
1.检查系统版本
[root@TiDB ~]# cat /etc/centos-release
CentOS Linux release 7.6.1810 (Core)
2.查看本地IP地址
[root@TiDB ~]# ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.3.241 netmask 255.255.255.0 broadcast 192.168.3.255
inet6 fe80::2a6e:d4ff:fe8a:1bd9 prefixlen 64 scopeid 0x20<link>
ether 28:6e:d4:8a:1b:d9 txqueuelen 1000 (Ethernet)
RX packets 54547 bytes 7063009 (6.7 MiB)
RX errors 0 dropped 27 overruns 0 frame 0
TX packets 203 bytes 26090 (25.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
3.TiDB集群介绍
TiDB 是一个分布式系统。最基础的 TiDB 测试集群通常由 2 个 TiDB 实例、3 个 TiKV 实例、3 个 PD 实例和可选的 TiFlash 实例构成。通过 TiUP Playground,可以快速搭建出上述的一套基础测试集群。
二、快速部署本地测试集群
1.安装 TiUP工具
[root@TiDB ~]# curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7085k 100 7085k 0 0 947k 0 0:00:07 0:00:07 --:--:-- 1784k
WARN: adding root certificate via internet: https://tiup-mirrors.pingcap.com/root.json
You can revoke this by remove /root/.tiup/bin/7b8e153f2e2d0928.root.json
Successfully set mirror to https://tiup-mirrors.pingcap.com
Detected shell: bash
Shell profile: /root/.bash_profile
/root/.bash_profile has been modified to add tiup to PATH
open a new terminal or source /root/.bash_profile to use it
Installed path: /root/.tiup/bin/tiup
===============================================
Have a try: tiup playground
===============================================
2.声明全局环境变量