![CentOS7.2에서 postgresql을 `initdb`하는 방법은 무엇입니까?](https://linux55.com/image/139027/CentOS7.2%EC%97%90%EC%84%9C%20postgresql%EC%9D%84%20%60initdb%60%ED%95%98%EB%8A%94%20%EB%B0%A9%EB%B2%95%EC%9D%80%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
service
CentOS 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