TIDB IS NOT RECOMMENDED TO RUN AS ROOT
To use this guide you’ll need a working installation of Ansible version 2.2 or later and pip install Jinja2==2.7.2 MarkupSafe==0.11
.
(installation reference)
After the installation is complete, you can run the following command to check ansible version:
$ ansible --version
ansible 2.2.2.0
-
modify inventory.ini
- if deploying via normal user:
- change variable
ansible_user
to your deploy account (access sudo command).
- change variable
- if deploying via root:
- uncomment variable
ansible_user
/ansible_become_user
- comment variable
ansible_become
- uncomment variable
- if deploying via normal user:
-
local prepare: if the Internet is accessbile, ansible will download the latest tidb.
ansible-playbook local_prepare.yml
-
modify kernel parameters
ansible-playbook bootstrap.yml
-
deploy
If deploying via root, uncomment variable
ansible_become
in inventory.ini file.ansible-playbook deploy.yml
-
start cluster
ansible-playbook start.yml
-
test
use mysql client
mysql -u root -h tidb_servers_ip -P 4000
-
grafana monitoring platform:
http://grafana_servers_ip:3000
login(admin/admin)
- http://download.pingcap.org/tidb-latest-linux-amd64.tar.gz
- http://download.pingcap.org/tidb-latest-linux-amd64-centos6.tar.gz
- http://download.pingcap.org/tidb-binlog-latest-linux-amd64.tar.gz
- http://download.pingcap.org/tidb-tools-latest-linux-amd64.tar.gz
- http://download.pingcap.org/sysbench-static-linux-amd64.tar.gz
- http://download.pingcap.org/mydumper-linux-amd64.tar.gz
- http://download.pingcap.org/opbin.tar.gz
Above binaries will be automatically downloaded by:
ansible-playbook local_prepare.yml
ansible all -m user -a 'name=tidb shell=/bin/bash groups=wheel append=yes'
ansible-playbook deploy.yml --list-hosts
ansible-playbook deploy.yml -k -K
ansible-playbook rolling_update.yml
Rolling update TiKV only:
ansible-playbook rolling_update.yml --tags tikv