postgresql9.2.24安装

1、yum安装

 

yum install -y postgresql-server postgresql-contrib

 

2、初始化

 

postgresql-setup initdb

 

3、挂载数据盘

 

ln -s /data/pgsql /var/lib/pgsql

chown -R postgres:postgres pgsql

 

4、修改配置文件

pg_hba.conf

 

local   all             all                                     peer
host    all             all             0.0.0.0/0               md5
host    all             all             ::1/128                 ident

 

postgresql.conf

listen_addresses = '*'
max_connections = 200
shared_buffers = 3000MB
work_mem = 100MB
maintenance_work_mem = 1000MB
effective_cache_size = 6000MB
constraint_exclusion = partition
logging_collector = on
log_filename = 'postgresql-%a.log'
log_truncate_on_rotation = on
log_rotation_age = 1d
log_rotation_size = 0
log_timezone = 'PRC'
datestyle = 'iso, mdy'
timezone = 'PRC'
lc_messages = 'en_US.UTF-8'
lc_monetary = 'en_US.UTF-8'
lc_numeric = 'en_US.UTF-8'
lc_time = 'en_US.UTF-8'
default_text_search_config = 'pg_catalog.english'


#新增
wal_level=hot_standby
archive_mode=on
archive_command = 'cp %p /var/lib/postgresql/pg_bak/%f'
max_wal_senders=4


5、启动

systemctl start postgresql

systemctl enable postgresql

 

posted @   东哥加油!!!  阅读(218)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
点击右上角即可分享
微信分享提示