0
点赞
收藏
分享

微信扫一扫

快速体验 TiDB v7.1

在当今数码时代,数据库已成为许多企业和组织的重要组成部分。为了满足日益增长的需求,许多新型数据库系统也应运而生。TiDB是一种新型的分布式数据库系统,其特点是高可用性和可扩展性。本文将介绍如何快速安装TiDB。

安装TiDB的第一步是下载二进制包。您可以在TiDB的官方网站上找到最新的二进制包。下载后,将其解压缩到您选择的目录中。接下来,您需要配置TiDB集群。为了方便起见,我们建议使用TiUP工具来完成此操作。TiUP是一个用于管理TiDB集群的命令行工具,它可以帮助您快速部署和管理TiDB集群。

curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh

[root@shawnyan ~]# tiup -v
1.12.3 v1.12.2-nightly-9
Go Version: go1.19.10
Git Ref: master
GitHash: c3a7e3133e01bd36094a7016eed5adbd3c656c61
[root@shawnyan ~]#

安装TiUP后,您可以使用以下命令来安装TiDB集群:

[root@shawnyan ~]# tiup playground --host 192.168.8.171 --tag 7.1
tiup is checking updates for component playground ...
Starting component `playground`: /root/.tiup/components/playground/v1.12.3/tiup-playground --host 192.168.8.171 --tag 7.1
Using the version v7.1.0 for version constraint "".

If you'd like to use a TiDB version other than v7.1.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

Start pd instance:v7.1.0
The component `pd` version v7.1.0 is not installed; downloading from repository.
download https://tiup-mirrors.pingcap.com/pd-v7.1.0-linux-amd64.tar.gz 50.27 MiB / 50.27 MiB 100.00% 11.52 MiB/s                                 
Start tikv instance:v7.1.0
The component `tikv` version v7.1.0 is not installed; downloading from repository.
download https://tiup-mirrors.pingcap.com/tikv-v7.1.0-linux-amd64.tar.gz 280.85 MiB / 280.85 MiB 100.00% 11.14 MiB/s                             
Start tidb instance:v7.1.0
The component `tidb` version v7.1.0 is not installed; downloading from repository.
download https://tiup-mirrors.pingcap.com/tidb-v7.1.0-linux-amd64.tar.gz 72.88 MiB / 72.88 MiB 100.00% 11.62 MiB/s                               
Waiting for tidb instances ready
192.168.8.171:4000 ... Done
The component `prometheus` version v7.1.0 is not installed; downloading from repository.
download https://tiup-mirrors.pingcap.com/prometheus-v7.1.0-linux-amd64.tar.gz 94.26 MiB / 94.26 MiB 100.00% 11.54 MiB/s                         
download https://tiup-mirrors.pingcap.com/grafana-v7.1.0-linux-amd64.tar.gz 50.12 MiB / 50.12 MiB 100.00% 11.77 MiB/s                            
Start tiflash instance:v7.1.0
The component `tiflash` version v7.1.0 is not installed; downloading from repository.
download https://tiup-mirrors.pingcap.com/tiflash-v7.1.0-linux-amd64.tar.gz 231.22 MiB / 231.22 MiB 100.00% 11.12 MiB/s                          
Waiting for tiflash instances ready
192.168.8.171:3930 ... Done

🎉 TiDB Playground Cluster is started, enjoy!

Connect TiDB:   mysql --comments --host 192.168.8.171 --port 4000 -u root
TiDB Dashboard: http://192.168.8.171:2379/dashboard
Grafana:        http://192.168.8.171:3000

到此,已经安装成功,下面来尝试连接登录:

[root@shawnyan ~]# mysql --comments --host 192.168.8.171 --port 4000 -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 407
Server version: 5.7.25-TiDB-v7.1.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> select version();
+--------------------+
| version()          |
+--------------------+
| 5.7.25-TiDB-v7.1.0 |
+--------------------+
1 row in set (0.00 sec)

mysql>

已经登录成功,并确认版本为 7.1、

总的来说,安装TiDB非常简单。只需要几个简单的步骤,就可以快速安装TiDB集群,并开始使用TiDB数据库。如果您需要更详细的信息,请参阅TiDB的官方文档。

举报

相关推荐

0 条评论