##
sysbench测试PostgreSQL时遇到的问题
1、概述
环境描述:
[root@pgdb01 sysbench-1.0.20]# cat /etc/redhat-release
Rocky Linux release 9.2 (Blue Onyx)
[postgres@pgdb01:/home/postgres]$psql --version
psql (PostgreSQL) 15.4
PG是编译安装的。
想法是使用sysbench来简单测试下PG,(测试的方法有很多,忽略为啥用sysbench)。
2、遇到的问题
在yum安装的过程中遇到两个问题。
问题1:libpq.so.5
[postgres@pgdb01:/home/postgres]$sysbench --version
sysbench: /postgresql/app/pgdb/lib/libpq.so.5: no version information available (required by sysbench)
sysbench 1.0.20
问题2:psql: undefined symbol: PQmblenBounded
postgres=# \c demo
psql: symbol lookup error: psql: undefined symbol: PQmblenBounded
这两个问题都和lib文件有关系。查了一下资料:
https://www.postgresql.org/message-id/3766309.1637600743%40sss.pgh.pa.us
可以通过改环境变量,替换lib文件去处理,但稍许麻烦。于是采用编译安装sysbench来处理。
3、编译安装sysbench
yum -y install make automake libtool pkgconfig libaio-devel
cd /postgresql/backup/
tar -zxvf sysbench-1.0.20.tar.gz
cd sysbench-1.0.20/
./autogen.sh
./configure --without-mysql --with-pgsql --with-pgsql-includes=/postgresql/app/pgdb/include --with-pgsql-libs=/postgresql/app/pgdb/lib
make -j 4
make install
这里指定参数
--with-pgsql-includes path to PostgreSQL header files
--with-pgsql-libs path to PostgreSQL libraries
另外
The above will build sysbench with MySQL support by default. If you have MySQL headers and libraries in non-standard locations (and no mysql_config can be found in the PATH), you can specify them explicitly with --with-mysql-includes and --with-mysql-libs options to ./configure.
To compile sysbench without MySQL support, use --without-mysql. If no database drivers are available database-related scripts will not work, but other benchmarks will be functional.
所以加上**–without-mysql**
4、检查
[postgres@pgdb01:/home/postgres]$psql --version
psql (PostgreSQL) 15.4
[postgres@pgdb01:/home/postgres]$sysbench --version
sysbench 1.0.20
[postgres@pgdb01:/home/postgres]$psql
psql (15.4)
Type "help" for help.
postgres=# \c demo
You are now connected to database "demo" as user "postgres".
demo=#
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




