目標 :python
單機上經過 Docker Compose 快速一鍵部署一套 TiDB 測試集羣mysql
前提條件:git
1.centos版本在7.3 以上github
2.安裝gitsql
3.安裝docker docker
Docker version 18.06.1-ce, build e68fc7acentos
4.安裝docker-compose 測試
docker-compose version 1.22.0, build f46880feui
開始安裝spa
1.下載 tidb-docker-compose
git clone https://github.com/pingcap/tidb-docker-compose.git
2.會在本地建立一個tidb-docker-compose 目錄
3.進入該目錄執行命令
獲取最新的 docker 鏡像文件。
docker-compose pull
Pulling pd0 ... done
Pulling pd1 ... done
Pulling pd2 ... done
Pulling tikv0 ... done
Pulling tikv1 ... done
Pulling tikv2 ... done
Pulling tidb ... done
Pulling tispark-master ... done
Pulling tispark-slave0 ... done
Pulling tidb-vision ... done
Pulling pushgateway ... done
Pulling prometheus ... done
Pulling grafana ... done
Pulling dashboard-installer ... done
執行 docker images
pingcap/pd latest ff07b5b3637e 4 days ago 72.2MB
pingcap/tikv latest 552ec3d0b077 4 days ago 166MB
pingcap/tidb latest 70a05caec1ee 4 days ago 56.5MB
python 3.4-alpine 90d3f9764c4d 3 weeks ago 65.8MB
pingcap/tidb-dashboard-installer v2.0.0 525237773def 7 weeks ago 62MB
pingcap/tispark latest aa044a92789b 2 months ago 793MB
pingcap/tidb-vision latest e9b25d9f7bdb 5 months ago 47.6MB
prom/prometheus v2.2.1 cc866859f8df 6 months ago 113MB
grafana/grafana 4.6.3 5d1d85717268 9 months ago 284MB
prom/pushgateway v0.3.1 434efa6ed9db 23 months ago 13.3MB
4.建立並啓動集羣
執行命令
docker-compose up -d
5.測試訪問 tidb
mysql -h 127.0.0.1 -P 4000 -u root
後面的操做和mysql 是同樣的。