当前位置: 首页 > wzjs >正文

建设网站的目标客户群域名app

建设网站的目标客户群,域名app,云南昆明百度推广公司,十大手机必备软件TiDB数据库提供了以下几款命令行工具,用于操作和管理TiDB集群中的节点。 这几款工具主要包括: TiDB的命令行工具:tidb-ctlTiKV的命令行工具:tikv-ctlPD的命令行工具:pd-ctl集群管理工具:TiUP 视频讲解如下…

在这里插入图片描述

TiDB数据库提供了以下几款命令行工具,用于操作和管理TiDB集群中的节点。 这几款工具主要包括:

  • TiDB的命令行工具:tidb-ctl
  • TiKV的命令行工具:tikv-ctl
  • PD的命令行工具:pd-ctl
  • 集群管理工具:TiUP
视频讲解如下

【赵渝强老师】TiDB提供的命令行工具

下面分别进行介绍

一、 TiDB的命令行工具:tidb-ctl

TiDB Control(简称tidb-ctl)是TiDB的命令行工具,用于获取TiDB状态信息,多用于调试。tidb-ctl工具位于中控机的.tiup/components/ctl/v8.5.1目录下。下面通过几个示例来演示该工具的使用方法。

(1)查看scott数据库中所有表的结构信息。

# ./tidb-ctl schema --host 192.168.79.11 in scott
输出的信息如下:
[{"id": 121,"name": {"O": "dept","L": "dept"},"charset": "utf8mb4","collate": "utf8mb4_bin","cols": [{"id": 1,"name": {"O": "deptno","L": "deptno"},"offset": 0,"origin_default": null,"origin_default_bit": null,"default": null,......"comment": "","hidden": false,"change_state_info": null,"version": 2},{"id": 2,"name": {"O": "dname","L": "dname"},......},{"id": 3,"name": {"O": "loc","L": "loc"},......}],......},{"id": 123,"name": {"O": "emp","L": "emp"},.....}
]

(2)查看scott数据库中部门表dept的结构信息。

# ./tidb-ctl schema --host 192.168.79.11 in scott -n dept

(3)查看scott数据库中员工表emp的Region信息。

# ./tidb-ctl table regions --host 192.168.79.11 -d scott -t emp
输出的信息如下:
{"name": "emp","id": 123,"record_regions": [{"region_id": 3760,"leader": {"id": 3763,"store_id": 5},"peers": [{"id": 3761,"store_id": 1},{"id": 3762,"store_id": 4},{"id": 3763,"store_id": 5}],"region_epoch": {"conf_ver": 5,"version": 77}}],"indices": [{"name": "fk_1","id": 1,"regions": [{"region_id": 3760,"leader": {"id": 3763,"store_id": 5},"peers": [{"id": 3761,"store_id": 1},{"id": 3762,"store_id": 4},{"id": 3763,"store_id": 5}],"region_epoch": {"conf_ver": 5,"version": 77}}]}]
}提示:通过下面的方式也可以查看表的Region信息。
tidb> show table emp regions \G;
*************************** 1. row ***************************REGION_ID: 3760START_KEY: t_113_END_KEY: 78000000LEADER_ID: 3763LEADER_STORE_ID: 5PEERS: 3761, 3762, 3763SCATTERING: 0WRITTEN_BYTES: 0READ_BYTES: 7080APPROXIMATE_SIZE(MB): 2APPROXIMATE_KEYS: 4208
SCHEDULING_CONSTRAINTS: SCHEDULING_STATE: 
1 row in set (0.011 sec)

二、 TiKV的命令行工具:tikv-ctl

TiKVControl(以下简称tikv-ctl)是TiKV的命令行工具,用于管理TiKV集群。如果是使用TiUP部署的集群。该命令行工具在中控机的~/.tiup/components/ctl/{VERSION}/目录下。因此首先在中控机上将tikv-ctl复制到TiKV的节点上。

# cd /root/.tiup/components/ctl/v8.5.1
# scp tikv-ctl root@192.168.79.11:/usr/bin提示:tikv-ctl也可以通过指定--host参数运行在远程模式下。

下面通过具体的示例来演示如何使用tikv-ctl。
(1)在中控机上查看集群的TiKV节点的数据存储目录信息。

# tiup cluster display mytidb-cluster -R tikv
输出的信息如下:
Cluster type:       tidb
Cluster name:       mytidb-cluster
Cluster version:    v8.5.1
Deploy user:        tidb
SSH type:           builtin
ID                   Role  ...  Data Dir               ...
--                   ----  ...  --------               ...
192.168.79.11:20160  tikv  ...  /tidb-data/tikv-20160  ...
192.168.79.12:20160  tikv  ...  /tidb-data/tikv-20160  ...
192.168.79.13:20160  tikv  ...  /tidb-data/tikv-20160  ...
Total nodes: 3

(2)在TiKV节点上检查Regions是否健康

# tikv-ctl --data-dir=/tidb-data/tikv-20160 bad-regions
将出现下面的错误信息:
Failed to lock file: Resource temporarily unavailable (os error 11), 
maybe another instance is using this directory.提示:该检查命令是一个脱机命令,因此需要通过下面的命令停止TiDB集群。
# tiup cluster stop mytidb-cluster重新执行上面的命令将输出下面的结果:
all regions are healthy

(3)查看TiKV上所有的键值对

-- 分页显示键值对
# tikv-ctl --data-dir=/tidb-data/tikv-20160 raw-scan | more-- 将TiKV上所有的键值对转向输出到文件
# tikv-ctl --data-dir=/tidb-data/tikv-20160 raw-scan > /root/kv.txt
输出内容如下所示:
key: "\001\001", value: "\010\346\221\216\351\204\312\337\340g\020\004"
key: "zmDB:1\000\000\000\377\000\373\000\000\000\000\000\000\377\000hTable:\37710\377\000\000\000\000\000\377\
000\000\000\367\000\000\000\000\373\371\252\320\252\025w\377\366", value: "{\"id\":10,\"name\":{\"O\":\"db\",\
"L\":\"db\"},\"charset\":\"utf8mb4\",\"collate\":\"utf8mb4_bin\",\"cols\":[{\"id\":1,\"name\":{\"O\":\"Host\",
\"L\":\"host\"},\"offset\":0,\"origin_default\":null,\"origin_default_bit
......

(4)通过Key查看Value的值。

# tikv-ctl --data-dir=/tidb-data/tikv-20160 print -k "\001\001"输出的信息如下:
value: \010\346\221\216\351\204\312\337\340g\020\004

(5)查看TiKV上的Region大小。

-- 查看所有Region的大小
# tikv-ctl --data-dir=/tidb-data/tikv-20160 size
输出的信息如下:
......
region id: 3760
cf default region size: 1.606MiB
cf write region size: 32626B
cf lock region size: 0B
region id: 8874
cf default region size: 0B
cf write region size: 3404B
cf lock region size: 0B
......-- 查看Region ID为8874的大小
# tikv-ctl --data-dir=/tidb-data/tikv-20160 size -r 8874
输出的信息如下:
region id: 8874
cf default region size: 0B
cf write region size: 3404B
cf lock region size: 0B

《TiDB数据库从零开始》

三、 PD的命令行工具:pd-ctl

PD Control(简称:pd-ctl)是PD的命令行工具,用于获取集群状态信息和调整集群。tidb-ctl工具位于中控机的.tiup/components/ctl/v8.5.1目录下。下面通过几个简单的示例来演示其用法。
(1)获取TiDB集群的状态信息。

# ./pd-ctl cluster status --pd http://192.168.79.11:2379输出的信息如下:
{"raft_bootstrap_time": "2025-02-28T17:13:53.332180613+08:00","is_initialized": true,"replication_status": ""
}

(2)获取TiDB集群中的Store信息,即:TiKV节点和TIFlash节点。

# ./pd-ctl store check up --pd http://192.168.79.11:2379
输出的信息如下:
{"count": 6,"stores": [{"store": {"id": 1,"address": "192.168.79.13:20160","labels": [{"key": "host","value": "Chongqing"}],"version": "8.5.1","peer_address": "192.168.79.13:20160","status_address": "192.168.79.13:20180",......"state_name": "Up"},"status": {"capacity": "45.02GiB","available": "34.36GiB","used_size": "1.286GiB","leader_count": 3,"leader_weight": 1,"leader_score": 3,"leader_size": 3,"region_count": 7,......}},{"store": {"id": 4,"address": "192.168.79.11:20160","labels": [{"key": "host","value": "Beijing"}],......},"status": {......}},{"store": {"id": 5,"address": "192.168.79.12:20160","labels": [{"key": "host","value": "Shanghai"}],......},"status": {......}},{"store": {"id": 277,"address": "192.168.79.11:3930","labels": [{"key": "engine","value": "tiflash"},{"key": "zone","value": "beijing"}],......},"status": {......}},{"store": {"id": 278,"address": "192.168.79.12:3930","labels": [{"key": "engine","value": "tiflash"},{"key": "zone","value": "shanghai"}],......},"status": {......}},{"store": {"id": 279,"address": "192.168.79.13:3930","labels": [{"key": "engine","value": "tiflash"},{"key": "zone","value": "chongqing"}],......},"status": {......}}]
}

四、 集群管理工具:TiUP

从TiDB v4.0起,提供了包管理工具TiUP,负责管理TiDB、PD、TiKV等组件。只需通过TiUP命令即可运行这些组件,显著降低了管理难度。下面展示了TIUP的帮助信息。

# tiup --help
输出信息如下:
......
Usage:tiup [flags] <command> [args...]tiup [flags] <component> [args...]tiup [command]
......
Available Commands:install     Install a specific version of a componentlist        List the available TiDB components or versionsuninstall   Uninstall components or versions of a componentupdate      Update tiup components to the latest versionstatus      List the status of instantiated componentsclean       Clean the data of instantiated componentsmirror      Manage a repository mirror for TiUP componentstelemetry   Controls things about telemetryenv         Show the list of system environment variable that related to TiUPhistory     Display the historical execution record of TiUP, 
displays 100 lines by defaultlink        Link component binary to $TIUP_HOME/bin/unlink      Unlink component binary to $TIUP_HOME/bin/help        Help about any commandcompletion  Generate the autocompletion script for the specified shell
......提示:TIUP的具体使用方法将在后续进行详细介绍。

《TiDB数据库从零开始》


文章转载自:

http://AXKHIoe8.yrmgh.cn
http://2Tx0hGXd.yrmgh.cn
http://WBpg21KH.yrmgh.cn
http://yeMdMyj3.yrmgh.cn
http://I6FPn3TA.yrmgh.cn
http://jUhtHJth.yrmgh.cn
http://9qt5YK65.yrmgh.cn
http://FSjZkBR8.yrmgh.cn
http://S8xTwpvZ.yrmgh.cn
http://1CGGc8R7.yrmgh.cn
http://kNN98kra.yrmgh.cn
http://8GATBeoU.yrmgh.cn
http://CeVl9irR.yrmgh.cn
http://kr2QEPCF.yrmgh.cn
http://Ir58AiBa.yrmgh.cn
http://V1bPCuPx.yrmgh.cn
http://M7KQXgCB.yrmgh.cn
http://g5wyNNjX.yrmgh.cn
http://GSI7KGAz.yrmgh.cn
http://FwjTxxc9.yrmgh.cn
http://RDO7iMDZ.yrmgh.cn
http://ltpvW0BT.yrmgh.cn
http://6zTzojN2.yrmgh.cn
http://SQnQnsYa.yrmgh.cn
http://Hd1yqp3B.yrmgh.cn
http://xMFCHi2N.yrmgh.cn
http://CNuTxgrm.yrmgh.cn
http://Z5lZkECi.yrmgh.cn
http://fAIPZMYQ.yrmgh.cn
http://44ThM0b8.yrmgh.cn
http://www.dtcms.com/wzjs/768177.html

相关文章:

  • 二手书网站开发设计wordpress 导航别名
  • 网站建设公司宝安上海网站建设网页设计
  • 网站这么建设怎么看网站做没做seo
  • 鞍山网站建设企业南宁网站建设公司seo优化
  • 代发网站建设淘宝天猫优惠券网站建设费用
  • 织梦快速做双语网站公司名怎么取名比较旺
  • 珠海seo海网站建设深圳优化seo排名
  • 网站建设管理工作经验介绍wordpress国外主题 雅黑
  • 社科联网站建设网站开发软件中文版
  • 无锡模板建站wordpress 移动端网页
  • 免费中文网站模板html江西网站建设技术
  • 做减肥餐的网站wordpress连连支付
  • thinkphp 微网站开发洛阳新光建站系统
  • 自己怎么在网上做网站招生网站转换率低
  • 珠海网站建设哪家权威计算机前端开发就业方向
  • 开发一个网站的过程是什么网站百度收录怎么做
  • 网络营销怎么做网站儿童才艺网站建设模板
  • 网站制作公司下逻辑网络设计报告
  • iis停止单个网站苏州推广有限公司
  • 知名高端网站建设深圳宝安区有几个镇
  • 注册网站账号违法吗百度宿迁市建设局网站
  • 个人开网站深圳网站制作的公司有哪些
  • 深圳南山区网站建设公司安装wordpress导入工具
  • php语言 电商网站建设安徽省建设工程信息网站进不了
  • 沈阳网站开发招聘提高怎样做网站的外链
  • 南京企业网站开发费用申请网站优化搜索排名
  • 交互网站设计wordpress 询价按钮
  • 揭阳网站建设公司哪个好模版网站建设步骤详解
  • 诚信企业品牌网站建设wordpress获取指定分类的图像描述
  • 网站建设专业用语wordpress 4 安装