Chinaunix首页 | 论坛 | 博客
  • 博客访问: 488050
  • 博文数量: 51
  • 博客积分: 257
  • 博客等级: 二等列兵
  • 技术积分: 1489
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-02 18:30
个人简介

Unix/Linux, mysql, web,企业应用

文章分类

全部博文(51)

文章存档

2015年(1)

2014年(1)

2013年(48)

2012年(1)

我的朋友

分类: Mysql/postgreSQL

2013-01-26 13:50:13

0,安装 bzr 工具(什么是bzr? bzr - easy to use distributed version control system)
root@debian6:~# apt-get install bzr


1,下载并编译 tpcc-mysql 源码
root@debian6:~# bzr branch lp:~percona-dev/perconatools/tpcc-mysql
root@debian6:~cd tpcc-mysql/src
root@debian6:src# make
cc -w -O2 -g -I. `mysql_config --include`  -c load.c
/bin/sh: 1: mysql_config: not found
load.c:11:19: fatal error: stdio.h: No such file or directory
compilation terminated.
make: *** [load.o] Error 1
原来是没有安装mysql_config,安装 libmysqlclient-dev 包就会把mysql_config安装上了。
root@debian6:src# apt-get install libmysqlclient-dev
root@debian6:src# make
cc -w -O2 -g -I. `mysql_config --include`  -c load.c
cc -w -O2 -g -I. `mysql_config --include`  -c support.c
cc load.o support.o `mysql_config --libs_r` -lrt -o ../tpcc_load
cc -w -O2 -g -I. `mysql_config --include`  -c main.c
cc -w -O2 -g -I. `mysql_config --include`  -c spt_proc.c
cc -w -O2 -g -I. `mysql_config --include`  -c driver.c
cc -w -O2 -g -I. `mysql_config --include`  -c sequence.c
cc -w -O2 -g -I. `mysql_config --include`  -c rthist.c
cc -w -O2 -g -I. `mysql_config --include`  -c neword.c
cc -w -O2 -g -I. `mysql_config --include`  -c payment.c
cc -w -O2 -g -I. `mysql_config --include`  -c ordstat.c
cc -w -O2 -g -I. `mysql_config --include`  -c delivery.c
cc -w -O2 -g -I. `mysql_config --include`  -c slev.c
cc main.o spt_proc.o driver.o support.o sequence.o rthist.o neword.o payment.o ordstat.o delivery.o slev.o `mysql_config --libs_r` -lrt -o ../tpcc_start
root@debian6:src# cd ..
root@debian6:tpcc-mysqlls
add_fkey_idx.sql  count.sql  create_table.sql  drop_cons.sql  load.sh  README  schema2  scripts  src  tpcc_load  tpcc_start

2,编译完成后查看README文件,内有详细的使用说明
root@debian6:tpcc-mysqlcat README
1. Build binaries
   * cd scr ; make
   ( you should have mysql_config available in $PATH)

2. Load data
   * create database
     mysqladmin create tpcc1000
   * create tables
     mysql tpcc1000 < create_table.sql
   * create indexes and FK ( this step can be done after loading data)
     mysql tpcc1000 < add_fkey_idx.sql
   * populate data
     - simple step
       tpcc_load 127.0.0.1:33000 tpcc1000 root "" 1000
                 |hostname:port| |dbname| |user| |password| |WAREHOUSES|
       ref. tpcc_load --help for all options
     - load data in parallel 
       check load.sh script

3. start benchmark
   * ./tpcc_start -h127.0.0.1 -P33000 -dtpcc1000 -uroot -w1000 -c32 -r10 -l10800
                  |hostname| |port| |dbname| |user| |WAREHOUSES| |CONNECTIONS| |WARMUP TIME| |BENCHMARK TIME|
   * ref. tpcc_start --help for all options
阅读(3374) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

zhengb3022013-01-26 13:51:03

博客的编辑器不好用啊。