开源数据库postgreSQL13在麒麟v10sp1源码安装过程详解

一、中标麒麟v10sp1在飞腾2000+系统安装略

二、系统依赖包安装

[root@ft2000db opt]# yum install bzip*
[root@ft2000db opt]# nkvers
############## kylin linux version #################
release:
kylin linux advanced server release v10 (tercel)

kernel:
4.19.90-17.ky10.aarch64

build:
kylin linux advanced server
release v10 (sp1) /(tercel)-aarch64-build04/20200711
#################################################
[root@ft2000db opt] # yum install -y perl-extutils-embed
[root@ft2000db opt]# yum install -y flex
root@ft2000db opt]# yum install -y bison
root@ft2000db opt]# yum install -y readline-devel
root@ft2000db opt]# yum install -y zlib-devel
root@ft2000db opt]# yum install -y openssl-devel
root@ft2000db opt]# yum install -y pam-devel
root@ft2000db opt]# yum install -y libxml2-devel
root@ft2000db opt]# yum install -y libxslt-devel
root@ft2000db opt]# yum install -y openldap-devel
root@ft2000db opt]# yum install -y python-devel
root@ft2000db opt]# yum install -y gcc-c++
root@ft2000db opt]# yum install -y libssh2-devel

下载安装软件及创建安装目录

[root@ft2000db opt]# wget http://ftp.postgresql.org/pub/source/v13.1/postgresql-13.1.tar.bz2
[root@ft2000db opt]# tar xjvf postgresql-13.1.tar.bz2
[root@ft2000db opt]# cd postgresql-13.1/
[root@ft2000db postgresql-13.1]# mkdir -p /opt/pgsql
[root@ft2000db postgresql-13.1]# ./configure --prefix=/opt/pgsql
................................................................
configure: creating ./config.status
config.status: creating gnumakefile
config.status: creating src/makefile.global
config.status: creating src/include/pg_config.h
config.status: creating src/include/pg_config_ext.h
config.status: creating src/interfaces/ecpg/include/ecpg_config.h
config.status: linking src/backend/port/tas/dummy.s to src/backend/port/tas.s
config.status: linking src/backend/port/posix_sema.c to src/backend/port/pg_sema.c
config.status: linking src/backend/port/sysv_shmem.c to src/backend/port/pg_shmem.c
config.status: linking src/include/port/linux.h to src/include/pg_config_os.h
config.status: linking src/makefiles/makefile.linux to src/makefile.port

[root@ft2000db postgresql-13.1]# gmake //这里编译时间大约30分钟,如果失败一般都是系统依赖包原因,根据提示解决
……………………………………………………………………………………………….

gmake[2]: 离开目录“/opt/postgresql-13.1/src/test/isolation”
gmake -c test/perl all
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 -c config all
gmake[1]: 进入目录“/opt/postgresql-13.1/config”
gmake[1]: 对“all”无需做任何事。
gmake[1]: 离开目录“/opt/postgresql-13.1/config”
all of postgresql successfully made. ready to install.

[root@ft2000db postgresql-13.1]#gmake install

………………………………………………………………………………

gmake[1]: 离开目录“/opt/postgresql-13.1/src”
gmake -c config install
gmake[1]: 进入目录“/opt/postgresql-13.1/config”
/usr/bin/mkdir -p '/opt/pgsql/lib/pgxs/config'
/usr/bin/install -c -m 755 ./install-sh '/opt/pgsql/lib/pgxs/config/install-sh'
/usr/bin/install -c -m 755 ./missing '/opt/pgsql/lib/pgxs/config/missing'
gmake[1]: 离开目录“/opt/postgresql-13.1/config”
postgresql installation complete.

三、检查安装的版本

[root@ft2000db postgresql-13.1]# /opt/pgsql/bin/postgres --version
postgres (postgresql) 13.1

创建用户和组

[root@ft2000db postgresql-13.1]# groupadd -g 1002 postgres
[root@ft2000db postgresql-13.1]# useradd -g 1002 -u 1002 postgres
[root@ft2000db postgresql-13.1]# passwd postgres
[root@ft2000db postgresql-13.1]# chown -r postgres:postgres /opt/
[root@ft2000db postgresql-13.1]# chmod -r 775 /opt/

配置环境变量

[postgres@ft2000db ~]$ cat .bash_profile
# source /root/.bashrc if user has one
[ -f ~/.bashrc ] && . ~/.bashrc

# user specific environment and startup programs

path=$path:$home/.local/bin:$home/bin

export path

path=/opt/pgsql/bin:$path
export path
ld_library_path=/opt/pgsql/lib
export ld_library_path

初始化数据库

[postgres@ft2000db ~]$ mkdir -p /opt/pgsql/data
[postgres@ft2000db ~]$ initdb -d /opt/pgsql/data
the files belonging to this database system will be owned by user "postgres".
this user must also own the server process.

the database cluster will be initialized with locale "zh_cn.utf-8".
the default database encoding has accordingly been set to "utf8".
initdb: could not find suitable text search configuration for locale "zh_cn.utf-8"
the default text search configuration will be set to "simple".

data page checksums are disabled.

fixing permissions on existing directory /opt/pgsql/data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128mb
selecting default time zone ... asia/shanghai
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

initdb: warning: enabling "trust" authentication for local connections
you can change this by editing pg_hba.conf or using the option -a, or
--auth-local and --auth-host, the next time you run initdb.

success. you can now start the database server using:

pg_ctl -d /opt/pgsql/data -l logfile start

启动数据库

[postgres@ft2000db ~]$ pg_ctl -d /opt/pgsql/data start
waiting for server to start....2020-11-20 16:01:05.881 cst [34826] log: starting postgresql 13.1 on aarch64-unknown-linux-gnu, compiled by gcc (gcc) 7.3.0, 64-bit
2020-11-20 16:01:05.882 cst [34826] log: listening on ipv6 address "::1", port 5432
2020-11-20 16:01:05.882 cst [34826] log: listening on ipv4 address "127.0.0.1", port 5432
2020-11-20 16:01:05.882 cst [34826] log: listening on unix socket "/tmp/.s.pgsql.5432"
2020-11-20 16:01:05.884 cst [34827] log: database system was shut down at 2020-11-20 16:00:27 cst
2020-11-20 16:01:05.887 cst [34826] log: database system is ready to accept connections
done
server started

登录数据库

[postgres@ft2000db ~]$ psql -p 5432
psql (13.1)
type "help" for help.

postgres=#

到此postgresql数据库安装完毕。

到此这篇关于开源数据库postgresql13在麒麟v10sp1源码安装过程详解的文章就介绍到这了,更多相关postgresql13在麒麟v10sp1源码安装内容请搜索www.887551.com以前的文章或继续浏览下面的相关文章希望大家以后多多支持www.887551.com!

(0)
上一篇 2022年3月21日
下一篇 2022年3月21日

相关推荐