tidb(1)快速开始
参考TIDB官方课程资料:
https://learn.pingcap.com/learner/course/30002
基础环境配置
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
tiup cluster
tiup update --self && tiup update cluster
修改 /etc/ssh/sshd_config 将 MaxSessions 调至 20。
重启 sshd 服务:
systemctl restart sshd.service
快速安装数据库
[root@root ~]# tiup playground
tiup is checking updates for component playground ...
Starting component `playground`: /root/.tiup/components/playground/v1.10.3/tiup-playground
Using the version v6.2.0 for version constraint "".
If you'd like to use a TiDB version other than v6.2.0, cancel and retry with the following arguments:
Specify version manually: tiup playground <version>
Specify version range: tiup playground ^5
The nightly version: tiup playground nightly
Playground Bootstrapping...
Start pd instance:v6.2.0
Start tikv instance:v6.2.0
Start tidb instance:v6.2.0
Waiting for tidb instances ready
127.0.0.1:4000 ... Done
Start tiflash instance:v6.2.0
The component `tiflash` version v6.2.0 is not installed; downloading from repository.
download https://tiup-mirrors.pingcap.com/tiflash-v6.2.0-linux-amd64.tar.gz 91.10 MiB / 167.66 MiB 54.34% 2.08 MiB/s download https://tiup-mirrors.pingcap.com/tiflash-v6.2.0-linux-amd64.tar.gz 167.66 MiB / 167.66 MiB 100.00% 1.85 MiB/s
Waiting for tiflash instances ready
127.0.0.1:3930 ... Done
CLUSTER START SUCCESSFULLY, Enjoy it ^-^
To connect TiDB: mysql --comments --host 127.0.0.1 --port 4000 -u root -p (no password)
To view the dashboard: http://127.0.0.1:2379/dashboard
PD client endpoints: [127.0.0.1:2379]
To view the Prometheus: http://127.0.0.1:9090
To view the Grafana: http://127.0.0.1:3000
连接数据库
1、tiup client
2、mysql --host 127.0.0.1 --port 4000 -u root
清理数据库环境
tiup clean --all