0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

CentOS7にPostgres9.5インストール&設定

0
Posted at

しようとしていて
https://qiita.com/SOJO/items/a1d97887d24c3e44596f
を見つけたのですが
なんかこちらと環境が違うし
とりあえずやった事とエラーメッセージを書いて
後学のために役立てるっ(๑•̀ㅁ•́๑)✧

現状(何かいじって【最下部に表記】)リスタートしても

[root@localhost ~]# systemctl restart postgresql-9.5
Job for postgresql-9.5.service failed because the control process exited with error code. See "systemctl status postgresql-9.5.service" and "journalctl -xe" for details.

とエラーが出たのでステータスを見てみると

[root@localhost ~]# systemctl status postgresql-9.5
● postgresql-9.5.service - PostgreSQL 9.5 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since 金 2019-04-19 09:46:06 JST; 12min ago
     Docs: https://www.postgresql.org/docs/9.5/static/
  Process: 32816 ExecStop=/usr/pgsql-9.5/bin/pg_ctl stop -D ${PGDATA} -s -m fast (code=exited, status=0/SUCCESS)
  Process: 33172 ExecStart=/usr/pgsql-9.5/bin/pg_ctl start -D ${PGDATA} -s -w -t 300 (code=exited, status=1/FAILURE)
  Process: 33167 ExecStartPre=/usr/pgsql-9.5/bin/postgresql95-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 32098 (code=exited, status=0/SUCCESS)

 4月 19 09:46:05 localhost.localdomain systemd[1]: Starting PostgreSQL 9.5 database server...
 4月 19 09:46:05 localhost.localdomain pg_ctl[33172]: < 2019-04-19 09:46:05.897 JST >LOG:  ログ出力をログ収集プロセスにリダイレクトしています
 4月 19 09:46:05 localhost.localdomain pg_ctl[33172]: < 2019-04-19 09:46:05.897 JST >ヒント:  ここからのログ出力はディレクトリ"pg_log"に現れます。
 4月 19 09:46:06 localhost.localdomain systemd[1]: postgresql-9.5.service: control process exited, code=exited status=1
 4月 19 09:46:06 localhost.localdomain systemd[1]: Failed to start PostgreSQL 9.5 database server.
 4月 19 09:46:06 localhost.localdomain systemd[1]: Unit postgresql-9.5.service entered failed state.
 4月 19 09:46:06 localhost.localdomain systemd[1]: postgresql-9.5.service failed.

となってうまく動作出来ない模様……

後出しっぽいけど初めに設定した事と言えば

yum -y install postgresql95-server postgresql95-devel postgresql95-contrib
/usr/pgsql-9.5/bin/postgresql95-setup initdb  (初期設定)
systemctl enable postgresql-9.5
systemctl start postgresql-9.5         (postgresqlの起動設定)

firewall-cmd --permanent --add-service=postgresql(postgresqlを許可)
firewall-cmd --permanent --add-port=15432/tcp  (ポート15432を許可)
firewall-cmd --reload              (パラメータのリロード)
firewall-cmd --list-all             (確認)
systemctl restart firewalld            (FWの再起動)

vi /var/lib/pgsql/9.5/data/pg_hba.conf

#
listen_addresses = '*'
port=15432
timezone='UTC'
#
host all all 0.0.0.0/0 trust

ってやったつもりです……

また初めからインストールして確認しようかな……

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?