pgbench 源码安装
前提:yun install postgresql数据库之后,并没有找到pgbench工具在这个数据库中包含,网上的教程说是有,可以尝试一下.
安装环境:centos7
源码解压安装目录:非/root目录,考虑到普通用户的访问权限,最好不要放在这个目录下
1下载postgresql源码包:
wget https://ftp.postgresql.org/pub/source/v9.2.24/postgresql-9.2.24.tar.gz
2解压:
tar zxvf postgresql-9.2.24.tar.gz
3进入pgbench目录
cd ..(解压目录)/postgresql-9.2.24/contrib/pgbench/
4执行:
make all
5出错:
Makefile:19: ../../src/Makefile.global: No such file or directory
Makefile:20: /contrib/contrib-global.mk: No such file or directory
6 缺少必要的文件。
cd 到解压目录的根目录下(postgresql-9.2.24/)执行 :./configure
7重新执行:cd contrib/pgbench/
make all
8出错:
/usr/bin/ld: cannot find -lpgport
/usr/bin/ld: cannot find -lpq
collect2: error: ld returned 1 exit status
make: *** [pgbench] Error 1
9原因:没有必要的链接库
cd 到解压目录的根目录下(postgresql-9.2.24/)执行 :make
重新执行:cd contrib/pgbench/
make all
10:永久配置环境变量,方便普通用户和root用户都能使用pgbench:
vi /etc/profile
export PATH=$PATH:/xxx/postgresql-9.2.24/contrib/pgbench
pgbench源码安装趟坑避坑
于 2023-04-27 11:27:31 首次发布