CentOS7.2でpostgresqlを `initdb`する方法は?

CentOS7.2でpostgresqlを `initdb`する方法は?

serviceCentOS 6ではinitdbを使用できますpostgresql-9.3

service postgresql-9.3 initdb

しかし、CentOS7では、次のことを試した結果、initdbが可能であることがわかりました。

# service postgresql-11 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.
[root@www data]# systemctl initdb postgresql-11
Unknown operation 'initdb'.
[root@www data]# systemctl postgresql-11 initdb
Unknown operation 'postgresql-11'.

この問題をどのように解決できますか?

ベストアンサー1

残念ながら、inidbバイナリを直接使用する必要があります。

/usr/pgsql-11/bin/initdb /var/lib/pgsql/11

おすすめ記事