如何在centos7上运行initdb for postgresql 9.2?

如何在centos7上运行initdb for postgresql 9.2?,postgresql,centos7,Postgresql,Centos7,所以 我的管理员在centos7机器上安装了(不知道如何安装)postgresql 9.2(64位版本)。问题是我需要初始化数据库,所以我应该运行如下操作: service postgresql-9.2 initdb 但我得到了一个错误: The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other

所以

我的管理员在centos7机器上安装了(不知道如何安装)postgresql 9.2(64位版本)。问题是我需要初始化数据库,所以我应该运行如下操作:

service postgresql-9.2 initdb
但我得到了一个错误:

The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.
做了一些搜索,人们说你应该通过直接调用一些脚本来初始化,但是这个CentOS 7机器上不存在每个给定的位置

比如这个位置(是的,它是针对9.3的,我使用9.2,但类似的位置并不存在):

还是这个

/usr/pgsql-9.3/bin/postgresql93-setup initdb
我发现了

/usr/lib64/pgsql 
但是这个目录只有一堆'*.so'文件


我该如何在Centos 7上运行initdb for postgresql 9.2?

刚刚在Centos上安装了postgresql 9.3

#cd /etc/init.d
#ls postgres*
还有一个posgresql-9.3脚本

#./postgresql-9.3 

提供运行选项,其中一个是initdb

您可以直接从postgres帐户运行它

#su - postgres -c pg_ctl initdb

您是否尝试了
哪个initdb
定位initdb
,或
查找/usr-name initdb
?在Ubuntu上,它位于
/usr/lib/postgresql/9.2/bin/initdb
;我不知道你在Centos上的什么地方可以找到它。@MikeSherrill'CatRecall',
哪个initdb
找到了
/usr/bin/initdb
。但是,我在互联网上找不到initdb可以位于这个目录中的任何信息。也许管理员以某种奇怪的方式安装了它。将尝试重新安装以确保安全。在此安装中,initdb是一个独立的、已编译的可执行文件吗?是否有编译它的特定原因?应该有编译它的安装说明。查看源代码树中的安装或自述文件。我很好奇它们之间的区别。在我的Ubuntu框中,initdb是一个编译的可执行文件,这意味着“which”、“locate”或“find”应该能够找到它。在您的Centos安装中,postgresql-9.3脚本的“initdb”选项可能是一个可执行文件,如我的box、另一个脚本或其他编译程序的一部分。在Ubuntu box上,我将使用pg_createcluster和它的朋友。
#su - postgres -c pg_ctl initdb