何隆昌 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
相关推荐
IT成长日记3 分钟前
【Docker基础】Docker数据卷管理:docker volume prune及其参数详解
运维·docker·容器·volume·prune
这儿有一堆花9 分钟前
Docker编译环境搭建与开发实战指南
运维·docker·容器
LuckyLay9 分钟前
Compose 高级用法详解——AI教你学Docker
运维·docker·容器
Uluoyu18 分钟前
redisSearch docker安装
运维·redis·docker·容器
IT成长日记4 小时前
【Docker基础】Docker数据持久化与卷(Volume)介绍
运维·docker·容器·数据持久化·volume·
热爱生活的猴子4 小时前
阿里云服务器正确配置 Docker 国内镜像的方法
服务器·阿里云·docker
FrankYoou8 小时前
Jenkins 与 GitLab CI/CD 的核心对比
java·docker
隆里卡那唔9 小时前
在dify中通过http请求neo4j时为什么需要将localhost变为host.docker.internal
http·docker·neo4j
疯子的模样9 小时前
Docker 安装 Neo4j 保姆级教程
docker·容器·neo4j
Lpy256912 小时前
Docker Desktop 安装到D盘(包括镜像下载等)+ 汉化
运维·docker·容器