SLV 安装 - TiDB
SLV 安装 - TiDB

为什么选择 TiDB(MySQL 集群)?
TiDB 提供了一个水平可扩展的云原生 HTAP 数据库,支持 MySQL 协议。许多托管数据库服务对每次读写收费,这对延迟敏感的 Solana 工作负载来说很快就会变得成本过高。通过
slv install,您可以搭建自己的分布式 TiDB 集群,绕过供应商的速率限制,在避免意外高额账单的同时保持高吞吐量。亮点
- TiDB:https://www.pingcap.com/tidb/
- 兼容 MySQL 协议并支持自动分片,让您在使用熟悉的客户端的同时获得横向扩展性能。
- 内置 TiUP 管理和 TiDB Dashboard,开箱即用地提供集群健康状态可视化。
运行安装程序
在指定运行集群的目标主机后,从组件列表中选择 TiDB。
bash
$ slv install -i 1.1.1.1,
🚀 Installing software components...
? Select Software Component to Install (Redis)
Redis
❯ TiDB (MySQL Cluster)
Grafana
Prometheus
Node Exporter
Kafka Cluster$ slv install -i 1.1.1.1,
🚀 Installing software components...
? Select Software Component to Install (Redis)
Redis
❯ TiDB (MySQL Cluster)
Grafana
Prometheus
Node Exporter
Kafka Cluster注意:请将1.1.1.1替换为您自己服务器的 IP 地址。
查看详细信息
在 Ansible 开始之前,
slv 会显示 playbook 路径和 inventory,以便您仔细检查集群目标。CLI 还会提醒您,TiDB 的配置可能需要几分钟时间,具体取决于硬件性能。bash
🚀 Installing software components...
? Select Software Component to Install (Redis) › TiDB (MySQL Cluster)
✅ You selected: TiDB (MySQL Cluster)
📋 Installation Details:
Software: TiDB (MySQL Cluster)
Inventory: 1.1.1.1,
Playbook: /Users/fumi/.slv/template/0.9.800/ansible/cmn/software/install-tidb.yml
⚠️ a few minutes to 10 minutes may be required for TiDB installation depending on your server performance.
? Do you want to proceed with the installation? (y/N) ›🚀 Installing software components...
? Select Software Component to Install (Redis) › TiDB (MySQL Cluster)
✅ You selected: TiDB (MySQL Cluster)
📋 Installation Details:
Software: TiDB (MySQL Cluster)
Inventory: 1.1.1.1,
Playbook: /Users/fumi/.slv/template/0.9.800/ansible/cmn/software/install-tidb.yml
⚠️ a few minutes to 10 minutes may be required for TiDB installation depending on your server performance.
? Do you want to proceed with the installation? (y/N) ›观察 Ansible 执行过程
确认后,
slv 将控制权交给 Ansible,Ansible 会在每个主机上构建 TiDB 组件和支持服务。bash
🚀 Running ansible: ansible-playbook -i 1.1.1.1, -u solv /Users/fumi/.slv/template/0.9.800/ansible/cmn/software/install-tidb.yml
PLAY [Install and configure TiDB cluster] ************************************************************
TASK [Gathering Facts] *******************************************************************************🚀 Running ansible: ansible-playbook -i 1.1.1.1, -u solv /Users/fumi/.slv/template/0.9.800/ansible/cmn/software/install-tidb.yml
PLAY [Install and configure TiDB cluster] ************************************************************
TASK [Gathering Facts] *******************************************************************************验证端点
配置完成后,CLI 会打印连接详情,以便您可以立即将 TiDB 接入应用程序并确认仪表板可访问。
bash
✅ Installation completed successfully!
🌐 Access Information:
TiDB Endpoint: 1.1.1.1:4000 (MySQL Protocol)
Dashboard http://1.1.1.1:7301/dashboard/#/signin (HTTP Protocol)
🔑 Default credentials
Username: root
Password: <empty>✅ Installation completed successfully!
🌐 Access Information:
TiDB Endpoint: 1.1.1.1:4000 (MySQL Protocol)
Dashboard http://1.1.1.1:7301/dashboard/#/signin (HTTP Protocol)
🔑 Default credentials
Username: root
Password: <empty>仪表板
使用上述默认凭据登录 TiDB Dashboard(
http://1.1.1.1:7301/dashboard/#/signin)。在这里您可以监控集群负载、检查 SQL 语句并验证组件健康状态。