【TIDB】数据库集群检查
3.查看TIKV 的存储信息。4.组件端口变量默认端口说明。
·
1.检查默认数据库
[tidb@mysql1 tidb-ansible-4.0.7]$ mysql -u root -h 192.168.1.11 -P 4000
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| INFORMATION_SCHEMA |
| METRICS_SCHEMA |
| PERFORMANCE_SCHEMA |
| mysql |
| test |
+--------------------+
5 rows in set (0.00 sec)
2.查看版本
mysql> select tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.7
Edition: Community
Git Commit Hash: ed939f3f11599b5a38352c5c160c917df3ebf3eb
Git Branch: heads/refs/tags/v4.0.7
UTC Build Time: 2020-09-29 06:56:48
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)
3.查看TIKV 的存储信息
mysql> select STORE_ID,ADDRESS,STORE_STATE,STORE_STATE_NAME,CAPACITY,AVAILABLE,UPTIME from INFORMATION_SCHEMA.TIKV_STORE_STATUS;
+----------+--------------------+-------------+------------------+----------+-----------+------------------+
| STORE_ID | ADDRESS | STORE_STATE | STORE_STATE_NAME | CAPACITY | AVAILABLE | UPTIME |
+----------+--------------------+-------------+------------------+----------+-----------+------------------+
| 1 | 192.168.1.11:20160 | 0 | Up | 46.97GiB | 43.89GiB | 31m30.2274502s |
| 4 | 192.168.1.13:20160 | 0 | Up | 46.97GiB | 44.06GiB | 31m30.887650233s |
| 5 | 192.168.1.12:20160 | 0 | Up | 46.97GiB | 44.07GiB | 31m30.909608776s |
+----------+--------------------+-------------+------------------+----------+-----------+------------------+
3 rows in set (0.00 sec)
4.组件端口变量默认端口说明
TiDB tidb_port 4000 --应用及DBA 工具访问通信端口
TiDB tidb_status_port 10080 --TiDB 状态信息上报通信端口
TiKV tikv_port 20160 --TiKV 通信端口
TiKV tikv_status_port 20180 --上报TiKV 状态的通信端口
PD pd_client_port 2379 --提供TiDB 和PD 通信端口
PD pd_peer_port 2380 --PD 集群节点间通信端口
Pump pump_port 8250 --Pump 通信端口
Prometheus prometheus_port 9090 --Prometheus 服务通信端口
Pushgateway pushgateway_port 9091 --TiDB, TiKV, PD 监控聚合和上报端口
Node_exporter node_exporter_port 9100 --TiDB 集群每个节点的系统信息上报通信端口
Blackbox_exporter blackbox_exporter_port 9115 --Blackbox_exporter 通信端口,用于TiDB 集群端口监控
Grafana grafana_port 3000 --Web 监控服务对外服务和客户端(浏览器)访问端口
Kafka_exporter kafka_exporter_port 9308 --Kafka_exporter 通信端口,用于监控binlog Kafka 集群
5.插入数据验证。
mysql> insert into my_tab1 values (1,'薛双奇'),(2,'雪霜期2');
Query OK, 2 rows affected (0.03 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> select * from my_tab1;
+------+------------+
| id | name |
+------+------------+
| 1 | 薛双奇 |
| 2 | 雪霜期2 |
+------+------------+
2 rows in set (0.00 sec)

DAMO开发者矩阵,由阿里巴巴达摩院和中国互联网协会联合发起,致力于探讨最前沿的技术趋势与应用成果,搭建高质量的交流与分享平台,推动技术创新与产业应用链接,围绕“人工智能与新型计算”构建开放共享的开发者生态。
更多推荐
所有评论(0)