TiDB入门篇-TiDB初体验playground

简介

TiDB 是一个分布式系统。最基础的 TiDB 测试集群通常由 2 个 TiDB 实例、3 个 TiKV 实例、3 个 PD 实例和可选的 TiFlash 实例构成。通过 TiUP Playground,可以快速搭建出上述的一套基础测试集群。

TiDB 数据库快速上手指南 | PingCAP 文档中心

操作

安装TiUP

curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
[root@master ~]# 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 7088k  100 7088k    0     0  2966k      0  0:00:02  0:00:02 --:--:-- 2966k
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
===============================================

更具上面的提示执行下面的命令。 

source /root/.bash_profile

运行模拟集群

下面指定的--host是外网的ip如果不指定那么就是127.0.0.1外部电脑就访问不了。

tiup playground v6.5.1 --db 2 --pd 3 --kv 3 --host 192.168.66.10

执行以后打印如下 

[root@master ~]# tiup playground v6.5.1 --db 2 --pd 3 --kv 3 --host 192.168.66.10
tiup is checking updates for component playground ...
Starting component `playground`: /root/.tiup/components/playground/v1.11.3/tiup-playground v6.5.1 --db 2 --pd 3 --kv 3 --host 192.168.66.10
Playground Bootstrapping...
Start pd instance:v6.5.1
Start pd instance:v6.5.1
Start pd instance:v6.5.1
Start tikv instance:v6.5.1
Start tikv instance:v6.5.1
Start tikv instance:v6.5.1
Start tidb instance:v6.5.1
Start tidb instance:v6.5.1
Waiting for tidb instances ready
192.168.66.10:4000 ... Done
192.168.66.10:4001 ... Done
Start tiflash instance:v6.5.1
Waiting for tiflash instances ready
192.168.66.10:3930 ... Done
CLUSTER START SUCCESSFULLY, Enjoy it ^-^
To connect TiDB: mysql --comments --host 192.168.66.10 --port 4000 -u root -p (no password)
To connect TiDB: mysql --comments --host 192.168.66.10 --port 4001 -u root -p (no password)
To view the dashboard: http://192.168.66.10:2379/dashboard
PD client endpoints: [192.168.66.10:2379 192.168.66.10:2382 192.168.66.10:2384]
To view the Prometheus: http://192.168.66.10:9090
To view the Grafana: http://192.168.66.10:3000

执行以后应该上面的是一个模拟环境,所以如果关闭窗口了那么集群就会停止。

所以我们新开一个窗口登录(初始没有密码直接回车就行)

mysql --comments --host 127.0.0.1 --port 4001 -u root -p

登录可视化界面 ,默认密码为空,指定登录。

http://192.168.66.10:2379/dashboard/#/signin

 

 登录监控页面

http://192.168.66.10:3000/login 

 

账号密码都是admin 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

工作变成艺术

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值