centos 7.4 + yum + pgsql 10.1

来源:互联网 发布:福特基金会 知乎 编辑:程序博客网 时间:2024/05/21 06:30
[root@tpg-1 ~]# uname -aLinux tpg-1 3.10.0-693.11.1.el7.x86_64 #1 SMP Mon Dec 4 23:52:40 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux[root@tpg-1 ~]# cat /etc/redhat-release CentOS Linux release 7.4.1708 (Core) [root@tpg-1 ~]# yum install -y make perl-ExtUtils-Embed readline-devel zlib-devel pam-devel libxml2-devel libxslt-devel openldap-devel python-devel gcc gcc-c++  open openssl-devel cmake flex bison sysstat[root@tpg-1 ~]# yum install lrzsz 按照pgsql官网的说明安装https://www.postgresql.org/download/linux/redhat/[root@tpg-1 ~]# yum install https://download.postgresql.org/pub/repos/yum/10/redhat/rhel-7-x86_64/pgdg-centos10-10-1.noarch.rpm[root@tpg-1 ~]# yum install postgresql10*Loaded plugins: fastestmirror, langpacksLoading mirror speeds from cached hostfileResolving Dependencies--> Running transaction check---> Package postgresql10.x86_64 0:10.1-1PGDG.rhel7 will be installed--> Processing Dependency: libicu for package: postgresql10-10.1-1PGDG.rhel7.x86_64---> Package postgresql10-contrib.x86_64 0:10.1-1PGDG.rhel7 will be installed--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.22)(64bit) for package: postgresql10-contrib-10.1-1PGDG.rhel7.x86_64--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.18)(64bit) for package: postgresql10-contrib-10.1-1PGDG.rhel7.x86_64--> Processing Dependency: libxslt.so.1(LIBXML2_1.0.11)(64bit) for package: postgresql10-contrib-10.1-1PGDG.rhel7.x86_64--> Processing Dependency: libxslt.so.1()(64bit) for package: postgresql10-contrib-10.1-1PGDG.rhel7.x86_64---> Package postgresql10-debuginfo.x86_64 0:10.1-1PGDG.rhel7 will be installed---> Package postgresql10-devel.x86_64 0:10.1-1PGDG.rhel7 will be installed--> Processing Dependency: libicu-devel for package: postgresql10-devel-10.1-1PGDG.rhel7.x86_64---> Package postgresql10-docs.x86_64 0:10.1-1PGDG.rhel7 will be installed---> Package postgresql10-libs.x86_64 0:10.1-1PGDG.rhel7 will be installed---> Package postgresql10-odbc.x86_64 0:10.00.0000-1PGDG.rhel7 will be installed--> Processing Dependency: libodbcinst.so.2()(64bit) for package: postgresql10-odbc-10.00.0000-1PGDG.rhel7.x86_64---> Package postgresql10-plperl.x86_64 0:10.1-1PGDG.rhel7 will be installed---> Package postgresql10-plpython.x86_64 0:10.1-1PGDG.rhel7 will be installed---> Package postgresql10-pltcl.x86_64 0:10.1-1PGDG.rhel7 will be installed--> Processing Dependency: tcl for package: postgresql10-pltcl-10.1-1PGDG.rhel7.x86_64--> Processing Dependency: libtcl8.5.so()(64bit) for package: postgresql10-pltcl-10.1-1PGDG.rhel7.x86_64---> Package postgresql10-server.x86_64 0:10.1-1PGDG.rhel7 will be installed---> Package postgresql10-tcl.x86_64 0:2.3.1-1.rhel7 will be installed---> Package postgresql10-tcl-debuginfo.x86_64 0:2.3.1-1.rhel7 will be installed---> Package postgresql10-test.x86_64 0:10.1-1PGDG.rhel7 will be installed--> Running transaction check---> Package libicu.x86_64 0:50.1.2-15.el7 will be installed---> Package libicu-devel.x86_64 0:50.1.2-15.el7 will be installed---> Package libxslt.x86_64 0:1.1.28-5.el7 will be installed---> Package tcl.x86_64 1:8.5.13-8.el7 will be installed---> Package unixODBC.x86_64 0:2.3.1-11.el7 will be installed--> Processing Dependency: libltdl.so.7()(64bit) for package: unixODBC-2.3.1-11.el7.x86_64--> Running transaction check---> Package libtool-ltdl.x86_64 0:2.4.2-22.el7_3 will be installed--> Finished Dependency ResolutionDependencies Resolved============================================================================================================================================== Package                                 Arch                Version                                Repository                           Size==============================================================================================================================================Installing: postgresql10                            x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing              1.5 M postgresql10-contrib                    x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing              587 k postgresql10-debuginfo                  x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing               18 M postgresql10-devel                      x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing              2.0 M postgresql10-docs                       x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing               14 M postgresql10-libs                       x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing              347 k postgresql10-odbc                       x86_64              10.00.0000-1PGDG.rhel7                 pgdg10-updates-testing              280 k postgresql10-plperl                     x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing               55 k postgresql10-plpython                   x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing               72 k postgresql10-pltcl                      x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing               33 k postgresql10-server                     x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing              4.3 M postgresql10-tcl                        x86_64              2.3.1-1.rhel7                          pgdg10-updates-testing              336 k postgresql10-tcl-debuginfo              x86_64              2.3.1-1.rhel7                          pgdg10-updates-testing              7.6 k postgresql10-test                       x86_64              10.1-1PGDG.rhel7                       pgdg10-updates-testing              1.6 MInstalling for dependencies: libicu                                  x86_64              50.1.2-15.el7                          base                                6.9 M libicu-devel                            x86_64              50.1.2-15.el7                          base                                702 k libtool-ltdl                            x86_64              2.4.2-22.el7_3                         base                                 49 k libxslt                                 x86_64              1.1.28-5.el7                           base                                242 k tcl                                     x86_64              1:8.5.13-8.el7                         base                                1.9 M unixODBC                                x86_64              2.3.1-11.el7                           base                                413 kTransaction Summary==============================================================================================================================================Install  14 Packages (+6 Dependent packages)Total download size: 53 MInstalled size: 212 MIs this ok [y/d/N]: yDownloading packages:(1/20): libicu-devel-50.1.2-15.el7.x86_64.rpm                                                                          | 702 kB  00:00:00     (2/20): libtool-ltdl-2.4.2-22.el7_3.x86_64.rpm                                                                         |  49 kB  00:00:00     (3/20): libxslt-1.1.28-5.el7.x86_64.rpm                                                                                | 242 kB  00:00:00     (4/20): libicu-50.1.2-15.el7.x86_64.rpm                                                                                | 6.9 MB  00:00:01     (5/20): postgresql10-10.1-1PGDG.rhel7.x86_64.rpm                                                                       | 1.5 MB  00:00:03     (6/20): postgresql10-contrib-10.1-1PGDG.rhel7.x86_64.rpm                                                               | 587 kB  00:00:03     (7/20): postgresql10-devel-10.1-1PGDG.rhel7.x86_64.rpm                                                                 | 2.0 MB  00:00:01     (8/20): postgresql10-debuginfo-10.1-1PGDG.rhel7.x86_64.rpm                                                             |  18 MB  00:00:02     (9/20): postgresql10-libs-10.1-1PGDG.rhel7.x86_64.rpm                                                                  | 347 kB  00:00:00     (10/20): postgresql10-odbc-10.00.0000-1PGDG.rhel7.x86_64.rpm                                                           | 280 kB  00:00:00     (11/20): postgresql10-plperl-10.1-1PGDG.rhel7.x86_64.rpm                                                               |  55 kB  00:00:00     (12/20): postgresql10-plpython-10.1-1PGDG.rhel7.x86_64.rpm                                                             |  72 kB  00:00:00     (13/20): postgresql10-pltcl-10.1-1PGDG.rhel7.x86_64.rpm                                                                |  33 kB  00:00:00     (14/20): postgresql10-server-10.1-1PGDG.rhel7.x86_64.rpm                                                               | 4.3 MB  00:00:00     (15/20): postgresql10-tcl-2.3.1-1.rhel7.x86_64.rpm                                                                     | 336 kB  00:00:00     (16/20): postgresql10-tcl-debuginfo-2.3.1-1.rhel7.x86_64.rpm                                                           | 7.6 kB  00:00:00     (17/20): postgresql10-test-10.1-1PGDG.rhel7.x86_64.rpm                                                                 | 1.6 MB  00:00:00     (18/20): tcl-8.5.13-8.el7.x86_64.rpm                                                                                   | 1.9 MB  00:00:00     (19/20): unixODBC-2.3.1-11.el7.x86_64.rpm                                                                              | 413 kB  00:00:00     (20/20): postgresql10-docs-10.1-1PGDG.rhel7.x86_64.rpm                                                                 |  14 MB  00:00:06     ----------------------------------------------------------------------------------------------------------------------------------------------Total                                                                                                         4.5 MB/s |  53 MB  00:00:11     Running transaction checkRunning transaction testTransaction test succeededRunning transaction  Installing : postgresql10-libs-10.1-1PGDG.rhel7.x86_64                                                                                 1/20   Installing : libicu-50.1.2-15.el7.x86_64                                                                                               2/20   Installing : postgresql10-10.1-1PGDG.rhel7.x86_64                                                                                      3/20   Installing : postgresql10-server-10.1-1PGDG.rhel7.x86_64                                                                               4/20   Installing : 1:tcl-8.5.13-8.el7.x86_64                                                                                                 5/20   Installing : libicu-devel-50.1.2-15.el7.x86_64                                                                                         6/20   Installing : postgresql10-devel-10.1-1PGDG.rhel7.x86_64                                                                                7/20   Installing : libtool-ltdl-2.4.2-22.el7_3.x86_64                                                                                        8/20   Installing : unixODBC-2.3.1-11.el7.x86_64                                                                                              9/20   Installing : libxslt-1.1.28-5.el7.x86_64                                                                                              10/20   Installing : postgresql10-contrib-10.1-1PGDG.rhel7.x86_64                                                                             11/20   Installing : postgresql10-odbc-10.00.0000-1PGDG.rhel7.x86_64                                                                          12/20   Installing : postgresql10-test-10.1-1PGDG.rhel7.x86_64                                                                                13/20   Installing : postgresql10-tcl-2.3.1-1.rhel7.x86_64                                                                                    14/20   Installing : postgresql10-pltcl-10.1-1PGDG.rhel7.x86_64                                                                               15/20   Installing : postgresql10-plpython-10.1-1PGDG.rhel7.x86_64                                                                            16/20   Installing : postgresql10-plperl-10.1-1PGDG.rhel7.x86_64                                                                              17/20   Installing : postgresql10-debuginfo-10.1-1PGDG.rhel7.x86_64                                                                           18/20   Installing : postgresql10-tcl-debuginfo-2.3.1-1.rhel7.x86_64                                                                          19/20   Installing : postgresql10-docs-10.1-1PGDG.rhel7.x86_64                                                                                20/20   Verifying  : postgresql10-plpython-10.1-1PGDG.rhel7.x86_64                                                                             1/20   Verifying  : postgresql10-server-10.1-1PGDG.rhel7.x86_64                                                                               2/20   Verifying  : postgresql10-libs-10.1-1PGDG.rhel7.x86_64                                                                                 3/20   Verifying  : postgresql10-devel-10.1-1PGDG.rhel7.x86_64                                                                                4/20   Verifying  : postgresql10-contrib-10.1-1PGDG.rhel7.x86_64                                                                              5/20   Verifying  : postgresql10-docs-10.1-1PGDG.rhel7.x86_64                                                                                 6/20   Verifying  : libicu-devel-50.1.2-15.el7.x86_64                                                                                         7/20   Verifying  : unixODBC-2.3.1-11.el7.x86_64                                                                                              8/20   Verifying  : postgresql10-plperl-10.1-1PGDG.rhel7.x86_64                                                                               9/20   Verifying  : libxslt-1.1.28-5.el7.x86_64                                                                                              10/20   Verifying  : postgresql10-odbc-10.00.0000-1PGDG.rhel7.x86_64                                                                          11/20   Verifying  : postgresql10-tcl-debuginfo-2.3.1-1.rhel7.x86_64                                                                          12/20   Verifying  : libicu-50.1.2-15.el7.x86_64                                                                                              13/20   Verifying  : libtool-ltdl-2.4.2-22.el7_3.x86_64                                                                                       14/20   Verifying  : postgresql10-tcl-2.3.1-1.rhel7.x86_64                                                                                    15/20   Verifying  : postgresql10-debuginfo-10.1-1PGDG.rhel7.x86_64                                                                           16/20   Verifying  : postgresql10-test-10.1-1PGDG.rhel7.x86_64                                                                                17/20   Verifying  : 1:tcl-8.5.13-8.el7.x86_64                                                                                                18/20   Verifying  : postgresql10-10.1-1PGDG.rhel7.x86_64                                                                                     19/20   Verifying  : postgresql10-pltcl-10.1-1PGDG.rhel7.x86_64                                                                               20/20 Installed:  postgresql10.x86_64 0:10.1-1PGDG.rhel7                                  postgresql10-contrib.x86_64 0:10.1-1PGDG.rhel7                        postgresql10-debuginfo.x86_64 0:10.1-1PGDG.rhel7                        postgresql10-devel.x86_64 0:10.1-1PGDG.rhel7                          postgresql10-docs.x86_64 0:10.1-1PGDG.rhel7                             postgresql10-libs.x86_64 0:10.1-1PGDG.rhel7                           postgresql10-odbc.x86_64 0:10.00.0000-1PGDG.rhel7                       postgresql10-plperl.x86_64 0:10.1-1PGDG.rhel7                         postgresql10-plpython.x86_64 0:10.1-1PGDG.rhel7                         postgresql10-pltcl.x86_64 0:10.1-1PGDG.rhel7                          postgresql10-server.x86_64 0:10.1-1PGDG.rhel7                           postgresql10-tcl.x86_64 0:2.3.1-1.rhel7                               postgresql10-tcl-debuginfo.x86_64 0:2.3.1-1.rhel7                       postgresql10-test.x86_64 0:10.1-1PGDG.rhel7                         Dependency Installed:  libicu.x86_64 0:50.1.2-15.el7   libicu-devel.x86_64 0:50.1.2-15.el7   libtool-ltdl.x86_64 0:2.4.2-22.el7_3   libxslt.x86_64 0:1.1.28-5.el7    tcl.x86_64 1:8.5.13-8.el7       unixODBC.x86_64 0:2.3.1-11.el7       Complete![root@tpg-1 ~]# find / -name "postgresql-10.service"/usr/lib/systemd/system/postgresql-10.service[root@tpg-1 ~]# /usr/pgsql-10/bin/postgresql-10-setup initdb[root@tpg-1 ~]# systemctl enable postgresql-10[root@tpg-1 ~]# systemctl start postgresql-10postgres 用户原始的配置文件-bash-4.2$ cat ~/.bash_profile[ -f /etc/profile ] && source /etc/profilePGDATA=/var/lib/pgsql/10/dataexport PGDATA# If you want to customize your settings,# Use the file below. This is not overridden# by the RPMS.[ -f /var/lib/pgsql/.pgsql_profile ] && source /var/lib/pgsql/.pgsql_profilepostgres 用户修改后的配置文件-bash-4.2$ cat ~/.bash_profile[ -f /etc/profile ] && source /etc/profileexport PGHOME=/usr/pgsql-10export PGDATA=/var/lib/pgsql/10/dataexport LD_LIBRARY_PATH=$PGHOME/libexport LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/libexport PATH=$PGHOME/bin:$PATH# If you want to customize your settings,# Use the file below. This is not overridden# by the RPMS.[ -f /var/lib/pgsql/.pgsql_profile ] && source /var/lib/pgsql/.pgsql_profile没有使用建议的 /var/lib/pgsql/.pgsql_profile 这个配置文件最后根据情况调整 postgresql.conf 的参数值
原创粉丝点击