1、配置文件
2、查看配置文件的位置:
1
2
3
4
5
6
7
8
|
postgres=
# selectname,setting from pg_settings where category='File Locations';
name | setting
-------------------+-----------------------------------------
config_file |
/var/lib/pgsql/9
.6
/data/postgresql
.conf
data_directory |
/var/lib/pgsql/9
.6
/data
external_pid_file |
hba_file |
/var/lib/pgsql/9
.6
/data/pg_hba
.conf
ident_file |
/var/lib/pgsql/9
.6
/data/pg_ident
.conf
|
3、postgresql.conf
1
2
3
4
5
6
7
8
9
10
|
postgres=
# selectname,context,unit,setting,boot_val,reset_val from pg_settings where namein('listen_addresses','max_connections','shared_buffers','effective_cache_size','work_mem','maintenance_work_mem')order by context,name;
name | context | unit | setting |boot_val | reset_val
----------------------+------------+------+---------+-----------+-----------
listen_addresses | postmaster | | * | localhost | *
max_connections | postmaster | | 100 | 100 | 100
shared_buffers | postmaster | 8kB | 16384 | 1024 | 16384
effective_cache_size | user | 8kB | 524288 | 524288 | 524288
maintenance_work_mem | user | kB | 65536 | 65536 | 65536
work_mem | user | kB | 4096 | 4096 | 4096
(6 rows)
|
1
|
Alter system
set
work_mem=8192;
|
1
|
Select pg_reload_conf();
|
4、pg_hba.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
|
# TYPE DATABASE USER ADDRESS METHOD
# "local" isfor Unix domain socket connections only
local
all all peer
# IPv4 localconnections:
host all all 0.0.0.0
/0
trust
# IPv6 localconnections:
host all all ::1
/128
ident
# Allow replicationconnections from localhost, by a user with the
# replication privilege.
#local replication postgres peer
#host replication postgres 127.0.0.1/32 ident
#host replication postgres ::1/128 ident
|
-
1版本开始引入了peer身份验证模式。
5、配置文件的重新加载
1
2
3
|
/usr/pgsql-9
.6
/bin/pg_ctlreload
-D
/var/lib/pgsql/9
.6
/data/
systemctlreload postgresql-9.6.service
selectpg_reload_conf();
|