首页 > 解决方案 > 如何为我的 PostgreSQL10 安装 pgAudit?

问题描述

我想在我的 CentOS 6 32 位上安装 pgAudit,我已经从 DBEnterprise 下载的 PostgreSQL Linux 运行安装程序安装了 PostgreSQL 10 + pgAdmin4

我按照这里的指南进行操作,以下是我遵循的步骤:

  1. git clone https://github.com/postgres/postgres.git
  2. cd postgres然后进入文件夹git checkout REL_10_STABLE
  3. ./configure在那之后make install -s

  4. cd contrib

  5. 克隆 pgAudit 扩展git clone https://github.com/pgaudit/pgaudit.git
  6. cd pgaudit
  7. git checkout REL_10_STABLE
  8. make -s check
  9. make install

我被困在第 8 步。结果如下:

[root@localhost pgaudit]# make -s check
============== creating temporary instance            ==============
============== initializing database system           ==============

pg_regress: initdb failed
Examine /root/postgres/contrib/pgaudit/log/initdb.log for the reason.
Command was: "initdb" -D "/root/postgres/contrib/pgaudit/./tmp_check/data" --no-clean --no-sync > "/root/postgres/contrib/pgaudit/log/initdb.log" 2>&1
make: *** [check] Error 2

/root/postgres/contrib/pgaudit/log/initdb.log我按照它告诉我的方式打开了 initdb.log ,它说:

Running in no-clean mode.  Mistakes will not be cleaned up.
initdb: cannot be run as root
Please log in (using, e.g., "su") as the (unprivileged) user that will
own the server process.

所以我在以 postgres 登录后再次尝试,结果如下:

bash-4.1$ make -s check
make[3]: stat: ../../src/include/utils/errcodes.h: Permission denied
/bin/sh: line 0: cd: utils/: Not a directory
make[3]: *** [../../src/include/utils/errcodes.h] Error 1
make[2]: *** [submake-errcodes] Error 2
make[1]: *** [submake-libpgport] Error 2
make: *** [submake] Error 2

我对 Linux 和 PostgreSQL 都很陌生,所以我不知道它为什么会失败以及解决方案是什么。提前致谢!

标签: postgresql-10

解决方案


推荐阅读