1、安装Docker
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
2、安装并启动 Docker-CE
sudo yum install docker-ce
sudo systemctl enable docker
sudo systemctl start docker
3、下载 tidb-docker-compose
git clone https://github.com/pingcap/tidb-docker-compose.git
4、启动
cd tidb-docker-compose && docker- compose pull #获取最新的Docker镜像
docker-compose up -d
5、访问
mysql -h 127.0.0.1 -P 4000 -u root
可能遇到的问题
1. docker-compose命令无效
解决:
yum -y install epel-release
yum -y install python-pip
pip install docker-compose
参考:
https://github.com/pingcap/docs-cn/blob/master/op-guide/docker-compose.md
https://blog.csdn.net/qq_32447321/article/details/76512137
https://www.cnblogs.com/myzony/p/9071210.html