在centos6.x上node
yum install sysbench |
的时候由于sysbench会依赖于mysql,而无论是系统自带的原生的mysql-server,仍是mysql分支percona-server,都会跟咱们装的percona-xtradb-cluster冲突,因此,幸亏我找了第四台机器来安装sysbench,具体测试步骤以下:mysql
首先,登陆percona xtradb cluster的其中一台机器,这里登node1(10.0.0.1),执行mysql登入系统,并建立测试用数据库sbtest并赋予权限给用户sbtest(密码是sbtest)sql
yum install sysbench |
而后,登陆第四台机器(ip是10.0.0.4),安装sysbench并跑测试程序。数据库
yum-yinstall sysbench sysbench --test=oltp --mysql-host=10.0.0.1,10.0.0.2,10.0.0.3 --mysql-user=sbtest --mysql-password=sbtest --db-driver=mysql prepare sysbench --test=oltp --mysql-host=10.0.0.1,10.0.0.2,10.0.0.3 --mysql-user=sbtest --mysql-password=sbtest --db-driver=mysql run
这是最后输出的结果:centos
sysbench 0.4.12: multi-threaded system evaluation benchmark Running the test with following options: Number of threads: 1 Doing OLTP test. Running mixed OLTP test Using Special distribution (12 iterations, 1 pct of values are returned in 75 pct cases) Using "BEGIN" for starting transactions Using auto_inc on the id column Maximum number of requests for OLTP test is limited to 10000 Threads started! Done. OLTP test statistics: queries performed: read: 140000 write: 50000 other: 20000 total: 210000 transactions: 10000 (21.26 per sec.) deadlocks: 0 (0.00 per sec.) read/write requests: 190000 (403.93 per sec.) other operations: 20000 (42.52 per sec.) Test execution summary: total time: 470.3826s total number of events: 10000 total time taken by event execution: 470.2785 per-request statistics: min: 27.22ms avg: 47.03ms max: 458.16ms approx. 95 percentile: 99.91ms Threads fairness: events (avg/stddev): 10000.0000/0.00 execution time (avg/stddev): 470.2785/0.00
最后,清除测试数据:bash
sysbench --test=oltp --mysql-host=10.0.0.1,10.0.0.2,10.0.0.3 --mysql-user=sbtest --mysql-password=sbtest --db-driver=mysql cleanup