云服务器安装sysbench报错./libtool:line841:X--tag=CC:commandnotfound


重点内容背景,安装sysbench编译make报错:

./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
../libtool: line 2408: X: command not found
../libtool: line 2415: Xsysbench: command not found
../libtool: line 2550: X-lmysqlclient_r: command not found
../libtool: line 2550: X-lrt: command not found
../libtool: line 2550: X-lm: command not found
../libtool: line 2632: X-L/data/sysbench-0.4.12/sysbench: No such file or directory
../libtool: line 2550: X-lmysqlclient_r: command not found
../libtool: line 2550: X-lrt: command not found
../libtool: line 2550: X-lm: command not found
../libtool: line 2632: X-L/data/sysbench-0.4.12/sysbench: No such file or directory
../libtool: line 2550: X-lmysqlclient_r: command not found
../libtool: line 2550: X-lrt: command not found
../libtool: line 2550: X-lm: command not found

1,可能原因:

(1)、没装依赖包libtool
(2)、安装的版本不对(libtool版本过旧)
(3)、其它原因


<版权所有,文章允许转载,但必须以链接方式注明源地址,否则追究法律责任!>
原博客地址: http://blog.csdn.net/mchdba/article/details/46381741
原作者:黄杉 (mchdba)


2,解决方法:

安装依赖包libtool、libtoo更新到新版本、用autoreconf代替autogen.sh,方法如下:

这里采用最后一种种办法:

autoreconf -i
configure
make
make install

3,然后configure就正常通过

[root@bizdb01 sysbench-0.4.12]# sysbench --help
sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
[root@bizdb01 sysbench-0.4.12]# 

4,报lib报错

[root@bizdb01 sysbench-0.4.12]# find / -name libmysqlclient.so.18
/mnt/resource/mysql-5.6.12/libmysql/libmysqlclient.so.18
/usr/local/mysql/lib/libmysqlclient.so.18
[root@bizdb01 sysbench-0.4.12]# 

这说明sysbench无法找到mysql的库文件,这很可能是环境变量LD_LIBRARY_PATH没有设置,设置后即可解决该问题:

echo "export LD_LIBRARY_PATH=/usr/local/mysql/lib" >> /etc/profile/
source /etc/profile/
[root@bizdb01 sysbench-0.4.12]# echo "export LD_LIBRARY_PATH=/usr/local/mysql/lib" >> /etc/profile
[root@bizdb01 sysbench-0.4.12]# source /etc/profile
[root@bizdb01 sysbench-0.4.12]# 
[root@bizdb01 sysbench-0.4.12]# 
[root@bizdb01 sysbench-0.4.12]# sysbench --help
Usage:
  sysbench [general-options]... --test= [test-options]... command


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 [32K]
  --init-rng=[on|off]        initialize random number generator [off]
  --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


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
  oltp - OLTP test


Commands: prepare run cleanup help version


See 'sysbench --test= help' for a list of options for each test.

[root@bizdb01 sysbench-0.4.12]#

     min:                                  0.01ms
     avg:                                  3.40ms
     max:                                 99.25ms
     approx.  95 percentile:              19.00ms

Read 93.703Mb Written 62.688Mb Total transferred 156.39Mb (23.951Mb/sec)

5,接下来可以使用sysbench对服务器进行压力测试

 time sysbench --test=oltp --oltp-test-mode=nontrx --mysql-table-engine=innodb  --mysql-user=root  --mysql-password=""  --db-driver=mysql --num-threads=1000 --max-requests=100000  --oltp-nontrx-mode=select --mysql-db=test  --oltp-table-size=1000000 --oltp-table-name=t1  --mysql-socket=/usr/local/mysql/mysql.sock prepare

相关内容