1 ๋ถ„ ์†Œ์š”

Postgres ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜ ์˜ค๋ฅ˜

macos ํ™˜๊ฒฝ์—์„œ PostgreSQL ์„œ๋ฒ„๋ฅผ ์‹คํ–‰ํ•˜๊ธฐ ์œ„ํ•ด Postgres ๋ผ๋Š” ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ๋‹ค.

์–ด๋Š ์ˆœ๊ฐ„, Postgres ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์„ ์‚ฌ์šฉํ•ด ์„œ๋ฒ„๋ฅผ ์‚ฌ์šฉํ•˜๋ ค๊ณ  ํ•˜์ž ๋นจ๊ฐ„์ƒ‰ ์ ๊ณผ ํ•จ๊ป˜ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€๊ฐ€ ๋‚˜ํƒ€๋‚ฌ๊ณ , start ๋ฒ„ํŠผ์„ ๋ˆ„๋ฅด๋‹ˆ ์•„๋ž˜์™€ ๊ฐ™์€ ์˜ค๋ฅ˜ ๋ฉ”์‹œ์ง€์™€ ํ•จ๊ป˜ ์„œ๋ฒ„๊ฐ€ ์‹คํ–‰๋˜์ง€ ์•Š์•˜๋‹ค.

mac postgres could not start postgresql server.

pg_ctl: could not start server examine the log output.

์บก์ณ๋ฅผ ํ• ๊ฑธ ๊ทธ๋žฌ๋‹ค.

์˜ค๋ฅ˜ ๋กœ๊ทธ

$ cd ~/Library/Application Support/Postgres/var-16/

์œ„ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ์—ฌ๋Ÿฌ ํŒŒ์ผ์„ ๋ณผ ์ˆ˜ ์žˆ๋Š”๋ฐ, ๊ทธ ์ค‘ postgresql.log ๋ผ๋Š” ํŒŒ์ผ์ด ์žˆ๋‹ค.

์—ฌ๊ธฐ์— ๋ณด๋ฉด ์–ด๋–ค ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ–ˆ๋Š”์ง€ ๋กœ๊ทธ๊ฐ€ ์ฐํ˜€ ์ด ๋กœ๊ทธ๋ฅผ ๋ณด๊ณ  ์˜ค๋ฅ˜๋ฅผ ํ•ด๊ฒฐํ•  ์ˆ˜ ์žˆ๋‹ค!!

$ cat postgresql.log

์ด๋ฒˆ ๊ฒฝ์šฐ์˜ ์—๋Ÿฌ ๋กœ๊ทธ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค.

2024-05-31 03:30:49.745 KST [11411] LOG:  starting PostgreSQL 16.3 (Postgres.app) on aarch64-apple-darwin21.6.0, compiled by Apple clang version 14.0.0 (clang-1400.0.29.102), 64-bit
2024-05-31 03:30:49.747 KST [11411] LOG:  listening on IPv4 address "127.0.0.1", port 5432
2024-05-31 03:30:49.747 KST [11411] LOG:  listening on IPv6 address "::1", port 5432
2024-05-31 03:30:49.748 KST [11411] LOG:  could not bind Unix address "/tmp/.s.PGSQL.5432": Address already in use
2024-05-31 03:30:49.748 KST [11411] HINT:  Is another postmaster already running on port 5432?
2024-05-31 03:30:49.748 KST [11411] WARNING:  could not create Unix-domain socket in directory "/tmp"
2024-05-31 03:30:49.748 KST [11411] FATAL:  could not create any Unix-domain sockets
2024-05-31 03:30:49.748 KST [11411] LOG:  database system is shut down

5432๋ฒˆ ํฌํŠธ๊ฐ€ ์ด๋ฏธ ์‚ฌ์šฉ ์ค‘์ด๋ผ๋Š” ์˜ค๋ฅ˜ ๊ฐ™์€๋ฐ..

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

์—ฌ๋Ÿฌ ๋ฒˆ์˜ ์‚ฝ์งˆ ๊ฒฐ๊ณผ ์•„๋ž˜์™€ ๊ฐ™์€ ๋ฐฉ๋ฒ•์œผ๋กœ ํ•ด๊ฒฐ์„ ํ•  ์ˆ˜ ์žˆ์—ˆ๋‹ค!

$ ps aux | grep postgres

์œ„ ๋ช…๋ น์–ด๋กœ postgres ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์ด ์‚ฌ์šฉ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค์˜ ์ •๋ณด(?)๋ฅผ ์ „๋ถ€ ์ฐพ๋Š”๋‹ค.

์›๋ž˜๋Š” sudo lsof -i :5432 ๋ช…๋ น์–ด๋กœ ์ง„ํ–‰ํ–ˆ์œผ๋‚˜, ์ด ๋ฐฉ๋ฒ•์œผ๋กœ ํ•˜๋ฉด ํ”„๋กœ์„ธ์Šค๊ฐ€ ์•ˆ์ฃฝ์—ˆ๋‹ค.. ์ด์œ ๋Š” ์•„์ง ๋ชป์ฐพ์Œ.. (์ฐพ์œผ๋ฉด ์—…๋ฐ์ดํŠธ ์˜ˆ์ •)

๊ทธ๋Ÿผ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ํ”„๋กœ์„ธ์Šค๊ฐ€ ๋‚˜์˜ฌํ…๋ฐ,,

$ sudo kill -9 <PID>

์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ฃฝ์ด์ž..!

์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ๋‹ค์‹œ ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰๋œ๋‹ค!! แ„‰แ…ณแ„แ…ณแ„…แ…ตแ†ซแ„‰แ…ฃแ†บ 2024-05-31 แ„‹แ…ฉแ„Œแ…ฅแ†ซ 9 29 33

์ฐธ๊ณ ์ž๋ฃŒ

How can I start PostgreSQL server on Mac OS X?

Problem with Postgres: โ€œpg_ctl: could not start serverโ€

[Mac OS] ํ˜„์žฌ ์—ด๋ ค์žˆ๋Š” ํฌํŠธ ํ™•์ธ ๋ฐ ๋‹ซ๊ธฐ

ํƒœ๊ทธ:

์นดํ…Œ๊ณ ๋ฆฌ:

์—…๋ฐ์ดํŠธ:

๋Œ“๊ธ€๋‚จ๊ธฐ๊ธฐ