当前位置:网站首页>TiDB跨数据中心部署拓扑
TiDB跨数据中心部署拓扑
2022-07-02 11:56:00 【添香小铺】
本文以典型的两地三中心为例,介绍跨数据中心部署的拓扑以及关键参数。本文示例所涉及的城市是上海(即 sha)和北京(即 bja 和 bjb)。
拓扑信息
| 实例 | 个数 | 物理机配置 | BJ IP | SH IP | 配置 |
|---|---|---|---|---|---|
| TiDB | 5 | 16 VCore 32GB * 1 | 10.0.1.1 10.0.1.2 10.0.1.3 10.0.1.4 | 10.0.1.5 | 默认端口 全局目录配置 |
| PD | 5 | 4 VCore 8GB * 1 | 10.0.1.6 10.0.1.7 10.0.1.8 10.0.1.9 | 10.0.1.10 | 默认端口 全局目录配置 |
| TiKV | 5 | 16 VCore 32GB 2TB (nvme ssd) * 1 | 10.0.1.11 10.0.1.12 10.0.1.13 10.0.1.14 | 10.0.1.15 | 默认端口 全局目录配置 |
| Monitoring & Grafana | 1 | 4 VCore 8GB * 1 500GB (ssd) | 10.0.1.16 | 默认端口 全局目录配置 |
拓扑模版
以上 TiDB 集群拓扑文件中,详细的配置项说明见通过 TiUP 部署 TiDB 集群的拓扑文件配置。
关键参数配置
本节介绍跨数据中心部署 TiDB 集群的关键参数配置。
TiKV 参数
设置 gRPC 的压缩格式,默认为
none。为提高跨机房部署场景的目标节点间 gRPC 包的传输速度,建议设置为 gzip 格式。server.grpc-compression-type: gziplabel 配置
由于采用跨机房部署 TiKV,为了避免物理机宕机导致 Raft Group 默认的 5 副本中丢失 3 副本,使集群不可用的问题,可以通过 label 来实现 PD 智能调度,保证同中心、同机柜、同机器 TiKV 实例不会出现 Raft Group 有 3 副本的情况。
TiKV 配置
相同物理机配置相同的 host 级别 label 信息:
config: server.labels: zone: bj dc: bja rack: rack1 host: host2防止异地 TiKV 节点发起不必要的 Raft 选举,需要将异地 TiKV 节点发起选举时经过最少的 tick 个数和最多经过的 tick 个数都调大,这两个参数默认设置均为
0。raftstore.raft-min-election-timeout-ticks: 1000 raftstore.raft-max-election-timeout-ticks: 1020
PD 参数
PD 元数据信息记录 TiKV 集群的拓扑信息,根据四个维度调度 Raft Group 副本。
replication.location-labels: ["zone","dc","rack","host"]调整 Raft Group 的副本数据量为 5 ,保证集群的高可用性。
replication.max-replicas: 5拒绝异地机房 TiKV 的 Raft 副本选举为 Leader。
label-property: reject-leader: - key: "dc" value: "sha"注意
TiDB 5.2 及以上版本默认不支持
label-property配置。若要设置副本策略,请使用 Placement Rules。
有关 Label 的使用和 Raft Group 副本数量,详见通过拓扑 label 进行副本调度。
注意
- 无需手动创建配置文件中的
tidb用户,TiUP cluster 组件会在目标主机上自动创建该用户。可以自定义用户,也可以和中控机的用户保持一致。 - 如果部署目录配置为相对路径,会部署在用户家目录下。
边栏推荐
- Contrôleur pour threejs cube Space Basic Controller + Inertial Control + Flight Control
- STM32库函数进行GPIO初始化
- C language exercises - (array)
- About text selection in web pages and counting the length of selected text
- taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface
- [Space & single cellomics] phase 1: single cell binding space transcriptome research PDAC tumor microenvironment
- ##51单片机实验之简易验证码发生器
- Kityformula editor configure font size and spacing
- 实现一个多进程并发的服务器
- btrace-(字节码)动态跟踪工具
猜你喜欢

Thoroughly master prototype__ proto__、 Relationship before constructor (JS prototype, prototype chain)

Introduction to mathjax (web display of mathematical formulas, vector)

【NOI模拟赛】刮痧(动态规划)

geoserver离线地图服务搭建和图层发布

Fundamentals of software testing

c语言入门--数组

天猫商品详情接口(APP,H5端)

How does CTO help the business?

Large top heap, small top heap and heap sequencing

【C语言】详解指针的初阶和进阶以及注意点(1)
随机推荐
tmall.product.schema.get( 产品信息获取schema获取 ),淘宝店铺上传商品API接口,淘宝商品发布接口,淘宝商品上传API接口,店铺上传接口,oAuth2.0接口
info [email protected]: The platform “win32“ is incompatible with this module.
[development environment] install the visual studio community 2013 development environment (download the installation package of visual studio community 2013 with update 5 version)
Base64 编码原来还可以这么理解
C language exercises - (array)
数据库内容输出有问题怎么解决
LeetCode 209. 长度最小的子数组
buuctf-pwn write-ups (7)
STM32库函数进行GPIO初始化
Threejs controller cube space basic controller + inertia control + flight control
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
广州市应急管理局发布7月高温高湿化工安全提醒
Dragonfly low code security tool platform development path
【NOI模拟赛】伊莉斯elis(贪心,模拟)
Reuse and distribution
数据库连接池和数据源
牛客练习赛101
taobao. trades. sold. Get query the transaction data that the seller has sold (according to the creation time), Taobao store sales order query API interface, Taobao R2 interface, Taobao oauth2.0 trans
Points clés de l'examen de principe de compilation pour l'année scolaire 2021 - 2022 [Université chinoise d'outre - mer]
3. Function pointers and pointer functions