๋ชฉ์ฐจ
ex)
systemctl start postgresql-9.6.service
Job for postgresql-9.6.service failed because the control process exited with error code. See "systemctl status postgresql-9.6.service" and "journalctl -xe" for details.
systemctl์ ๋ฑ๋ก๋ ์๋น์ค ์คํ ์ ์์ ๊ฐ์ ์๋ฌ๋ฅผ ๋ฐ๊ฒฌํ๋ ์ด ๋์ ๊ฒฝ์ฐ๊ฐ ์๊ธฐ๋ฉด
systemctl status postgresql-9.6.service(๋ฑ๋ก๋ ์๋น์ค๋ช
)๊ณผ journalctl -xe๋ฅผ ํตํด์ ๋ก๊ทธ๋ฅผ ํ์ธํด์ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํด์ผ ํจ
ํ์ฌ์์ postgreSQL๊ฐ root๋ก systemctl start๋ก ์คํ ์(์๋ ์ ๋๋ค๊ฐ ์ค๋ผํด ์ค์นํ๋ฉด์ ๋ฆฌ๋
์ค ์ค์ ์ ์ข ๋ณ๊ฒฝํ๊ฒ ์์ธ ์ธ ๋ฏ)
๋์ ๊ฒฝ์ฐ postgresql-9.6.service๋ฅผ ์คํ ํ ๊ฒฝ์ฐ ์๋์ฒ๋ผ ์๋ฌ๊ฐ ๋ฐ์ ํ์์
[root@centos7 ~]# systemctl status postgresql-9.6.service
โ postgresql-9.6.service - PostgreSQL 9.6 database server
Loaded: loaded (/usr/lib/systemd/system/postgresql-9.6.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since ํ 2021-10-19 15:30:09 KST; 50s ago
Docs: https://www.postgresql.org/docs/9.6/static/
Process: 30514 ExecStart=/usr/pgsql-9.6/bin/postmaster -D ${PGDATA} (code=exited, status=1/FAILURE)
Process: 30507 ExecStartPre=/usr/pgsql-9.6/bin/postgresql96-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
Main PID: 30514 (code=exited, status=1/FAILURE)
10์ 19 15:30:08 centos7 systemd[1]: Starting PostgreSQL 9.6 database server...
10์ 19 15:30:09 centos7 postmaster[30514]: < 2021-10-19 15:30:09.071 KST > ๋ก๊ทธ: redirecting log output to logging… process
10์ 19 15:30:09 centos7 postmaster[30514]: < 2021-10-19 15:30:09.071 KST > ํํธ: Future log output will appear in …pg_log".
10์ 19 15:30:09 centos7 systemd[1]: postgresql-9.6.service: main process exited, code=exited, status=1/FAILURE
10์ 19 15:30:09 centos7 systemd[1]: Failed to start PostgreSQL 9.6 database server.
10์ 19 15:30:09 centos7 systemd[1]: Unit postgresql-9.6.service entered failed state.
10์ 19 15:30:09 centos7 systemd[1]: postgresql-9.6.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
๊ตฌ๊ธ๋ง ํด ๋ณธ ๊ฒฐ๊ณผ.. ์ ๋ณด๊ฐ ๋ง์ด ๋ถ์กฑ ํ์์ง๋ง ์ด๋ค ๋ธ๋ก๊ทธ๋ฅผ ์ฐธ์กฐํด์ ์๋์ฒ๋ผ ์๋ฌ๊ฐ ๋ฐ์ํ๋ ๊ฒฝ๋ก์ ์ง์ ๋ค์ด๊ฐ์ ์๋น์ค๋ฅผ ์คํ ํด ๋ดค์
/usr/pgsql-9.6/bin/postmaster
๊ทธ ๊ฒฐ๊ณผ ๊ถํ ๋ฌธ์ ๋ผ๊ณ ์๋์ฒ๋ผ ๋์์
์์คํ
๋ณด์ ๊ด๋ จ ๋ฌธ์ ๋ก, PostgreSQL server๋ฅผ "root" ID๋ก ์คํํ ์ ์์ต๋๋ค.
๋ฐ๋์ ์ผ๋ฐ ์ฌ์ฉ์ ID(์์คํ
๊ด๋ฆฌ์ ๊ถํ์ด ์๋ ID)๋ก ์๋ฒ๋ฅผ ์คํํ์ญ์์ค.
Server๋ฅผ ์ด๋ป๊ฒ ์์ ํ๊ฒ ๊ธฐ๋ํ๋๊ฐ ํ๋ ๊ฒ์ ๋ฌธ์๋ฅผ ์ฐธ์กฐํ์๊ธฐ ๋ฐ๋๋๋ค.
๊ทธ๋์ sudo ๊ถํ ์๋ ์ผ๋ฐ ์ฌ์ฉ์ ๊ณ์ ์ผ๋ก systemctl start ์๋น์ค๋ช
์ ์
๋ ฅ ํ๋๋ฐ ๋๋ค...
systemctl์ ์๋ root๋ก๋ง ์คํ์ด ๊ฐ๋ฅ, sudo ๊ถํ ์๋ ๊ณ์ ์ผ๋ก ์คํ ์ root ๋น๋ฐ๋ฒํธ๋ฅผ ์
๋ ฅํ๋ผ๊ณ ๋์ค๋๋ฐ root ๋น๋ฐ๋ฒํธ ์
๋ ฅ ํ ์ ์ ์คํ์ด ๋จ


systemctl ์๋ฌ๋ฅผ ์ ๋ง๋๊ธธ ๋ฐ๋ผ์ง๋ง ๋ง์ผ ์๋ฌ๋ฅผ ๋ง๋ ๊ฒฝ์ฐ ๊ฒฝ๋ก์ ์ง์ ๋ค์ด๊ฐ์ ์คํํด ๋ณธ ๋ค์ ์๋ฌ๋ก๊ทธ๋ฅผ ๋ณด๋ฉด์ ๋ฌธ์ ํด๊ฒฐ์ด ํ์ํ๋ค๊ณ ์๊ฐ๋จ

๋๊ธ