linux安装sysbench

#Linux安装sysbench
yum install gcc autoconf automake libtool -y
tar -zxv -f sysbench-0.4.12
#mysql源码安装需要指定MySQL的库文件位置 (—with—mysql-includes –with-mysql-libs选项)
cd sysbench-0.4.12
./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib
make && make install

 

#常见报错

../libtool: line 841: X--tag=CC: command not found

../libtool: line 874: libtool: ignoring unknown tag : command not found
../libtool: line 841: X--mode=link: command not found
../libtool: line 1007: *** Warning: inferring the mode of operation is deprecated.: command not found
../libtool: line 1008: *** Future versions of Libtool will require --mode=MODE be specified.: command not found
../libtool: line 2234: X-g: command not found
../libtool: line 2234: X-O2: command not found
../libtool: line 1954: X-L/usr/local/mysql/lib: No such file or directory
../libtool: line 2403: Xsysbench: command not found

#cause
sysbench自带的libtool与系统libtool版本不一致(?)

#solve
vim ./aclocal.m4
LIBTOOL=‘$(SHELL) $(top_builddir)/libtool‘ 修改为 ‘$(SHELL) /usr/bin/libtool‘,即使用系统的libtool工具包.

make && make install

sysbench
sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory(maybe)

ln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/ #64位系统lib64 32位系统lib(uname -a)

#测试mysql

生成数据
sysbench --test=oltp --mysql-table-engine=innodb --oltp-table-size=1000000 --mysql-user=* --mysql-host=* --mysql-port=6202 --mysql-socket=/data/mysql/mysql.sock --mysql-password=* --mysql-db=fzclassroom --db-driver=mysql prepare

输出报告
sysbench --mysql-db=sbtest --max-requests=0 --test=oltp --mysql-engine-trx=yes --mysql-table-engine=innodb --oltp-table-size=1000000 --db-ps-mode=disable --mysql-user=jike_pdd --mysql-host=* --mysql-port=6202 --mysql-socket=/data/mysql/mysql.sock --mysql-password=* --mysql-db=fzclassroom --db-driver=mysql --num-threads=16 --max-time=600 run

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。