어제 가상머신에 postgres를 설치했는데, 리붓을 해서 그런지 서버가 안열려있는 듯 하다.
아래와 같이 연결할 수 없다고 함.
[postgres@heninet1 ~]$ psql
psql: could not connect to server: No such file or directory
    Is the server running locally and accepting
    connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

postgres 프로세스가 안떠있다.
[postgres@heninet1 ~]$ ps -ef | grep post
root       1248      1  0 10:23 ?        00:00:00 /usr/libexec/postfix/master -w
postfix    1249   1248  0 10:23 ?        00:00:00 pickup -l -t unix -u
postfix    1250   1248  0 10:23 ?        00:00:00 qmgr -l -t unix -u
root       2459   2420  0 10:24 pts/1    00:00:00 su - postgres
postgres   2465   2459  0 10:25 pts/1    00:00:00 -bash
postgres   2523   2465  0 10:26 pts/1    00:00:00 ps -ef
postgres   2524   2465  0 10:26 pts/1    00:00:00 grep --color=auto post

centOS 7 버전이므로, systemctl을 이용하여 서비스 구동여부 확인. centOS 6이하는 service~구문으로 확인한다. (http://heni.tistory.com/22)
inactive! 떠있지않다. 
[postgres@heninet1 ~]$ systemctl status postgresql.service
● postgresql.service - PostgreSQL database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql.service; disabled; vendor preset: disabled)
   Active: inactive (dead)

아래와같이 구동시켜주면
[postgres@heninet1 ~]$ systemctl start postgresql.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: heni
Password:
==== AUTHENTICATION COMPLETE ===

postgres 관련 프로세스가 뜨는것을 확인할 수 있다.
[postgres@heninet1 ~]$ ps -ef | grep postgres
root       2459   2420  0 10:24 pts/1    00:00:00 su - postgres
postgres   2465   2459  0 10:25 pts/1    00:00:00 -bash
postgres   2599      1  0 10:28 ?        00:00:00 /usr/bin/postgres -D /var/lib/pgsql/data -p 5432
postgres   2600   2599  0 10:28 ?        00:00:00 postgres: logger process   
postgres   2602   2599  0 10:28 ?        00:00:00 postgres: checkpointer process   
postgres   2603   2599  0 10:28 ?        00:00:00 postgres: writer process   
postgres   2604   2599  0 10:28 ?        00:00:00 postgres: wal writer process   
postgres   2605   2599  0 10:28 ?        00:00:00 postgres: autovacuum launcher process   
postgres   2606   2599  0 10:28 ?        00:00:00 postgres: stats collector process   
postgres   2659   2465  0 10:30 pts/1    00:00:00 ps -ef
postgres   2660   2465  0 10:30 pts/1    00:00:00 grep --color=auto postgres

psql도 잘 접속 됨 *^^*
[postgres@heninet1 ~]$ psql
psql (9.2.23)
Type "help" for help.

postgres=#


+ Recent posts