1.解压
[root@pxc01 soft]# tar -xvf sysbench-0.4.12.14.tar.gz
[root@pxc01 soft]# cd sysbench-0.4.12.14
2.运行autogen.sh
[root@pxc01 sysbench-0.4.12.14]#./autogen.sh
automake 1.10.x (aclocal) wasn't found, exiting
解决办法:
[root@pxc01 sysbench-0.4.12.14]# yum install automake
[root@pxc01 sysbench-0.4.12.14]# ./autogen.sh
libtoolize 1.4+ wasn't found, exiting
解决办法:
[root@pxc01 sysbench-0.4.12.14]# yum install libtool
[root@pxc01 sysbench-0.4.12.14]# ./autogen.sh
./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 `aclocal -I m4'
./autogen.sh: running `autoheader'
./autogen.sh: running `automake -c --foreign --add-missing'
./autogen.sh: running `autoconf'
configure.ac:49: error: possibly undefined macro: AC_LIB_PREFIX
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
Can't execute autoconf
解决办法:
修改configure.ac文件,将AC_LIB_PREFIX函数注释掉
[root@pxc01 sysbench-0.4.12.14]# cat configure.ac | grep AC_LIB_PREFIX
#AC_LIB_PREFIX()
4.编译安装
[root@pxc01 sysbench-0.4.12.14]# ./configure && make && make install
configure: error: mysql_config executable not found
********************************************************************************
ERROR: cannot find MySQL libraries. If you want to compile with MySQL support,
you must either specify file locations explicitly using
--with-mysql-includes and --with-mysql-libs options, or make sure path to
mysql_config is listed in your PATH environment variable. If you want to
disable MySQL support, use --without-mysql option.
********************************************************************************
解决办法:
yum -y install MySQL-shared
yum -y install MySQL-devel
或者自定义安装了mysql的话,修改安装用户(root)的环境变量
[root@pxc01 ~]# more .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
MYSQL_HOME=/opt/mysql5721
PATH=$MYSQL_HOME/bin:$PATH:$HOME/bin
5.查看版本信息
[root@pxc01 sysbench-0.4.12.14]# sysbench --version
sysbench: error while loading shared libraries: libmysqlclient.so.20: cannot open shared object file: No such file or directory
解决办法:
在root环境变量中添加:
export LD_LIBRARY_PATH=$MYSQL_HOME/lib:$LD_LIBRARY_PATH:/usr/local/lib
[root@pxc01 ~]# sysbench --version
sysbench 0.4.12.10
[root@pxc01 ~]#
---------------------------------压力测试----------------------------
1.测试准备
sysbench --test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --mysql-host=127.0.0.1 --mysql-port=4000 --mysql-user=sdrdev --mysql-password=sdrdev123 --mysql-db=hxl --oltp-table-size=4000000 --max-requests=100000 --num-threads=300 --mysql-table-engine=innodb --db-driver=mysql prepare
|
上面例子会自动创建表sbtest1,并往表里写入400万的用户,同时创建索引
-- The End --
阅读(3578) | 评论(0) | 转发(0) |