From 432de6d455bf0c5a753188308fff6ba35a960334 Mon Sep 17 00:00:00 2001 From: lime <531404991@qq.com> Date: Wed, 22 Mar 2023 14:11:07 +0000 Subject: [PATCH] add postgres install Signed-off-by: lime <531404991@qq.com> --- postgres/postgres-install.sh | 88 ++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 postgres/postgres-install.sh diff --git a/postgres/postgres-install.sh b/postgres/postgres-install.sh new file mode 100644 index 0000000..9d9f50b --- /dev/null +++ b/postgres/postgres-install.sh @@ -0,0 +1,88 @@ +#!/bin/bash +#Copyright lime qq:531404991 +#shell instalL postgres-10.5 +#tar gz +#可选 +#cd contrib/fuzzystrmatch/ +#make +#make install +fdir=/opt/soft/postgres #压缩包上传目录 +echo "安装即将开始,请确认已经将dba给的整个soft目录上传至服务器的/opt/目录" +sleep 5 +sudo sed -i "7s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config +sudo firewall-cmd --zone=public --add-port=5432/tcp --permanent +sudo firewall-cmd --reload +sudo firewall-cmd --list-ports +sleep 1 +sudo yum -y install wget bzip2 gcc gcc-c++ readline-devel zlib-devel make systemtap systemtap-sdt-devel perl perl-devel python python-devel tcl tcl-devel sgml-common stylesheets openjade sgml-tools xsltproc libxslt libxslt-devel libxml2 libxml2-devel zlib zlib-devel openssl openssl-devel pam pam-devel libreadline6-dev flex +#postgres 安装 +cd $fdir +pwd +sleep 1 +sudo tar -xzvf postgresql-10.5.tar.gz && cd postgresql-10.5 +sudo mkdir /usr/local/postgresql-10.5 +./configure --prefix=/usr/local/postgresql-10.5 >> $fdir/postgres初始化信息.txt +sudo make && make install +sudo cd contrib/ +sudo make && make install +sudo cd ~ +sudo useradd postgres +sudo echo postgres | passwd --stdin postgres +sudo mkdir /data/postgres/ +sudo chown -R postgres:postgres /data/postgres/ +#修改配置文件先导版本 +su - postgres <