开源数据库postgreSQL13在麒麟v10sp1源码安装过程详解
一、中标麒麟v10sp1在飞腾2000+系统安装略
二、系统依赖包安装
[root@ft2000dbopt]#yuminstallbzip* [root@ft2000dbopt]#nkvers ##############KylinLinuxVersion################# Release: KylinLinuxAdvancedServerreleaseV10(Tercel) Kernel: 4.19.90-17.ky10.aarch64 Build: KylinLinuxAdvancedServer releaseV10(SP1)/(Tercel)-aarch64-Build04/20200711 ################################################# [root@ft2000dbopt]#yuminstall-yperl-ExtUtils-Embed [root@ft2000dbopt]#yuminstall-yflex root@ft2000dbopt]#yuminstall-ybison root@ft2000dbopt]#yuminstall-yreadline-devel root@ft2000dbopt]#yuminstall-yzlib-devel root@ft2000dbopt]#yuminstall-yopenssl-devel root@ft2000dbopt]#yuminstall-ypam-devel root@ft2000dbopt]#yuminstall-ylibxml2-devel root@ft2000dbopt]#yuminstall-ylibxslt-devel root@ft2000dbopt]#yuminstall-yopenldap-devel root@ft2000dbopt]#yuminstall-ypython-devel root@ft2000dbopt]#yuminstall-ygcc-c++ root@ft2000dbopt]#yuminstall-ylibssh2-devel
下载安装软件及创建安装目录
[root@ft2000dbopt]#wgethttp://ftp.postgresql.org/pub/source/v13.1/postgresql-13.1.tar.bz2 [root@ft2000dbopt]#tarxjvfpostgresql-13.1.tar.bz2 [root@ft2000dbopt]#cdpostgresql-13.1/ [root@ft2000dbpostgresql-13.1]#mkdir-p/opt/pgsql [root@ft2000dbpostgresql-13.1]#./configure--prefix=/opt/pgsql ................................................................ configure:creating./config.status config.status:creatingGNUmakefile config.status:creatingsrc/Makefile.global config.status:creatingsrc/include/pg_config.h config.status:creatingsrc/include/pg_config_ext.h config.status:creatingsrc/interfaces/ecpg/include/ecpg_config.h config.status:linkingsrc/backend/port/tas/dummy.stosrc/backend/port/tas.s config.status:linkingsrc/backend/port/posix_sema.ctosrc/backend/port/pg_sema.c config.status:linkingsrc/backend/port/sysv_shmem.ctosrc/backend/port/pg_shmem.c config.status:linkingsrc/include/port/linux.htosrc/include/pg_config_os.h config.status:linkingsrc/makefiles/Makefile.linuxtosrc/Makefile.port
[root@ft2000dbpostgresql-13.1]#gmake//这里编译时间大约30分钟,如果失败一般都是系统依赖包原因,根据提示解决
.............................................................................................................
gmake[2]:离开目录“/opt/postgresql-13.1/src/test/isolation” gmake-Ctest/perlall gmake[2]:进入目录“/opt/postgresql-13.1/src/test/perl” gmake[2]:对“all”无需做任何事。 gmake[2]:离开目录“/opt/postgresql-13.1/src/test/perl” gmake[1]:离开目录“/opt/postgresql-13.1/src” gmake-Cconfigall gmake[1]:进入目录“/opt/postgresql-13.1/config” gmake[1]:对“all”无需做任何事。 gmake[1]:离开目录“/opt/postgresql-13.1/config” AllofPostgreSQLsuccessfullymade.Readytoinstall. [root@ft2000dbpostgresql-13.1]#gmakeinstall
..........................................................................................
gmake[1]:离开目录“/opt/postgresql-13.1/src” gmake-Cconfiginstall gmake[1]:进入目录“/opt/postgresql-13.1/config” /usr/bin/mkdir-p'/opt/pgsql/lib/pgxs/config' /usr/bin/install-c-m755./install-sh'/opt/pgsql/lib/pgxs/config/install-sh' /usr/bin/install-c-m755./missing'/opt/pgsql/lib/pgxs/config/missing' gmake[1]:离开目录“/opt/postgresql-13.1/config” PostgreSQLinstallationcomplete.
三、检查安装的版本
[root@ft2000dbpostgresql-13.1]#/opt/pgsql/bin/postgres--version postgres(PostgreSQL)13.1
创建用户和组
[root@ft2000dbpostgresql-13.1]#groupadd-g1002postgres [root@ft2000dbpostgresql-13.1]#useradd-g1002-u1002postgres [root@ft2000dbpostgresql-13.1]#passwdpostgres [root@ft2000dbpostgresql-13.1]#chown-Rpostgres:postgres/opt/ [root@ft2000dbpostgresql-13.1]#chmod-R775/opt/
配置环境变量
[postgres@ft2000db~]$cat.bash_profile #Source/root/.bashrcifuserhasone [-f~/.bashrc]&&.~/.bashrc #Userspecificenvironmentandstartupprograms PATH=$PATH:$HOME/.local/bin:$HOME/bin exportPATH PATH=/opt/pgsql/bin:$PATH exportPATH LD_LIBRARY_PATH=/opt/pgsql/lib exportLD_LIBRARY_PATH
初始化数据库
[postgres@ft2000db~]$mkdir-p/opt/pgsql/data [postgres@ft2000db~]$initdb-D/opt/pgsql/data Thefilesbelongingtothisdatabasesystemwillbeownedbyuser"postgres". Thisusermustalsoowntheserverprocess. Thedatabaseclusterwillbeinitializedwithlocale"zh_CN.UTF-8". Thedefaultdatabaseencodinghasaccordinglybeensetto"UTF8". initdb:couldnotfindsuitabletextsearchconfigurationforlocale"zh_CN.UTF-8" Thedefaulttextsearchconfigurationwillbesetto"simple". Datapagechecksumsaredisabled. fixingpermissionsonexistingdirectory/opt/pgsql/data...ok creatingsubdirectories...ok selectingdynamicsharedmemoryimplementation...posix selectingdefaultmax_connections...100 selectingdefaultshared_buffers...128MB selectingdefaulttimezone...Asia/Shanghai creatingconfigurationfiles...ok runningbootstrapscript...ok performingpost-bootstrapinitialization...ok syncingdatatodisk...ok initdb:warning:enabling"trust"authenticationforlocalconnections Youcanchangethisbyeditingpg_hba.conforusingtheoption-A,or --auth-localand--auth-host,thenexttimeyouruninitdb. Success.Youcannowstartthedatabaseserverusing: pg_ctl-D/opt/pgsql/data-llogfilestart
启动数据库
[postgres@ft2000db~]$pg_ctl-D/opt/pgsql/datastart waitingforservertostart....2020-11-2016:01:05.881CST[34826]LOG:startingPostgreSQL13.1onaarch64-unknown-linux-gnu,compiledbygcc(GCC)7.3.0,64-bit 2020-11-2016:01:05.882CST[34826]LOG:listeningonIPv6address"::1",port5432 2020-11-2016:01:05.882CST[34826]LOG:listeningonIPv4address"127.0.0.1",port5432 2020-11-2016:01:05.882CST[34826]LOG:listeningonUnixsocket"/tmp/.s.PGSQL.5432" 2020-11-2016:01:05.884CST[34827]LOG:databasesystemwasshutdownat2020-11-2016:00:27CST 2020-11-2016:01:05.887CST[34826]LOG:databasesystemisreadytoacceptconnections done serverstarted
登录数据库
[postgres@ft2000db~]$psql-p5432 psql(13.1) type"help"forhelp. postgres=#
到此postgresql数据库安装完毕。
到此这篇关于开源数据库postgreSQL13在麒麟v10sp1源码安装过程详解的文章就介绍到这了,更多相关postgreSQL13在麒麟v10sp1源码安装内容请搜索毛票票以前的文章或继续浏览下面的相关文章希望大家以后多多支持毛票票!