环境:两台ubuntu 18.04 pc
tidb / pd: 192.168.1.150
tikv: 192.1681.1.151
主要参考https://pingcap.com/docs-cn/dev/how-to/deploy/orchestrated/ansible/
git clone https://github.com/pingcap/go-ycsb.git
git clone https://github.com/pingcap/tidb-ansible.git
vi hosts.ini
vi inventory.ini
ansible-playbook -i hosts.ini deploy_ntp.yml -u pingcap -b
ansible-playbook local_prepare.yml ansible-playbook bootstrap.yml --extra-vars "dev_mode=True" ansible-playbook deploy.yml ansible-playbook start.yml
有几点补充:
1. 配置前准备:
0. 安装时就将用户名设为tidb,且计算机名要互不相同
1. 开启ssh,设置允许root ssh
2. 设置ext4分区格式(参考上述链接)
3. 安装1.12.2版本的go
4. 使用master版本的tidb-ansible。在inventory.ini中tidb_version使用默认值latest
2. 在ansible-playbook bootstrap.yml这里,加上如下参数来跳过配置自检:
ansible-playbook bootstrap.yml --extra-vars "dev_mode=True"
3. 单机部署时,如果ansible start阶段遇到以下错误:
TASK [wait for region replication complete] **************************************************************************** FAILED - RETRYING: wait for region replication complete (20 retries left). FAILED - RETRYING: wait for region replication complete (19 retries left). FAILED - RETRYING: wait for region replication complete (18 retries left). FAILED - RETRYING: wait for region replication complete (17 retries left). FAILED - RETRYING: wait for region replication complete (16 retries left). FAILED - RETRYING: wait for region replication complete (15 retries left). FAILED - RETRYING: wait for region replication complete (14 retries left). FAILED - RETRYING: wait for region replication complete (13 retries left). FAILED - RETRYING: wait for region replication complete (12 retries left).
tidb-ansible/conf/pd.yml里面 max-replicas 改成1,然后ansible unsafe_cleanup,重新deploy
Ref:
https://www.cnblogs.com/rongfengliang/p/8006165.html
https://blog.csdn.net/lockey23/article/details/78256143
-------------------------------------------------配置ycsb-------------------------------------------------
go-ycsb是一个在tikv上运行benchmark的工具
首先把https://github.com/pingcap/go-ycsb给git clone到本地,然后make
tidb@pd1:~/Desktop/go-ycsb$ ./bin/go-ycsb load tikv -P workloads/workloada -p tikv.pd=192.168.1.150:2379
tidb@pd1:~/Desktop/go-ycsb$ ./bin/go-ycsb run tikv -P workloads/workloada -p tikv.pd=192.168.1.150:2379
注:如果报 ERRO[0000] batch commands send error: EOF 错误可以忽略。[ https://github.com/tikv/client-go/issues/19 ]
Ref: