何隆昌 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
相关推荐
众俗24 分钟前
Linux+Docker+SpringBoot 简单部署
linux·spring boot·docker
cc20229281 小时前
ingress概念和实际运用
容器·kubernetes·k8s
九皇叔叔3 小时前
从零了解 Dockerfile:构建属于你的 Docker 镜像
运维·docker·容器
susu10830189113 小时前
windows系统下docker desktop创建容器指定ip
运维·docker·容器
水冗水孚3 小时前
50多张图详细记录——使用Jenkins完成前端项目CICD自动化部署教程(不踩坑!)
前端·docker·jenkins
Garc8 小时前
linux Debian 12 安装 Docker(手动)
linux·docker·debian
苦逼IT运维8 小时前
Kubernetes 双层 Nginx 容器环境下的 CORS 问题及解决方案(极端情况)
运维·nginx·容器·kubernetes·jenkins·运维开发·ci
janthinasnail8 小时前
使用Docker搭建YApi接口管理平台
docker·api接口文档
栗子~~8 小时前
家庭版 windows WSL2 安装Ubuntu 、并在这基础上部署docker、通过本地代理进行联网
windows·ubuntu·docker
熙客9 小时前
Docker核心文件:DockerCompose文件
docker·容器