当前位置:网站首页>TiDB - 快速入门,集群搭建
TiDB - 快速入门,集群搭建
2022-06-10 18:41:00 【4xx.me】
TiDB 是开源分布式关系型数据库,是一款同时支持在线事务处理与在线分析处理 (Hybrid Transactional and Analytical Processing, HTAP)的融合型分布式数据库产品,具备水平扩容或者缩容、金融级高可用、实时 HTAP、云原生的分布式数据库、兼容 MySQL 5.7 协议和 MySQL 生态等重要特性。目标是为用户提供一站式 OLTP (Online Transactional Processing)、OLAP (Online Analytical Processing)、HTAP 解决方案。TiDB 适合高可用、强一致要求较高、数据规模较大等各种应用场景。
本文目标
- 初步了解TiDB
- 使用TiUP在单机上模拟生产环境搭建TiDB集群步骤
- 基本使用
初步了解TiDB
- TiDB是 开源的 分布式的 关系型的 数据库
- TiDB兼容 MySQL 5.7 协议
- TiDB具备水平扩容和缩容
- 官网:https://pingcap.com/
使用TiUP在单机上模拟生产环境搭建TiDB集群步骤
官方快速入门教程:https://docs.pingcap.com/zh/tidb/stable/quick-start-with-tidb 18年10月写的一篇搭建TiDB的教程:https://4xx.me/archives/67.html
1. TiUP是一个集群管理工具,推荐部署在中控机
2. 准备一台部署主机,推荐安装 CentOS 7.3 及以上版本。(可以和中控机在一起)
3. 下载并安装 TiUP
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh
## 重新声明全局环境变量
source .bash_profile
## 确认 TiUP 工具是否安装
which tiup
## 安装 TiUP cluster 组件
tiup cluster
## 更新 TiUP cluster 组件至最新版本
tiup update --self && tiup update cluster4. 新建一个配置文件 topology.yaml。ip改成需要部署的机器的ip,注意ssh端口
- 提供一份
topology.yaml模板:topology.yaml
## Global variables are applied to all deployments and used as the default value of
## the deployments if a specific deployment value is missing.
global:
user: "tidb"
ssh_port: 22
deploy_dir: "/data/tidb-deploy"
data_dir: "/data/tidb-data"
## Monitored variables are applied to all the machines.
monitored:
node_exporter_port: 9100
blackbox_exporter_port: 9115
server_configs:
tidb:
log.slow-threshold: 300
tikv:
readpool.storage.use-unified-pool: false
readpool.coprocessor.use-unified-pool: true
pd:
replication.enable-placement-rules: true
tiflash:
logger.level: "info"
pd_servers:
- host: 192.168.137.13
tidb_servers:
- host: 192.168.137.13
tikv_servers:
- host: 192.168.137.13
port: 20160
status_port: 20180
monitoring_servers:
- host: 192.168.137.135. 执行集群部署命令
### 查看tidb版本列表
tiup list tidb
### tidb-test 为集群名称,v4.0.4 当前安装的版本
tiup cluster deploy tidb-test v4.0.4 ./topology.yaml --user root -p
### 按照引导,输入”y”及 root 密码,来完成部署6. 启动集群
### tidb-test 为集群名称
tiup cluster start tidb-test7. 查看集群的拓扑结构和状态
tiup cluster display tidb-test8. 访问web监控后台,默认账号root,密码空
http://192.168.137.13:2379/dashboard/#/signin
基本使用
1. 使用 Navicat Premium 15注册版 连接数据库,默认端口4000,账号root,密码空
2. 修改或设置密码
## set password for 账号=password('新密码');
set password for root=password('root');边栏推荐
- 腾讯Libco协程开源库 源码分析(二)---- 柿子先从软的捏 入手示例代码 正式开始探究源码
- WordPress 6.0 "Arturo Arturo" release
- C (pointer-02)
- Yuntu says that every successful business system cannot be separated from apig
- [C language] accidentally write a bug? Mortals teach you how to write good code [explain debugging skills in vs]
- [C language] have you mastered these classic questions? Learn these questions in one article
- Win32 child window parent window window owner
- Classic 6 pain points of data governance? This book teaches you to solve
- 最长上升子序列(LIS)洛谷
- 我的第一部作品:TensorFlow2.x
猜你喜欢

Code solution of simplex method (including super detailed code notes and the whole flow chart)

领域驱动设计(六) - 架构设计浅谈

中国 璞富腾酒店及度假村旗下酒店推出全新水疗产品共庆6月11日全球健康日

单纯形法代码求解(含超详细代码注释和整个流程图)
![[advanced C language] data storage [Part 2] [ten thousand words summary]](/img/b5/4e346cb971b0574faf0164d3dcd9c8.png)
[advanced C language] data storage [Part 2] [ten thousand words summary]

一文带你了解J.U.C的FutureTask、Fork/Join框架和BlockingQueue

c指针(面试经典题目练习)

Go语学习笔记 - 跨域配置、全局异常捕获 | Web框架Gin(四)

Vs solution to garbled Chinese characters read from txt files (super simple)

c(指针-02)
随机推荐
基于SSM流量计量云系统的设计与实现.rar(论文+项目源码)
一文带你了解J.U.C的FutureTask、Fork/Join框架和BlockingQueue
Live broadcast preview | deconstruct OLAP! The new multidimensional analysis architecture paradigm is fully open! Apache Doris will bring five big issues!
Basic model and properties of SAR echo signal
云图说|每个成功的业务系统都离不开APIG的保驾护航
Key and encryption mechanism in financial industry
c(指针-02)
《Single Image Haze Removal Using Dark Channel Prior》去雾代码实现分析
基于ssm在线订餐系统设计与实现.rar(项目源码)
100003字,带你解密 双11、618电商大促场景下的系统架构体系
Monotonic stack structure
Debugging skills
Openssl1.1.1 vs2013 compilation tutorial
Apicloud visual development novice graphic tutorial
SAR图像聚焦质量评价插件
【C语言进阶】指针的进阶【上篇】
SAR image focusing quality evaluation plug-in
lingo12软件下载及lingo语言入门资源
面试中经常问到的几个问题,快来看看能答对几道吧
Yuntu says that every successful business system cannot be separated from apig