何隆昌 docker部署TiDB

docker部署TiDB

https://docs.pingcap.com/zh/tidb/stable/quick-start-with-tidb#在单机上模拟部署生产环境集群

1、下载并安装 TiUP。

java 复制代码
curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | sh    会在当目录生成两个文件夹:tidb-data,卸载的时候记得删除

2、声明全局环境变量:
source /root/.bash_profile  (隐藏文件)

安装 TiUP 的 cluster 组件:


tiup cluster

如果机器已经安装 TiUP cluster,需要更新软件版本:

tiup update --self && tiup update cluster
由于模拟多机部署,需要通过 root 用户调大 sshd 服务的连接数限制:

修改 /etc/ssh/sshd_config 将 MaxSessions 调至 20。

重启 sshd 服务:

service sshd restart

执行集群部署命令:
tiup cluster deploy tidb_cluster v7.1.2 ./topo.yaml --user root -p YThx@198201

启动集群:
tiup cluster start tidb_cluster    这里经常报错:最少要6个G,而且连接要关闭防火墙(systemctl stop firewalld.service)或者打开端口  firewall-cmd --zone=public --add-port=4000/tcp --permanent
停止集群:
tiup cluster stop tidb_cluster


tiup cluster clean tidb_cluster --all

要删除 TiDB 集群,您可以执行以下步骤:

停止 TiDB 集群:使用 tiup cluster stop tidb_cluster 命令停止 TiDB 集群,确保所有的 TiDB、TiKV 和 PD 进程都已停止运行。

卸载 TiDB 集群:使用 tiup cluster destroy tidb_cluster 命令卸载 TiDB 集群,这将删除 TiDB 集群的所有组件、数据和配置。

必须输入   Yes, I know my cluster and data will be deleted.     包括后面的. 才能删除

还要记得之前下载的 tidb-data等物理文件


cp id_rsa /root/.tiup/storage/cluster/clusters/tidb_cluster/ssh/id_rsa




访问 TiDB 数据库,密码为空:
mysql -h 10.0.1.1 -P 4000 -u root
相关推荐
FOREVER-Q1 分钟前
Windows 下 Docker Desktop 快速入门与镜像管理
运维·服务器·windows·docker·容器
IT瑞先生29 分钟前
Docker容器使用手册——入门篇(上)
运维·docker·容器
青柚~3 小时前
【鲲鹏服务器麒麟系统arm架构部署docker】
服务器·arm开发·docker·架构
喜欢你,还有大家4 小时前
Docker-存储
运维·docker·容器
Lucis__4 小时前
STL设计模式探秘:容器适配器&仿函数
c++·容器·stl·仿函数
人工智能训练5 小时前
Docker中容器的备份方法和步骤
linux·运维·人工智能·ubuntu·docker·容器·nvidia
bing.shao5 小时前
Goer-Docker系列-1-管理工具
docker·容器·eureka
MasonYyp5 小时前
Docker安装和使用kkfileview
运维·docker·容器
王煜苏5 小时前
contos7安装dokcer遇到的坑,docker-composer
docker·eureka·composer
DreamLife☼6 小时前
Docker-Dockerfile 完全指南:编写最佳实践的镜像
docker·镜像构建·多阶段构建·docker 安全·最小化镜像·非 root 用户·构建缓存