TIDB 数据库集群部署(4)

# 登录tidb创建测试数据库
mysql -u root -P 4000 -h 172.16.5.50
create database sbtest
# 准备测试数据
sysbench /usr/share/sysbench/oltp_common.lua --mysql-host=172.16.5.50 --mysql-port=4000 --mysql-user=root --tables=20 --table_size=20000000 --threads=100 --max-requests=0 prepare
--tables=20 # 创建20个表
--table_size=20000000 # 每个表两千万数据
--threads=100 # 使用100个线程数
---------------------------------报错信息如下------------------------------------------
FATAL: mysql_drv_query() returned error 9001 (PD server timeout[try again later]
2018/11/23 11:23:19.236 log.go:82: [warning] etcdserver: [timed out waiting for read index response]
2018/11/23 14:15:17.329 heartbeat_streams.go:97: [error] [store 1] send keepalive message fail: EOF
2018/11/23 14:14:04.603 leader.go:312: [info] leader is deleted
2018/11/23 14:14:04.603 leader.go:103: [info] pd2 is not etcd leader, skip campaign leader and check later
2018/11/23 14:21:10.071 coordinator.go:570: [info] [region 1093] send schedule command: transfer leader from store 7 to store 2
FATAL: mysql_drv_query() returned error 1105 (Information schema is out of date)
------------------------------------end-----------------------------------------------
# 调整线程数为10,表数量为10,表数据为2000000 做测试
sysbench /usr/share/sysbench/oltp_common.lua --mysql-host=172.16.5.50 --mysql-port=4000 --mysql-user=root --tables=1 --table_size=2000000 --threads=10 --max-requests=0 prepare
--------------------------------------start--------------------------------------------
FATAL: mysql_drv_query() returned error 1105 (Information schema is out of date) 超时报错
成功写入2张表,其余8张表数据并未写满,写好索引
# 对tidb集群进行读写测试
sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=172.16.5.50 --mysql-port=4000 --mysql-user=root --tables=1 --table_size=2000000 --threads=10 --max-requests=0 run
----------------------------------------start--------------------------------------
Number of threads: 10
Initializing random number generator from current time
Initializing worker threads...
Threads started!
SQL statistics:
queries performed:
read: 868
write: 62
other: 310
total: 1240
transactions: 62 (5.60 per sec.)
queries: 1240 (112.10 per sec.)
ignored errors: 0 (0.00 per sec.)
reconnects: 0 (0.00 per sec.)
General statistics:
total time: 11.0594s
total number of events: 62
Latency (ms):
min: 944.55
avg: 1757.78
max: 2535.05
95th percentile: 2320.55
sum: 108982.56
Threads fairness:
events (avg/stddev): 6.2000/0.40
execution time (avg/stddev): 10.8983/0.31
------------------------------------end----------------------------------------
# 使用mysql对比测试
mysql -uroot -P 3306 -h 172.15.5.154
create database sbtest
sysbench /usr/share/sysbench/oltp_common.lua --mysql-host=172.16.5.154 --mysql-port=3306 --mysql-user=root --mysql-password=root --tables=20 --table_size=20000000 --threads=10 --max-requests=0 prepare
使用mysql 做测试未发现报错情况

4.3、业务数据测试

sysbench /usr/share/sysbench/oltp_read_write.lua --mysql-host=172.16.5.50 --mysql-port=4000 --mysql-user=root --tables=20 --table_size=2000000 --threads=10 --max-requests=0 run

Linux公社的RSS地址https://www.linuxidc.com/rssFeed.aspx

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/33c955f0f0a426c0d940d222a00b9e51.html