何隆昌 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
相关推荐
cui_hao_nan7 小时前
Docker后端部署
运维·docker·容器
大苏打seven8 小时前
Docker学习笔记:Docker网络
笔记·学习·docker
小张是铁粉8 小时前
docker在Linux的安装遇到的问题
linux·docker·容器
没有名字的小羊10 小时前
8.Docker镜像讲解
运维·docker·容器·tomcat
木鱼时刻11 小时前
容器与 Kubernetes 基本概念与架构
容器·架构·kubernetes
企鹅侠客13 小时前
实践篇:14-构建 Node.js 应用程序镜像
docker·node.js·dockerfile
做一个AC梦13 小时前
Docker安装失败:Docker Desktop installation failed
运维·docker·容器
Shan120513 小时前
浅谈Docker Kicks in的应用
运维·docker·容器
Li&&Tao13 小时前
docker 常用命令
docker·容器·eureka
Jiude15 小时前
MinIO 社区版被故意阉割,Web管理功能全面移除。我来试试国产RustFS
后端·docker·架构