1. 에러

initdb 실행 시, 공유 라이브러리를 읽는데 실패했다는 에러 로그 떨어짐

더보기

$ ./initdb -D $PGDATA
./initdb: error while loading shared libraries: libpq.so.5: cannot open shared object file: No such file or directory

2. 트러블슈팅

더보기

// libpq.so.5 라이브러리 찾고 심볼릭링크 추가 (기존 것 삭제 후 심볼릭 링크 재적용)

 

[root@ontune ~]# find / -type f libpq.so.5
/database/postgresql/lib/libpq.so.5
[root@ontune ~]#
[root@ontune ~]# cd /database/postgresql/lib/
[root@ontune lib]# ls -arlt | grep libpq.so.5
-rwxr-xr-x. 1 postgres postgres  363864 Oct  1 14:03 libpq.so.5.16
lrwxrwxrwx. 1 postgres postgres      13 Oct  1 14:03 libpq.so.5 -> libpq.so.5.16
lrwxrwxrwx. 1 postgres postgres      13 Oct  1 14:03 libpq.so -> libpq.so.5.16

[root@ontune lib]#
[root@ontune lib]# ln -s libpq.so.5.16 libpq.so.5
ln: failed to create symbolic link 'libpq.so.5': File exists
[root@ontune lib]# rm libpq.so.5
rm: remove symbolic link 'libpq.so.5'? yes
[root@ontune lib]#
[root@ontune lib]# ln -s libpq.so.5.16 libpq.so.5 //심볼릭 링크 지우고 재설정

 

 

 

// initDB 정상 수행

 

./initdb -D $PGDATA
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.UTF-8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /database/postgresql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Asia/Seoul
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
initdb: hint: You can change this by editing pg_hba.conf or using the option -A, or --auth-local and --auth-host, the next time you run initdb.

Success. You can now start the database server using:

    pg_ctl -D /database/postgresql/data -l logfile start

 

계속 까먹네;