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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 【自荐】一款简洁、开源的在线白板工具 Drawnix