前端之家收集整理的这篇文章主要介绍了
解决pgadmin连不上postgresql,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
[gpadmin@sgpc146 ~]$ vi $MASTER_DATA_DIRECTORY/pg_hba.conf
# Postgresql Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the Postgresql
# documentation for a complete description of this file. A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect,how clients
# are authenticated,which Postgresql user names they can use,which
# databases they can access. Records take one of these forms:
#
# local DATABASE USER METHOD [OPTIONS]
# host DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
# hostssl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
# hostnossl DATABASE USER CIDR-ADDRESS METHOD [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: "local" is a Unix-domain
# socket,"host" is either a plain or SSL-encrypted TCP/IP socket,# "hostssl" is an SSL-encrypted TCP/IP socket,and "hostnossl" is a
# plain TCP/IP socket.
#
# DATABASE can be "all","sameuser","samerole",a
# database name,or a comma-separated list thereof.
#
# USER can be "all",a user name,a group name prefixed with "+",or a
# comma-separated list thereof. In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names
# from a separate file.
#
# CIDR-ADDRESS specifies the set of hosts the record matches. It is
# made up of an IP address and a CIDR mask that is an integer (between
# 0 and 32 (IPv4) or 128 (IPv6) inclusive) that specifies the number
"/data/master/gpseg-1/pg_hba.conf" 86L,4411C 1,1 Top
# special characters must be quoted. Quoting one of the keywords
# "all","samerole" or "replication" makes the name lose
# its special character,and just match a database or username with
# that name.
#
# This file is read on server startup and when the postmaster receives
# a SIGHUP signal. If you edit the file on a running system,you have
# to SIGHUP the postmaster for the changes to take effect. You can
# use "pg_ctl reload" to do that.
# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections,you need to add more
# "host" records. In that case you will also need to make Postgresql
# listen on a non-local interface via the listen_addresses
# configuration parameter,or via the -i or -h command line switches.
# CAUTION: Configuring the system for local "trust" authentication allows
# any local user to connect as any Postgresql user,including the database
# superuser. If you do not trust all your local users,use another
# authentication method.
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
# IPv4 local connections:
# IPv6 local connections:
local all gpadmin ident
host all gpadmin 127.0.0.1/28 trust
host all gpadmin 129.100.253.146/32 trust
host all gpadmin 169.254.95.120/32 trust
host all gpadmin ::1/128 trust
host all gpadmin 2002:8164:fdd6:b:3640:b5ff:fea2:119c/128 trust
host all gpadmin 2002:8164:fdde:b:3640:b5ff:fea2:119c/128 trust
host all gpadmin fec0::b:3640:b5ff:fea2:119c/128 trust
host all gpadmin fe80::3640:b5ff:fea2:119c/128 trust
host all gpadmin fe80::3440:b5ff:fe9b:119f/128 trust
host all all 0.0.0.0/0 trust
"/data/master/gpseg-1/pg_hba.conf" 87L,4440C written
[gpadmin@sgpc146 ~]$ gpstop -u
20110928:21:13:19:028768 gpstop:sgpc146:gpadmin-[INFO]:-Starting gpstop with args: -u
20110928:21:13:19:028768 gpstop:sgpc146:gpadmin-[INFO]:-Gathering information and validating the environment...
20110928:21:13:19:028768 gpstop:sgpc146:gpadmin-[INFO]:-Obtaining Greenplum Master catalog information
20110928:21:13:19:028768 gpstop:sgpc146:gpadmin-[INFO]:-Obtaining Segment details from master...
20110928:21:13:19:028768 gpstop:sgpc146:gpadmin-[INFO]:-Greenplum Version: 'postgres (Greenplum Database) 4.2.1.2 build 2'
20110928:21:13:19:028768 gpstop:sgpc146:gpadmin-[INFO]:-Signalling all postmaster processes to reload
.
[gpadmin@sgpc146 ~]$ ps -ef |grep 5432
gpadmin 21643 1 0 20:40 ? 00:00:00 /usr/local/greenplum-db-4.2.1.2/bin/postgres -D /data/master/gpseg-1 -p 5432 -b 1 -z 2 --silent-mode=true -i -M master -C -1 -x 0 -E
gpadmin 21644 21643 0 20:40 ? 00:00:00 postgres: port 5432,master logger process
gpadmin 21647 21643 0 20:40 ? 00:00:00 postgres: port 5432,stats collector process
gpadmin 21648 21643 0 20:40 ? 00:00:00 postgres: port 5432,writer process
gpadmin 21649 21643 0 20:40 ? 00:00:00 postgres: port 5432,checkpoint process
gpadmin 21650 21643 0 20:40 ? 00:00:00 postgres: port 5432,seqserver process
gpadmin 21651 21643 0 20:40 ? 00:00:00 postgres: port 5432,WAL Send Server process
gpadmin 21652 21643 0 20:40 ? 00:00:00 postgres: port 5432,ftsprobe process
gpadmin 21653 21643 0 20:40 ? 00:00:00 postgres: port 5432,sweeper process
gpadmin 28936 27517 0 21:13 pts/1 00:00:00 grep 5432
[gpadmin@sgpc146 ~]$
原文链接:https://www.f2er.com/postgresql/196403.html