暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
源码安装postgres.docx
605
4页
5次
2022-06-07
5墨值下载
安装
linux7.6
安装前准备
1.
下载
postgres
源码包
hps://www.postgresql.org/p/source/
2
关闭
SELinux
:修改
/etc/selinux/cong
文件,将
SELINUX=
后面的值改为
disabled
关闭防火墙
systemctl disable rewalld
systemctl stop rewalld
3
安装依赖包
yum -y install readline readline-devel zlib zlib-devel gettext
gettext-devel openssl openssl-devel pam pam-devel libxml2 libxml2-
devel libxslt libxslt-devel perl perl-devel tcl-devel uuid-devel gcc
gcc-c++ make &ex bison perl-ExtUtils*
4.
设置主机名,配置
hosts
文件
hostnamectl set-hostname xxx
vi /etc/hosts
192.168.1.1(
本机
ip) xxx
(主机名)
5.
内核参数调整
Vi /etc/sysctl.conf
添加
fs.le-max = 76724200
kernel.sem = 10000 10240000 10000 1024
kernel.shmmni = 4096
kernel.shmall = 253702
kernel.shmmax = 1039163392
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.wmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_max = 1048576
fs.aio-max-nr = 40960000
vm.dirty_ratio=20
vm.dirty_background_ratio=3
vm.dirty_writeback_centisecs=100
vm.dirty_expire_centisecs=500
vm.swappiness=10
vm.min_free_kbytes=524288
vm.swappiness=0
vm.overcommit_memory=2
vm.overcommit_ratio=75
net.ipv4.ip_local_port_range = 10000 65535
6.
创建用户和组
groupadd dba
useradd -g dba postgres
usermod -G wheel postgres
id postgres
uid=2000(postgres) gid=2000(dba) groups=2000(dba),10(wheel)
echo "postgres"|passwd --stdin postgres
7.
目录规划
#
源文件目录
mkdir /soft
#
安装文件目录
mkdir -p /opt/pg12
#
数据目录
mkdir -p /opt/pgdata
#WAL
目录
mkdir -p /opt/pgwal
#
归档目录
mkdir -p /opt/pgarchive
chown -R postgres:dba /soft /opt
chmod 0700 /opt/pgdata /opt/pgwal /opt/pgarchive
8.limits
设置
of 4
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

关注
最新上传
暂无内容,敬请期待...
下载排行榜
Top250 周榜 月榜