[转帖]sysbench安装

sysbench,安装 · 浏览次数 : 0

小编点评

## Summary of the provided text: **What is sysbench?** - A multi-threaded benchmark tool used to assess the performance of different system parameters under database load. **Requirements:** - Packages for `glib`, `pkg-config`, and `postgresql` must be installed before running sysbench. **Installation methods:** **1. Using Yum:** ``` yum install glib pkg-config postgres ``` **2. Using Source Code:** - Download the `pkg-config-0.29.2.tar.gz` file. - Extract the package and compile it with the following command: ``` ./configure --with-internal-glib --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/ ``` **3. Using PostgreSQL Installation:** ``` ./configure --with-pgsql --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/ ``` **4. Basic Installation:** ``` ./autogen.sh --base-install --without-mysql --with-pgsql --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/ ``` **5. MySQL and PostgreSQL Installation:** ``` ./configure --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/ ./configure --with-pgsql --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/ ``` **Note:** - These installation instructions assume you have the necessary packages already installed on your system. - The `autogen.sh` script should be run before running `./configure` to generate makefiles.

正文

https://www.jianshu.com/p/1948beb6699e

 

sysbench是一个多线程的基准测试工具,一般用来评估不同系统参数下的数据库负载情况
如果你的环境上如下依赖包都没装上,需要先安装如下这些依赖包,使用yum install更便利

 
image.png

 

如果使用源码安装(在网上都可以找到源码资源)需要注意:
  • pkg-config编译时
[wanchao@localhost ~]$./configure --with-internal-glib
//直接./configure时可能会报onfigure: error: Either a previously installed pkg-config or "glib-2.0 >= 2.16" could not be found. Please set GLIB_CF
/原因是minGW默认没有安装glib,那么在下载的pkg-config-0.29.2.tar.gz中就存在glib包,使用压缩包自带的glib
[wanchao@localhost ~]$make
[wanchao@localhost ~]$make install
  • 其它的包解压后直接编译安装即可
[wanchao@localhost ~]$ tar -zxvf   xxx.tar.gz
[wanchao@localhost ~]$./configure && make  && make install
安装sysbench,解压都一致,编译时注意:
先执行
[wanchao@localhost ~]$ ./autogen.sh
  • 基准安装方式
- 基本安装--此安装仅用于测试资源基准测试,如cpu、memory
--without-mysql:排除mysql,因为如果要安装mysql话需要现有mysql驱动
[wanchao@localhost ~]$ ./configure --without-mysql
[wanchao@localhost ~]$ make && make install
  • 基于Mysql压测的安装方式
 mysql安装--此安装用于基准测试+Mysql压测。 
 --with-pgsql :声明基于mysql的安装,需要提前安装好mysql程序,并记录安装位置,下面参数使用
--with-mysql-includes:包含mysql的includes
 --with-mysql-libs:包含mysql的libs
注意--with-mysql-includes、--with-mysql-libs值的路径为当前实际mysql安装程序的路径
[wanchao@localhost ~]$./configure --with-pgsql --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/
  • 基于Postgresql压测的安装方式
pgsql安装--此安装用于基准测试+pgsql压测。 
--without-mysql:排除mysql的安装
--with-pgsql:声明基于pgsql的安装 需要提前安装pgsql,并记录安装位置,下面参数使用
--with-pgsql-includes:包含pgsql的includes
--with-pgsql-libs:包含pasql的libs
注意--with-mysql-includes、--with-mysql-libs值的路径为当前实际postgresql安装程序的路径
[wanchao@localhost ~]$./configure --without-mysql --with-pgsql --with-pgsql-includes=/usr/local/postgresql/include --with-pgsql-libs=/usr/local/postgresql/lib

与[转帖]sysbench安装相似的内容: