PostgreSQL/PostgreSQLでIPv6のリッスンを無効にしたい場合の対処
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
* PostgreSQLでIPv6のリッスンを無効にしたい場合の対処 [#e3...
CentOS6にyumコマンドを利用してPostgreSQLをインストールし...
早速、以下のようにpsqlコマンドでlocalhostと設定したら接続...
[sakura@centos6 ~]$ psql -h localhost
psql: FATAL: ホスト"::1"、ユーザ"sakura"、データベース"...
以前、公開した以下のリンクの通り、pg_hba.confを修正済みで...
-[[localhostを指定すると接続できない場合の対処方法>Postgr...
以下、調査した内容を記します。
#contents
#htmlinsertpcsp(db-top.html,db-sp.html)
* 関連記事 [#l45c103d]
-[[localhostを指定すると接続できない場合の対処方法>Postgr...
* 使用環境 [#x527b24c]
-OS~
CentOS 6
-PostgreSQL~
PostgreSQL 8.4.13
* netstatコマンドで5432ポートを確認してみると… [#h34e2330]
IPv4, IPv6のlocalhostをLISTENしているのが確認できました。
[root@centos6 ~]# netstat -ant | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:...
tcp 0 0 ::1:5432 :::* ...
* psqlのエラー出力をみてみると… [#b8c9ce30]
ホストが "::1"となっています。~
IPv6で接続しようとしているようです。
[sakura@centos6 app]$ psql -h localhost
psql: FATAL: ホスト"::1"、ユーザ"sakura"、データベース"...
* IPv6でも接続できるようにpg_hba.confを修正する [#l2dc6bd8]
本資料では、IPv6を無効化する方法を記述することにしていま...
pg_hba.confのIPv6 local connectionを修正しPostgreSQLを再...
-pg_hba.confの抜粋(修正済)
# IPv6 local connections:
host all all ::1/128 tr...
PostgreSQLをserviceコマンドを使用して再起動すると接続でき...
[sakura@centos6 ~]$ psql -h localhost
psql (8.4.13)
"help" でヘルプを表示します.
sakura=#
* postgresql.confを修正してIPv4のローカルホストのみListen...
以下は、pg_hba.confの修正は行っていません。~
postgresql.confのlisten_addressesのみ変更しました。~
CentOS6にyumコマンドでインストールしたpotgresql.confのlis...
# - Connection Settings -
listen_addresses = 'localhost' # what IP addres...
# comma-separate...
# defaults to 'l...
# (change requir...
これを以下のように変更し保存し、PostgreSQLを再起動します。
listen_addresses = '0.0.0.0'
また、pg_hba.confの設定は以前公開した「[[localhostを指定...
# IPv4 local connections:
host all all 127.0.0.1/32 tr...
psqlコマンドで接続してみます。
[sakura@centos6 ~]$ psql -h localhost
psql (8.4.13)
"help" でヘルプを表示します.
sakura=#
netstatコマンドでポート状態を確認してみます。
[root@centos6 ~]# netstat -ant | grep 5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:...
tcp 0 0 127.0.0.1:5432 127.0.0....
tcp 0 0 127.0.0.1:38286 127.0.0....
0.0.0.0:*と上記のpsqlコマンドで接続した状態が確認できます...
例にlisten_addresses = '127.0.0.1' と設定した場合は以下の...
[root@centos6 ~]# netstat -ant | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:...
tcp 0 0 127.0.0.1:38288 127.0.0....
以上、PostgreSQLをIPv4でlocalhostに接続する方法を記述しま...
#htmlinsertpcsp(db-btm.html,db-sp.html)
終了行:
#navi(../)
* PostgreSQLでIPv6のリッスンを無効にしたい場合の対処 [#e3...
CentOS6にyumコマンドを利用してPostgreSQLをインストールし...
早速、以下のようにpsqlコマンドでlocalhostと設定したら接続...
[sakura@centos6 ~]$ psql -h localhost
psql: FATAL: ホスト"::1"、ユーザ"sakura"、データベース"...
以前、公開した以下のリンクの通り、pg_hba.confを修正済みで...
-[[localhostを指定すると接続できない場合の対処方法>Postgr...
以下、調査した内容を記します。
#contents
#htmlinsertpcsp(db-top.html,db-sp.html)
* 関連記事 [#l45c103d]
-[[localhostを指定すると接続できない場合の対処方法>Postgr...
* 使用環境 [#x527b24c]
-OS~
CentOS 6
-PostgreSQL~
PostgreSQL 8.4.13
* netstatコマンドで5432ポートを確認してみると… [#h34e2330]
IPv4, IPv6のlocalhostをLISTENしているのが確認できました。
[root@centos6 ~]# netstat -ant | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:...
tcp 0 0 ::1:5432 :::* ...
* psqlのエラー出力をみてみると… [#b8c9ce30]
ホストが "::1"となっています。~
IPv6で接続しようとしているようです。
[sakura@centos6 app]$ psql -h localhost
psql: FATAL: ホスト"::1"、ユーザ"sakura"、データベース"...
* IPv6でも接続できるようにpg_hba.confを修正する [#l2dc6bd8]
本資料では、IPv6を無効化する方法を記述することにしていま...
pg_hba.confのIPv6 local connectionを修正しPostgreSQLを再...
-pg_hba.confの抜粋(修正済)
# IPv6 local connections:
host all all ::1/128 tr...
PostgreSQLをserviceコマンドを使用して再起動すると接続でき...
[sakura@centos6 ~]$ psql -h localhost
psql (8.4.13)
"help" でヘルプを表示します.
sakura=#
* postgresql.confを修正してIPv4のローカルホストのみListen...
以下は、pg_hba.confの修正は行っていません。~
postgresql.confのlisten_addressesのみ変更しました。~
CentOS6にyumコマンドでインストールしたpotgresql.confのlis...
# - Connection Settings -
listen_addresses = 'localhost' # what IP addres...
# comma-separate...
# defaults to 'l...
# (change requir...
これを以下のように変更し保存し、PostgreSQLを再起動します。
listen_addresses = '0.0.0.0'
また、pg_hba.confの設定は以前公開した「[[localhostを指定...
# IPv4 local connections:
host all all 127.0.0.1/32 tr...
psqlコマンドで接続してみます。
[sakura@centos6 ~]$ psql -h localhost
psql (8.4.13)
"help" でヘルプを表示します.
sakura=#
netstatコマンドでポート状態を確認してみます。
[root@centos6 ~]# netstat -ant | grep 5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:...
tcp 0 0 127.0.0.1:5432 127.0.0....
tcp 0 0 127.0.0.1:38286 127.0.0....
0.0.0.0:*と上記のpsqlコマンドで接続した状態が確認できます...
例にlisten_addresses = '127.0.0.1' と設定した場合は以下の...
[root@centos6 ~]# netstat -ant | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:...
tcp 0 0 127.0.0.1:38288 127.0.0....
以上、PostgreSQLをIPv4でlocalhostに接続する方法を記述しま...
#htmlinsertpcsp(db-btm.html,db-sp.html)
ページ名: