7
7
``` shell
8
8
curl http://{TiDBIP}:10080/status
9
9
```
10
+ ` ` ` shell
11
+ $curl http://127.0.0.1:10080/status
12
+ {
13
+ " connections" : 0,
14
+ " git_hash" : " f572e33854e1c0f942f031e9656d0004f99995c6" ,
15
+ " version" : " 5.7.10-TiDB-v2.1.0-rc.3-355-gf572e3385-dirty"
16
+ }
17
+ ` ` `
10
18
11
19
1. Get all metrics of TiDB
12
20
19
27
` ` ` shell
20
28
curl http://{TiDBIP}:10080/regions/meta
21
29
` ` `
30
+ ` ` ` shell
31
+ $curl http://127.0.0.1:10080/regions/meta
32
+ [
33
+ {
34
+ " leader" : {
35
+ " id" : 5,
36
+ " store_id" : 1
37
+ },
38
+ " peers" : [
39
+ {
40
+ " id" : 5,
41
+ " store_id" : 1
42
+ }
43
+ ],
44
+ " region_epoch" : {
45
+ " conf_ver" : 1,
46
+ " version" : 2
47
+ },
48
+ " region_id" : 4
49
+ }
50
+ ]
51
+ ` ` `
22
52
23
53
1. Get the table/index of hot regions
24
54
25
55
` ` ` shell
26
56
curl http://{TiDBIP}:10080/regions/hot
27
57
` ` `
58
+ ` ` ` shell
59
+ $curl http://127.0.0.1:10080/regions/hot
60
+ {
61
+ " read" : [
62
+
63
+ ],
64
+ " write" : [
65
+ {
66
+ " db_name" : " sbtest1" ,
67
+ " table_name" : " sbtest13" ,
68
+ " index_name" : " " ,
69
+ " flow_bytes" : 220718,
70
+ " max_hot_degree" : 12,
71
+ " region_count" : 1
72
+ }
73
+ ]
74
+ }
75
+ ` ` `
28
76
29
77
1. Get the information of a specific region by ID
30
78
31
79
` ` ` shell
32
80
curl http://{TiDBIP}:10080/regions/{regionID}
33
81
` ` `
82
+ ` ` ` shell
83
+ $curl http://127.0.0.1:10080/regions/4001
84
+ {
85
+ " end_key" : " dIAAAAAAAAEk" ,
86
+ " frames" : [
87
+ {
88
+ " db_name" : " test" ,
89
+ " is_record" : true,
90
+ " table_id" : 286,
91
+ " table_name" : " t1"
92
+ }
93
+ ],
94
+ " region_id" : 4001,
95
+ " start_key" : " dIAAAAAAAAEe"
96
+ }
97
+ ` ` `
34
98
35
99
1. Get regions Information from db.table
36
100
37
101
` ` ` shell
38
102
curl http://{TiDBIP}:10080/tables/{db}/{table}/regions
39
103
` ` `
104
+ ` ` ` shell
105
+ $curl http://127.0.0.1:10080/tables/test/t1/regions
106
+ {
107
+ " id" : 286,
108
+ " indices" : [],
109
+ " name" : " t1" ,
110
+ " record_regions" : [
111
+ {
112
+ " leader" : {
113
+ " id" : 4002,
114
+ " store_id" : 1
115
+ },
116
+ " peers" : [
117
+ {
118
+ " id" : 4002,
119
+ " store_id" : 1
120
+ }
121
+ ],
122
+ " region_epoch" : {
123
+ " conf_ver" : 1,
124
+ " version" : 83
125
+ },
126
+ " region_id" : 4001
127
+ }
128
+ ]
129
+ }
130
+ ` ` `
40
131
41
132
1. Get schema Information about all db
42
133
43
134
` ` ` shell
44
135
curl http://{TiDBIP}:10080/schema
45
136
` ` `
137
+ ` ` ` shell
138
+ $curl http://127.0.0.1:10080/schema
139
+ [
140
+ {
141
+ " charset" : " utf8mb4" ,
142
+ " collate" : " utf8mb4_bin" ,
143
+ " db_name" : {
144
+ " L" : " test" ,
145
+ " O" : " test"
146
+ },
147
+ " id" : 266,
148
+ " state" : 5
149
+ },
150
+ .
151
+ .
152
+ .
153
+ ]
154
+ ` ` `
46
155
47
156
1. Get schema Information about db
48
157
75
184
` ` ` shell
76
185
curl http://{TiDBIP}:10080/mvcc/key/{db}/{table}/{handle}
77
186
` ` `
187
+ ` ` ` shell
188
+ $curl http://127.0.0.1:10080/mvcc/key/test/t1/1
189
+ {
190
+ " info" : {
191
+ " writes" : [
192
+ {
193
+ " commit_ts" : 405179368526053380,
194
+ " short_value" : " CAICAkE=" ,
195
+ " start_ts" : 405179368526053377
196
+ }
197
+ ]
198
+ }
199
+ }
200
+ ` ` `
78
201
79
202
1. Get MVCC Information of the first key in the table with a specified start ts
80
203
81
204
` ` ` shell
82
205
curl http://{TiDBIP}:10080/mvcc/txn/{startTS}/{db}/{table}
83
206
` ` `
207
+ ` ` ` shell
208
+ $curl http://127.0.0.1:10080/mvcc/txn/405179368526053377/test/t1
209
+ {
210
+ " info" : {
211
+ " writes" : [
212
+ {
213
+ " commit_ts" : 405179368526053380,
214
+ " short_value" : " CAICAkE=" ,
215
+ " start_ts" : 405179368526053377
216
+ }
217
+ ]
218
+ },
219
+ " key" : " dIAAAAAAAAEzX3KAAAAAAAAAAQ=="
220
+ }
221
+ ` ` `
84
222
85
223
1. Get MVCC Information by a hex value
86
224
95
233
` ` `
96
234
* Hint: For the index column which column type is timezone dependent, e.g. ` timestamp` , convert its value to UTC
97
235
timezone.*
236
+ ` ` ` shell
237
+ $curl http://127.0.0.1:10080/mvcc/index/test/t1/idx/1\? a\= A
238
+ {
239
+ " info" : {
240
+ " writes" : [
241
+ {
242
+ " commit_ts" : 405179523374252037,
243
+ " short_value" : " MA==" ,
244
+ " start_ts" : 405179523374252036
245
+ }
246
+ ]
247
+ }
248
+ }
249
+ ` ` `
98
250
99
251
1. Scatter regions of the specified table, add a ` scatter-range` scheduler for the PD and the range is same as the table range.
100
252
@@ -121,12 +273,53 @@ timezone.*
121
273
` ` ` shell
122
274
curl http://{TiDBIP}:10080/info
123
275
` ` `
276
+ ` ` ` shell
277
+ $curl http://127.0.0.1:10080/info
278
+ {
279
+ " ddl_id" : " f7e73ed5-63b4-4cb4-ba7c-42b32dc74e77" ,
280
+ " git_hash" : " f572e33854e1c0f942f031e9656d0004f99995c6" ,
281
+ " ip" : " " ,
282
+ " is_owner" : true,
283
+ " lease" : " 45s" ,
284
+ " listening_port" : 4000,
285
+ " status_port" : 10080,
286
+ " version" : " 5.7.10-TiDB-v2.1.0-rc.3-355-gf572e3385-dirty"
287
+ }
288
+ ` ` `
124
289
125
290
1. Get TiDB cluster all servers information.
126
291
127
292
` ` ` shell
128
293
curl http://{TiDBIP}:10080/info/all
129
294
` ` `
295
+ ` ` ` shell
296
+ $curl http://127.0.0.1:10080/info/all
297
+ {
298
+ " all_servers_info" : {
299
+ " 275a19ae-d248-4dc0-b78c-6613a7509423" : {
300
+ " ddl_id" : " 275a19ae-d248-4dc0-b78c-6613a7509423" ,
301
+ " git_hash" : " f572e33854e1c0f942f031e9656d0004f99995c6" ,
302
+ " ip" : " 192.168.197.206" ,
303
+ " lease" : " 45s" ,
304
+ " listening_port" : 4001,
305
+ " status_port" : 10081,
306
+ " version" : " 5.7.10-TiDB-v2.1.0-rc.3-355-gf572e3385-dirty"
307
+ },
308
+ " f7e73ed5-63b4-4cb4-ba7c-42b32dc74e77" : {
309
+ " ddl_id" : " f7e73ed5-63b4-4cb4-ba7c-42b32dc74e77" ,
310
+ " git_hash" : " f572e33854e1c0f942f031e9656d0004f99995c6" ,
311
+ " ip" : " 192.168.197.206" ,
312
+ " lease" : " 45s" ,
313
+ " listening_port" : 4000,
314
+ " status_port" : 10080,
315
+ " version" : " 5.7.10-TiDB-v2.1.0-rc.3-355-gf572e3385-dirty"
316
+ }
317
+ },
318
+ " is_all_server_version_consistent" : true,
319
+ " owner_id" : " f7e73ed5-63b4-4cb4-ba7c-42b32dc74e77" ,
320
+ " servers_num" : 2
321
+ }
322
+ ` ` `
130
323
131
324
1. Enable/Disable TiDB server general log
132
325
0 commit comments