合 在国产统信UOS Server 20 (1060a) (kongzi)上安装PG15和PG16
Tags: PGPostgreSQL安装部署统信UOSPG 16
环境
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | docker rm -f lhruosv201060apg docker run -itd --name lhruosv201060apg -h lhruosv201060apg \ -v /sys/fs/cgroup:/sys/fs/cgroup \ --restart=always \ --privileged=true lhrbest/uos_server:v20-1060a-v3.0 \ /usr/sbin/init [root@lhrdb ~]# docker exec -it lhruosv201060apg bash [root@lhruosv201060apg /]$ [root@lhruosv201060apg /]$ uosinfo ################################################# Release: UOS Server release 20 (kongzi) Kernel : 3.10.0-1160.95.1.el7.x86_64 Build : UOS Server 20 (1060a) 20230606 amd64 ################################################# [root@lhruosv201060apg /]$ |
安装
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | dnf install -y cmake make gcc gcc-c++ perl readline readline-devel zlib zlib-devel \ perl python36 tcl openssl ncurses-devel openldap pam perl-IPC-Run libicu-devel libarchive libzstd yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm sed -i 's/gpgcheck=1/gpgcheck=0/g' /etc/yum.repos.d/pgdg-redhat-all.repo sed -i 's/repo_gpgcheck = 1/repo_gpgcheck = 0/g' /etc/yum.repos.d/pgdg-redhat-all.repo -- 国产OS,需要修改yum源的配置 sudo sed -i 's/\$releasever/8/g' /etc/yum.repos.d/pgdg-redhat-all.repo -- 若是CentOS8和9,则需要禁用内置的PostgreSQL模块,否则会报错 All matches were filtered out by modular filtering for argument sudo dnf -qy module disable postgresql yum repolist enabled | grep pgdg -- 安装pg15和16版本 yum install -y postgresql15 postgresql15-server postgresql15-contrib postgresql15-libs postgresql15-devel yum install -y postgresql16 postgresql16-server postgresql16-contrib postgresql16-libs postgresql16-devel # 最终一共需要5个rpm包 [root@lhruosv201060apg ~]$ rpm -aq| grep postgres | grep 15 postgresql15-server-15.5-2PGDG.rhel8.x86_64 postgresql15-devel-15.5-2PGDG.rhel8.x86_64 postgresql15-15.5-2PGDG.rhel8.x86_64 postgresql15-contrib-15.5-2PGDG.rhel8.x86_64 postgresql15-libs-15.5-2PGDG.rhel8.x86_64 [root@lhruosv201060apg ~]$ rpm -aq| grep postgres | grep 16 postgresql16-16.1-4PGDG.rhel8.x86_64 postgresql16-libs-16.1-4PGDG.rhel8.x86_64 postgresql16-server-16.1-4PGDG.rhel8.x86_64 postgresql16-devel-16.1-4PGDG.rhel8.x86_64 postgresql16-contrib-16.1-4PGDG.rhel8.x86_64 |
其它配置
以pg16为例: