No Pg_hba.conf Entry For Host

準備

postgresql94
AWS上にt1.smallでPostgresqlが動いているAmazonLinuxを2台構築。

Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. Learn more org.postgresql.util.PSQLException: FATAL: no pghba.conf entry for host. Oct 29, 2015  To do so, please locate the pghba.conf file on your Postgres server. Once you find this file, please add following lines in the file to allow the server (which will host oozie/hive service) to connect with Oozie/Hive database on Postgres server. Please see the screenshot for better understanding.

参考にしたウェブサイト

エラー1

AWS の security group に自分自身のsgを許可(5432)

エラー2

pg_basebackup が動いた。

メモ

AmazonLinux の場合、
recovery.conf.sample

/usr/share/pgsql94/recovery.conf.sample
にあった。

エラー3

INSERT文が止まる。
アプリも動かない(nginx 504 error: Gateway Timeout)

If you’ve got what it takes to be part of an elite trucking force, get behind the wheel and prove it Take advantage of additional features of Euro Truck Simulator 2 by joining our online community on World of Trucks, our center for virtual truckers all around the world interested in Euro Truck Simulator 2 and future SCS Software’s truck simulators. Download – Euro Truck Simulator 2Use in-game Photo Mode to capture the best moments and share them with thousands of people who love trucks. Euro truck simulator bus mod free download.

参考にしたウェブサイトと違って client_addr や state などが空になっていた。
ただ、この状態はエラーの原因ではなかった。

psql から INSERTして応答がなかったので、controll + c した時のメッセージ。

このエラーは、
master db の postgresql.conf に書く、synchronous_standby_names の値と
slave db の recovery.conf に書く、primary_conninfo の中の値が違っていると発生するっぽい。
レコード自体は作られていた。

Introduction

This document describes how to resolve 'FATAL: no pg_hba.conf entry for host' error when login to CloudCenter Manager Postgres standalone server with the use of PGAdmin tool.

Prerequisites

Requirements

Cisco recommends that you have knowledge of these topics:

  • PostgreSQL
  • PGAdmin tool

Components Used

The information in this document is based on these software versions:

  • CloudCenter version 4.8.2
  • MGMTPOSTGRES_STANDALONE
  • Posrgres9.6

The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.

Problem

When you try to connect the CloudCenter Postgres server with the use of pgAdmin, it fails with the 'UNAUTHORIZED' error as shown in the image.

Solution

This authentication issue happens when you try to connect to the Postgres SQL server remotely other than the CloudCenter Manager server. In order to resolve this error, follow these steps:

1. Log in to Postgres SQL server with the use of ssh console.

2. cd to /var/lib/pgsql/9.6/data/.

3. Open pg_hba.conf file in an editor.

4. Add an entry of the host IP address from which you try to connect. You can input the entry of the host which you would like to provide access to as shown in the image.

Entry

5. Restart the postgres SQL server.

6. Try again in order to connect with the use of pgAdmin tool and you should be able to connect without any errors as shown in the image.