[root@mysql ~]# cd sysbench-0.5
[root@mysql sysbench-0.5]# ls
autogen.sh ChangeLog config configure.ac COPYING doc install-sh m4 Makefile.am missing mkinstalldirs README.md README-WIN.txt sysbench tests TODO
[root@mysql sysbench-0.5]# ./autogen.sh
遇到报错:libtoolize 1.4+ wasn't found, exiting
解决办法:[root@mysql sysbench-0.5]# yum install libtool -y
[root@mysql sysbench-0.5]# ./autogen.sh
./autogen.sh: running `aclocal -I m4'
./autogen.sh: running `libtoolize --copy --force'
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `config'.
libtoolize: copying file `config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
./autogen.sh: running `autoheader'
./autogen.sh: running `automake -c --foreign --add-missing'
configure.ac:25: installing `config/compile'
configure.ac:11: installing `config/config.guess'
configure.ac:11: installing `config/config.sub'
configure.ac:16: installing `config/install-sh'
configure.ac:16: installing `config/missing'
sysbench/Makefile.am: installing `config/depcomp'
./autogen.sh: running `autoconf'
Libtoolized with: libtoolize (GNU libtool) 2.2.6b
Automade with: automake (GNU automake) 1.11.1
Configured with: autoconf (GNU Autoconf) 2.63
[root@mysql sysbench-0.5]#
[root@mysql sysbench-0.5]# ./configure --with-mysql-includes=/opt/mysql/include --with-mysql-libs=/opt/mysql/lib && make
[root@mysql sysbench-0.5]# make install
遇到报错:
[root@mysql sysbench-0.5]# sysbench --help
sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
临时解决(只适用当前会话):
[root@mysql sysbench-0.5]# export LD_LIBRARY_PATH=/opt/mysql/lib
永久解决:
[root@mysql ~]# ln -s /opt/mysql/lib/libmysqlclient.so.18 /usr/lib64
[root@mysql ~]# ldconfig
查看sysbench帮助:
[root@mysql sysbench-0.5]# sysbench --help
Missing required command argument.
Usage:
sysbench --test=<test-name> [options]... <command>
Commands: prepare run cleanup help version
General options:
--num-threads=N number of threads to use [1]
--max-requests=N limit for total number of requests [10000]
--max-time=N limit for total execution time in seconds [0]
--forced-shutdown=STRING amount of time to wait after --max-time before forcing shutdown [off]
--thread-stack-size=SIZE size of stack per thread [64K]
--tx-rate=N target transaction rate (tps) [0]
--report-interval=N periodically report intermediate statistics with a specified interval in seconds. 0 disables intermediate reports [0]
--report-checkpoints=[LIST,...]dump full statistics and reset all counters at specified points in time. The argument is a list of comma-separated values representing the amount of time in seconds elapsed from start of test when report checkpoint(s) must be performed. Report checkpoints are off by default. []
--test=STRING test to run
--debug=[on|off] print more debugging info [off]
--validate=[on|off] perform validation checks where possible [off]
--help=[on|off] print help and exit
--version=[on|off] print version and exit [off]
--rand-init=[on|off] initialize random number generator [off]
--rand-type=STRING random numbers distribution {uniform,gaussian,special,pareto} [special]
--rand-spec-iter=N number of iterations used for numbers generation [12]
--rand-spec-pct=N percentage of values to be treated as 'special' (for special distribution) [1]
--rand-spec-res=N percentage of 'special' values to use (for special distribution) [75]
--rand-seed=N seed for random number generator, ignored when 0 [0]
--rand-pareto-h=N parameter h for pareto distibution [0.2]
--config-file=FILENAME File containing command line options
Log options:
--verbosity=N verbosity level {5 - debug, 0 - only critical messages} [3]
--percentile=N percentile rank of query response times to count [95]
General database options:
--db-driver=STRING specifies database driver to use ('help' to get list of available drivers)
--db-ps-mode=STRING prepared statements usage mode {auto, disable} [auto]
--db-debug=[on|off] print database-specific debug information [off]
Compiled-in database drivers:
mysql - MySQL driver
mysql options:
--mysql-host=[LIST,...] MySQL server host [localhost]
--mysql-port=N MySQL server port [3306]
--mysql-socket=[LIST,...] MySQL socket
--mysql-user=STRING MySQL user [sbtest]
--mysql-password=STRING MySQL password []
--mysql-db=STRING MySQL database name [sbtest]
--mysql-table-engine=STRING storage engine to use for the test table {myisam,innodb,bdb,heap,ndbcluster,federated} [innodb]
--mysql-engine-trx=STRING whether storage engine used is transactional or not {yes,no,auto} [auto]
--mysql-ssl=[on|off] use SSL connections, if available in the client library [off]
--mysql-compression=[on|off] use compression, if available in the client library [off]
--myisam-max-rows=N max-rows parameter for MyISAM tables [1000000]
--mysql-debug=[on|off] dump all client library calls [off]
--mysql-ignore-errors=[LIST,...]list of errors to ignore, or "all" [1213,1020,1205]
--mysql-dry-run=[on|off] Dry run, pretent that all MySQL client API calls are successful without executing them [off]
Compiled-in tests:
fileio - File I/O test
cpu - CPU performance test
memory - Memory functions speed test
threads - Threads subsystem performance test
mutex - Mutex performance test
See 'sysbench --test=<name> help' for a list of options for each test.
可以看到帮助信息说明安装完毕!