Yukon(禹贡),基于openGauss数据库扩展地理空间数据的存储和管理能力,提供专业的GIS(Geographic Information System)功能,赋能传统关系型数据库。
Yukon 基于 openGauss/PostgreSQL 扩展的模块包括:
免费 & 开源,提供了postgis的空间关系的能力,可以直接基于数据库进行操作。
收费,扩展部分能力(yukon_geomodel),提供了空间索引、计算函数、数据处理
在安装 Yukon 之前必须先安装数据库(openGauss或PostgreSQL )。
建议安装:YuKon基于openGauss的安装和基于postgres的安装过程较为繁琐,可以直接拉取YuKon镜像,基于Docker进行安装,操作更为方便。
openGauss 支持的操作系统有: centos_x86_64、openeuler_aarch64、openeuler_x86_64,请优先在这些操作系统进行安装。
openGauss官方文档请移步官网:https://opengauss.org/zh/docs/3.0.0/docs/BriefTutorial/BriefTutorial.html
在官网下载openGuass极简版本[openGauss_2.1.0 企业],目前仅支持兼容openGauss2.1.0企业版
解压校验
#1. 解压安装包 openGauss-2.1.0-CentOS-64bit-all.tar.gz,检查安装目录及文件是否齐全。在安装包所在目录执行以下命令
[YuKon@VM-4-16-centos openGauss]$ ls
openGauss-2.1.0-CentOS-64bit-all.tar.gz openGauss-2.1.0-CentOS-64bit-om.sha256 openGauss-2.1.0-CentOS-64bit-om.tar.gz openGauss-2.1.0-CentOS-64bit.sha256 openGauss-2.1.0-CentOS-64bit.tar.bz2 upgrade_sql.sha256 upgrade_sql.tar.gz
[YuKon@VM-4-16-centos openGauss]$ ls -lb
#2. 执行ls命令,显示类似如下信息
total 197348
-rw-r--r-- 1 root root 100623501 Aug 31 13:59 openGauss-2.1.0-CentOS-64bit-all.tar.gz
-rw-r--r-- 1 root root 65 Sep 30 2021 openGauss-2.1.0-CentOS-64bit-om.sha256
-rw-r--r-- 1 root root 13672565 Sep 30 2021 openGauss-2.1.0-CentOS-64bit-om.tar.gz
-rw-r--r-- 1 root root 65 Sep 30 2021 openGauss-2.1.0-CentOS-64bit.sha256
-rw-r--r-- 1 root root 87531625 Sep 30 2021 openGauss-2.1.0-CentOS-64bit.tar.bz2
-rw------- 1 root root 65 Sep 30 2021 upgrade_sql.sha256
-rw------- 1 root root 224994 Sep 30 2021 upgrade_sql.tar.gz
创建XML配置文件
[YuKon@VM-4-16-centos openGauss]$ vim cluster_config.xml
# 单节点的配置文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<!-- openGauss整体信息 -->
<CLUSTER>
<!-- 数据库名称 -->
<PARAM name="clusterName" value="dbCluster" />
<!-- 数据库节点名称(hostname) -->
<PARAM name="nodeNames" value="VM-4-16-centos" />
<!-- 数据库安装目录-->
<PARAM name="gaussdbAppPath" value="/opt/wangjun/install/app" />
<!-- 日志目录-->
<PARAM name="gaussdbLogPath" value="/var/log/omm" />
<!-- 临时文件目录-->
<PARAM name="tmpMppdbPath" value="/opt/wangjun/tmp" />
<!-- 数据库工具目录-->
<PARAM name="gaussdbToolPath" value="/opt/wangjun/install/om" />
<!-- 数据库core文件目录-->
<PARAM name="corePath" value="/opt/wangjun/corefile" />
<!-- 节点IP,与数据库节点名称列表一一对应 -->
<PARAM name="backIp1s" value="192.168.0.1"/>
</CLUSTER>
<!-- 每台服务器上的节点部署信息 -->
<DEVICELIST>
<!-- 节点1上的部署信息 -->
<DEVICE sn="VM-4-16-centos">
<!-- 节点1的主机名称 -->
<PARAM name="name" value="VM-4-16-centos"/>
<!-- 节点1所在的AZ及AZ优先级 -->
<PARAM name="azName" value="AZ1"/>
<PARAM name="azPriority" value="1"/>
<!-- 节点1的IP,如果服务器只有一个网卡可用,将backIP1和sshIP1配置成同一个IP -->
<PARAM name="backIp1" value="121.4.52.187"/>
<PARAM name="sshIp1" value="121.4.52.187"/>
<!--dbnode-->
<PARAM name="dataNum" value="1"/>
<PARAM name="dataPortBase" value="15400"/>
<PARAM name="dataNode1" value="/opt/wangjun/install/data/dn"/>
<PARAM name="dataNode1_syncNum" value="0"/>
</DEVICE>
</DEVICELIST>
</ROOT>
初始化安装环境
在此之前需要关闭linux的防火墙、HTP,这部分内容请自行百度解决
#1. 解压openGauss-2.1.0-CentOS-64bit-om.tar.gz ,完成后会自动生成script子目录,并且在子目录下生成gs_preinstall等各种OM工具脚本
[root@VM-4-16-centos openGauss]# tar -zxvf openGauss-2.1.0-CentOS-64bit-om.tar.gz
[root@VM-4-16-centos openGauss]# ls
cluster_config.xml openGauss-2.1.0-CentOS-64bit-all.tar.gz openGauss-2.1.0-CentOS-64bit-om.tar.gz openGauss-2.1.0-CentOS-64bit.tar.bz2 simpleInstall upgrade_sql.tar.gz
lib openGauss-2.1.0-CentOS-64bit-om.sha256 openGauss-2.1.0-CentOS-64bit.sha256 script upgrade_sql.sha256 version.cfg
[root@VM-4-16-centos openGauss]# ls script/
config gs_backup gs_check gs_checkos gs_checkperf gs_collector gs_dropnode gs_expansion gs_install gs_om gs_postuninstall gs_preinstall gspylib gs_ssh gs_sshexkey gs_uninstall gs_upgradectl impl __init__.py killall local transfer.py
执行安装
# 1. 切换到YuKon用户,该用户为执行前置脚本中-U参数指定的用户
[root@VM-4-16-centos script]# su - YuKon
Last login: Wed Aug 31 15:35:11 CST 2022 on pts/0
# 2. 执行gs_install命令安装openGauss(需要给YuKon用户赋予权限,sudo自行配置)
[YuKon@VM-4-16-centos openGauss]$ sudo chmod -R +777 script/
[root@VM-4-16-centos simpleInstall]# sh install.sh -U YuKon -G YuKon -h 10.0.4.16 -p 5432 &&source ~/.bashrc
Precheck success.
Check user success.
Check input success.
FirewallD is not running
FirewallD is not running
Check firewall success.
Set selinux success.
Post check success.
user has already exists.
User test success.
create config file success.
Create file success.
Get openGauss Installation package success.
tar package success.
Get openGauss Installation package and tar package success.
Parsing the configuration file.
Successfully parsed the configuration file.
Installing the tools on the local node.
Successfully installed the tools on the local node.
Setting pssh path
Successfully set core path.
Are you sure you want to create the user[YuKon] and create trust for it (yes/no)? no
Preparing SSH service.
Successfully prepared SSH service.
Checking OS software.
Successfully check os software.
Checking OS version.
Successfully checked OS version.
Creating cluster's path.
Successfully created cluster's path.
Set and check OS parameter.
Setting OS parameters.
Successfully set OS parameters.
Warning: Installation environment contains some warning messages.
Please get more details by "/home/YuKon/openGaussTar/script/gs_checkos -i A -h VM-4-16-centos --detail".
Set and check OS parameter completed.
Preparing CRON service.
Successfully prepared CRON service.
Setting user environmental variables.
Successfully set user environmental variables.
Setting the dynamic link library.
Successfully set the dynamic link library.
Setting Core file
Successfully set core path.
Setting pssh path
Successfully set pssh path.
Setting Cgroup.
Successfully set Cgroup.
Set ARM Optimization.
No need to set ARM Optimization.
Fixing server package owner.
Setting finish flag.
Successfully set finish flag.
Preinstallation succeeded.
Preinstall success.
Parsing the configuration file.
Check preinstall on every node.
Successfully checked preinstall on every node.
Creating the backup directory.
Successfully created the backup directory.
begin deploy..
Installing the cluster.
begin prepare Install Cluster..
Checking the installation environment on all nodes.
begin install Cluster..
Installing applications on all nodes.
Successfully installed APP.
begin init Instance..
encrypt cipher and rand files for database.
Please enter password for database:
Please repeat for database:
[GAUSS-50306] : The password of database is incorrect.The two passwords are different, please enter password again.
Please enter password for database:
Please repeat for database:
[GAUSS-50306] : The password of database is incorrect.The two passwords are different, please enter password again.
Please enter password for database:
Please repeat for database:
begin to create CA cert files
The sslcert will be generated in /opt/YuKon/cluster/app/share/sslcert/om
Cluster installation is completed.
Configuring.
Deleting instances from all nodes.
Successfully deleted instances from all nodes.
Checking node configuration on all nodes.
Initializing instances on all nodes.
Updating instance configuration on all nodes.
Check consistence of memCheck and coresCheck on database nodes.
Configuring pg_hba on all nodes.
Configuration is completed.
[GAUSS-51400] : Failed to execute the command: source /home/YuKon/env_single;python3 '/opt/YuKon/cluster/tool/script/local/Install.py' -t start_cluster -U YuKon:YuKon -X /home/YuKon/single.xml -R /opt/YuKon/cluster/app -c gauss_YuKon -l /opt/YuKon/cluster/gaussdb_log/YuKon/om/gs_local.log --alarm=/opt/huawei/snas/bin/snas_cm_cmd --time_out=300 .Error:
Using YuKon:YuKon to install database.
Using installation program path : /opt/YuKon/cluster/app_compiled
$GAUSSHOME points to /opt/YuKon/cluster/app_compiled, no need to create symbolic link.
Traceback (most recent call last):
File "/opt/YuKon/cluster/tool/script/local/Install.py", line 701, in <module>
functionDict[g_opts.action]()
File "/opt/YuKon/cluster/tool/script/local/Install.py", line 632, in startCluster
dn.start(self.time_out)
File "/opt/YuKon/cluster/tool/script/local/../gspylib/component/Kernel/Kernel.py", line 107, in start
"failure details." + "\n" + output)
Exception: [GAUSS-51607] : Failed to start instance. Error: Please check the gs_ctl log for failure details.
[2022-08-31 17:12:38.846][11653][][gs_ctl]: gs_ctl started,datadir is /opt/YuKon/cluster/dn1
[2022-08-31 17:12:38.936][11653][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG: [Alarm Module]Host Name: VM-4-16-centos
0 LOG: [Alarm Module]Host IP: 127.0.0.1
0 LOG: [Alarm Module]Cluster Name: gauss_YuKon
0 LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
0 WARNING: failed to parse feature control file: gaussdb.version.
0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version.
0 LOG: bbox_dump_path is set to /opt/YuKon/cluster/corefile/
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 DB010 0 [REDO] LOG: Recovery parallelism, cpu count = 2, max = 4, actual = 2
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 DB010 0 [REDO] LOG: ConfigRecoveryParallelism, true_max_recovery_parallelism:4, max_recovery_parallelism:4
gaussdb.state does not exist, and skipt setting since it is optional.2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Host Name: VM-4-16-centos
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Host IP: 127.0.0.1
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Cluster Name: gauss_YuKon
2022-08-31 17:12:39.117 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
2022-08-31 17:12:39.131 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: loaded library "security_plugin"
2022-08-31 17:12:39.136 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 Mbytes) or shared memory (3452 Mbytes) is larger.
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 42809 0 [BACKEND] FATAL: could not create shared memory segment: Cannot allocate memory
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 42809 0 [BACKEND] DETAIL: Failed system call was shmget(key=5432001, size=3619708928, 03600).
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 42809 0 [BACKEND] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter. You can either reduce the request size or reconfigure the kernel with larger SHMALL. To reduce the request size (currently 3619708928 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers.
The PostgreSQL documentation contains more information about shared memory configuration.
2022-08-31 17:12:39.147 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: FiniNuma allocIndex: 0.
[2022-08-31 17:12:39.937][11653][][gs_ctl]: waitpid 11656 failed, exitstatus is 256, ret is 2
[2022-08-31 17:12:39.937][11653][][gs_ctl]: stopped waiting
[2022-08-31 17:12:39.937][11653][][gs_ctl]: could not start server
Examine the log output.
[GAUSS-51607] : Failed to start instance. Error: Please check the gs_ctl log for failure details.
[2022-08-31 17:12:38.846][11653][][gs_ctl]: gs_ctl started,datadir is /opt/YuKon/cluster/dn1
[2022-08-31 17:12:38.936][11653][][gs_ctl]: waiting for server to start...
.0 LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
0 LOG: [Alarm Module]Host Name: VM-4-16-centos
0 LOG: [Alarm Module]Host IP: 127.0.0.1
0 LOG: [Alarm Module]Cluster Name: gauss_YuKon
0 LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
0 WARNING: failed to open feature control file, please check whether it exists: FileName=gaussdb.version, Errno=2, Errmessage=No such file or directory.
0 WARNING: failed to parse feature control file: gaussdb.version.
0 WARNING: Failed to load the product control file, so gaussdb cannot distinguish product version.
0 LOG: bbox_dump_path is set to /opt/YuKon/cluster/corefile/
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 DB010 0 [REDO] LOG: Recovery parallelism, cpu count = 2, max = 4, actual = 2
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 DB010 0 [REDO] LOG: ConfigRecoveryParallelism, true_max_recovery_parallelism:4, max_recovery_parallelism:4
gaussdb.state does not exist, and skipt setting since it is optional.2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]can not read GAUSS_WARNING_TYPE env.
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Host Name: VM-4-16-centos
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Host IP: 127.0.0.1
2022-08-31 17:12:39.116 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Cluster Name: gauss_YuKon
2022-08-31 17:12:39.117 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: [Alarm Module]Invalid data in AlarmItem file! Read alarm English name failed! line: 55
2022-08-31 17:12:39.131 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: loaded library "security_plugin"
2022-08-31 17:12:39.136 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: could not create any HA TCP/IP sockets
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: InitNuma numaNodeNum: 1 numa_distribute_mode: none inheritThreadPool: 0.
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 01000 0 [BACKEND] WARNING: Failed to initialize the memory protect for g_instance.attr.attr_storage.cstore_buffers (1024 Mbytes) or shared memory (3452 Mbytes) is larger.
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 42809 0 [BACKEND] FATAL: could not create shared memory segment: Cannot allocate memory
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 42809 0 [BACKEND] DETAIL: Failed system call was shmget(key=5432001, size=3619708928, 03600).
2022-08-31 17:12:39.143 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 42809 0 [BACKEND] HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded available memory or swap space, or exceeded your kernel's SHMALL parameter. You can either reduce the request size or reconfigure the kernel with larger SHMALL. To reduce the request size (currently 3619708928 bytes), reduce PostgreSQL's shared memory usage, perhaps by reducing shared_buffers.
The PostgreSQL documentation contains more information about shared memory configuration.
2022-08-31 17:12:39.147 630f2607.1 [unknown] 140556684227520 [unknown] 0 dn_6001 00000 0 [BACKEND] LOG: FiniNuma allocIndex: 0.
[2022-08-31 17:12:39.937][11653][][gs_ctl]: waitpid 11656 failed, exitstatus is 256, ret is 2
[2022-08-31 17:12:39.937][11653][][gs_ctl]: stopped waiting
[2022-08-31 17:12:39.937][11653][][gs_ctl]: could not start server
Examine the log output.
Install failed.
Installation failed.
# 受硬件限制,无法继续安装
YuKon for openGauss发行版地址:https://gitee.com/opengauss/yukon/releases/tag/v1.0
注: Yukon-1.0_openGauss2.1.0_openeuler_aarch64.tar.gz 和Yukon-1.0_openGauss2.1.0-CentOS_x64.tar.gz的区别在于使用的操作系统不同,aarch64是华为欧拉操作系统,CentOS_64用于CentOS操作系统
本文档基于CentOS7.6操作系统,注: 安装时请使用root用户安装
#1. 上传并解压下载的安装包Yukon-1.0-openGauss2.1.0-CentOS_x64.tar.gz
[root@VM-4-16-centos YuKon]tar -zxvf Yukon-1.0-openGauss2.1.0-CentOS_x64.tar.gz
[YuKon@VM-4-16-centos Yukon-1.0-openGauss2.1.0-CentOS_x64-2022_06_24_12_28]$ ls
bin extension help.pdf install.sh lib yukon_dep
# 执行安装命令
[YuKon@VM-4-16-centos Yukon-1.0-openGauss2.1.0-CentOS_x64-2022_06_24_12_28]$ sh install.sh -i
开始安装......
pg_config is /SuperMap/openGauss/bin/pg_config
library directory /SuperMap/openGauss/lib/postgresql
extension directory /SuperMap/openGauss/share/postgresql
mkdir: cannot create directory ‘/opt/yukon_dep’: Permission denied
cp: target ‘/opt/yukon_dep’ is not a directory
install.sh: line 28: /etc/ld.so.conf: Permission denied
install.sh: line 29: /etc/ld.so.conf: Permission denied
install.sh: line 30: /etc/ld.so.conf: Permission denied
install.sh: line 31: /etc/ld.so.conf: Permission denied
install.sh: line 32: /etc/ld.so.conf: Permission denied
install.sh: line 33: /etc/ld.so.conf: Permission denied
install.sh: line 34: /etc/ld.so.conf: Permission denied
install.sh: line 35: /etc/ld.so.conf: Permission denied
install.sh: line 36: /etc/ld.so.conf: Permission denied
install.sh: line 37: /etc/ld.so.conf: Permission denied
ldconfig: Can't create temporary cache file /etc/ld.so.cache~: Permission denied
chmod: cannot access ‘/opt/yukon_dep’: No such file or directory
cp: cannot create regular file ‘/usr/bin/pgsql2shp’: Permission denied
cp: cannot create regular file ‘/usr/bin/raster2pgsql’: Permission denied
cp: cannot create regular file ‘/usr/bin/shp2pgsql’: Permission denied
__ __ _ _____ ____
\ \ / / | | | __ \ | _ \
\ \_/ /_ _ | | __ ___ _ __ | | | || |_) |
\ /| | | || |/ // _ \ | '_ \ | | | || _ <
| | | |_| || <| (_) || | | | | |__| || |_) |
|_| \__,_||_|\_\\___/ |_| |_| |_____/ |____/
目前仅支持postgresql13,下载安装请参考https://www.postgresql.org/download/linux/redhat/
以下操作为有网环境
# 1. 拉取rpm包
[root@VM-4-16-centos postgresql]# sudo yum install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm
Loaded plugins: fastestmirror, langpacks
pgdg-redhat-repo-latest.noarch.rpm | 8.2 kB 00:00:00
Examining /var/tmp/yum-root-GLqznm/pgdg-redhat-repo-latest.noarch.rpm: pgdg-redhat-repo-42.0-25.noarch
Marking /var/tmp/yum-root-GLqznm/pgdg-redhat-repo-latest.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package pgdg-redhat-repo.noarch 0:42.0-25 will be installed
--> Finished Dependency Resolution
epel/7/x86_64 | 4.7 kB 00:00:00
extras/7/x86_64 | 2.9 kB 00:00:00
os/7/x86_64 | 3.6 kB 00:00:00
updates/7/x86_64 | 2.9 kB 00:00:00
Dependencies Resolved
=============================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================================================
Installing:
pgdg-redhat-repo noarch 42.0-25 /pgdg-redhat-repo-latest.noarch 11 k
Transaction Summary
=============================================================================================================================================================================================================================================================================
Install 1 Package
Total size: 11 k
Installed size: 11 k
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : pgdg-redhat-repo-42.0-25.noarch 1/1
Verifying : pgdg-redhat-repo-42.0-25.noarch 1/1
Installed:
pgdg-redhat-repo.noarch 0:42.0-25
Complete!
#2. 安装postgresql
[root@VM-4-16-centos postgresql]# sudo yum install -y postgresql13-server
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
pgdg-common/7/x86_64/signature | 198 B 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : "PostgreSQL RPM Building Project "
Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
Package : pgdg-redhat-repo-42.0-25.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg-common/7/x86_64/signature | 2.9 kB 00:00:00 !!!
pgdg10/7/x86_64/signature | 198 B 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : "PostgreSQL RPM Building Project "
Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
Package : pgdg-redhat-repo-42.0-25.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg10/7/x86_64/signature | 3.6 kB 00:00:00 !!!
pgdg11/7/x86_64/signature | 198 B 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : "PostgreSQL RPM Building Project "
Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
Package : pgdg-redhat-repo-42.0-25.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg11/7/x86_64/signature | 3.6 kB 00:00:00 !!!
pgdg12/7/x86_64/signature | 198 B 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : "PostgreSQL RPM Building Project "
Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
Package : pgdg-redhat-repo-42.0-25.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg12/7/x86_64/signature | 3.6 kB 00:00:00 !!!
pgdg13/7/x86_64/signature | 198 B 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : "PostgreSQL RPM Building Project "
Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
Package : pgdg-redhat-repo-42.0-25.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg13/7/x86_64/signature | 3.6 kB 00:00:00 !!!
pgdg14/7/x86_64/signature | 198 B 00:00:00
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : "PostgreSQL RPM Building Project "
Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
Package : pgdg-redhat-repo-42.0-25.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
pgdg14/7/x86_64/signature | 3.6 kB 00:00:00 !!!
(1/11): pgdg11/7/x86_64/group_gz | 245 B 00:00:01
(2/11): pgdg10/7/x86_64/group_gz | 245 B 00:00:01
(3/11): pgdg12/7/x86_64/group_gz | 245 B 00:00:00
(4/11): pgdg13/7/x86_64/group_gz | 246 B 00:00:00
(5/11): pgdg-common/7/x86_64/primary_db | 163 kB 00:00:02
(6/11): pgdg10/7/x86_64/primary_db | 393 kB 00:00:02
(7/11): pgdg14/7/x86_64/group_gz | 244 B 00:00:00
(8/11): pgdg14/7/x86_64/primary_db | 130 kB 00:00:00
(9/11): pgdg11/7/x86_64/primary_db | 429 kB 00:00:02
(10/11): pgdg13/7/x86_64/primary_db | 213 kB 00:00:01
(11/11): pgdg12/7/x86_64/primary_db | 310 kB 00:00:05
Resolving Dependencies
--> Running transaction check
---> Package postgresql13-server.x86_64 0:13.8-1PGDG.rhel7 will be installed
--> Processing Dependency: postgresql13-libs(x86-64) = 13.8-1PGDG.rhel7 for package: postgresql13-server-13.8-1PGDG.rhel7.x86_64
--> Processing Dependency: postgresql13(x86-64) = 13.8-1PGDG.rhel7 for package: postgresql13-server-13.8-1PGDG.rhel7.x86_64
--> Processing Dependency: libpq.so.5()(64bit) for package: postgresql13-server-13.8-1PGDG.rhel7.x86_64
--> Running transaction check
---> Package postgresql13.x86_64 0:13.8-1PGDG.rhel7 will be installed
---> Package postgresql13-libs.x86_64 0:13.8-1PGDG.rhel7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================================================================================================================================================================
Installing:
postgresql13-server x86_64 13.8-1PGDG.rhel7 pgdg13 5.4 M
Installing for dependencies:
postgresql13 x86_64 13.8-1PGDG.rhel7 pgdg13 1.4 M
postgresql13-libs x86_64 13.8-1PGDG.rhel7 pgdg13 384 k
Transaction Summary
=============================================================================================================================================================================================================================================================================
Install 1 Package (+2 Dependent packages)
Total download size: 7.2 M
Installed size: 31 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/pgdg13/packages/postgresql13-13.8-1PGDG.rhel7.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 442df0f8: NOKEY ] 54 kB/s | 191 kB 00:02:13 ETA
Public key for postgresql13-13.8-1PGDG.rhel7.x86_64.rpm is not installed
(1/3): postgresql13-13.8-1PGDG.rhel7.x86_64.rpm | 1.4 MB 00:00:03
(2/3): postgresql13-server-13.8-1PGDG.rhel7.x86_64.rpm | 5.4 MB 00:00:01
(3/3): postgresql13-libs-13.8-1PGDG.rhel7.x86_64.rpm | 384 kB 00:00:07
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 1.0 MB/s | 7.2 MB 00:00:07
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Importing GPG key 0x442DF0F8:
Userid : "PostgreSQL RPM Building Project "
Fingerprint: 68c9 e2b9 1a37 d136 fe74 d176 1f16 d2e1 442d f0f8
Package : pgdg-redhat-repo-42.0-25.noarch (@/pgdg-redhat-repo-latest.noarch)
From : /etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : postgresql13-libs-13.8-1PGDG.rhel7.x86_64 1/3
Installing : postgresql13-13.8-1PGDG.rhel7.x86_64 2/3
Installing : postgresql13-server-13.8-1PGDG.rhel7.x86_64 3/3
Verifying : postgresql13-13.8-1PGDG.rhel7.x86_64 1/3
Verifying : postgresql13-server-13.8-1PGDG.rhel7.x86_64 2/3
Verifying : postgresql13-libs-13.8-1PGDG.rhel7.x86_64 3/3
Installed:
postgresql13-server.x86_64 0:13.8-1PGDG.rhel7
Dependency Installed:
postgresql13.x86_64 0:13.8-1PGDG.rhel7 postgresql13-libs.x86_64 0:13.8-1PGDG.rhel7
Complete!
初始化数据库并启用自动启动:
[root@VM-4-16-centos postgresql]# sudo /usr/pgsql-13/bin/postgresql-13-setup initdb
Initializing database ... OK
[root@VM-4-16-centos postgresql]# sudo systemctl enable postgresql-13
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-13.service to /usr/lib/systemd/system/postgresql-13.service.
[root@VM-4-16-centos postgresql]# sudo systemctl start postgresql-13
YuKon for postgreSQL发行版地址:https://gitee.com/isupermap/yukon4pgsql/releases/tag/1.0
本文档基于CentOS7.6操作系统,注: 安装时请使用root用户安装
#1. 上传并解压下载的安装包 Yukon-1.0-postgres13-CentOS_x64.tar.gz
[root@VM-4-16-centos YuKon]tar -zxvf Yukon-1.0-postgres13-CentOS_x64.tar.gz
[root@VM-4-16-centos Yukon-1.0-postgres13-CentOS_x64-2022_06_24_11_41]# ls
bin extension help.pdf install.sh lib yukon_dep
导入环境变量
# 导入pg_config
[root@VM-4-16-centos Yukon-1.0-postgres13-CentOS_x64-2022_06_24_11_41]# export pg_config=/usr/pgsql-13/bin
# 导入pgdata
[root@VM-4-16-centos Yukon-1.0-postgres13-CentOS_x64-2022_06_24_11_41]# export PGDATA=/var/lib/pgsql/13/data
[root@VM-4-16-centos Yukon-1.0-postgres13-CentOS_x64-2022_06_24_11_41]# export PATH=$PATH:$pg_config:$PGDATA
# 检查环境变量
[root@VM-4-16-centos Yukon-1.0-postgres13-CentOS_x64-2022_06_24_11_41]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/pgsql-13/bin:/var/lib/pgsql/13/data
执行安装命令
[root@VM-4-16-centos Yukon-1.0-postgres13-CentOS_x64-2022_06_24_11_41]# sh install.sh -i
开始安装......
pg_config is /usr/pgsql-13/bin/pg_config
library directory /usr/pgsql-13/lib
extension directory /usr/pgsql-13/share
PGDATA /var/lib/pgsql/13/data
ldconfig: /opt/yukon_dep/ugc/libYkGeometry3D.geo is not a symbolic link
ldconfig: /opt/yukon_dep/ugc/libz.so.1 is not a symbolic link
ldconfig: /opt/yukon_dep/ugc/libQt5Core.so.5 is not a symbolic link
ldconfig: /opt/yukon_dep/cgal/lib/libCGAL_Core.so.13 is not a symbolic link
ldconfig: /opt/yukon_dep/cgal/lib/libCGAL.so.13 is not a symbolic link
ldconfig: /opt/yukon_dep/cgal/lib/libCGAL_ImageIO.so.13 is not a symbolic link
__ __ _ _____ ____
\ \ / / | | | __ \ | _ \
\ \_/ /_ _ | | __ ___ _ __ | | | || |_) |
\ /| | | || |/ // _ \ | '_ \ | | | || _ <
| | | |_| || <| (_) || | | | | |__| || |_) |
|_| \__,_||_|\_\\___/ |_| |_| |_____/ |____/
# 安装好docker后,运行安装命令
[root@VM-4-16-centos ~]# docker run --name Yukon --privileged=true -d -e GS_PASSWORD=Bigdata@123 supermap/yukon:1.0-opengauss2.1.0-amd64
Unable to find image 'supermap/yukon:1.0-opengauss2.1.0-amd64' locally
1.0-opengauss2.1.0-amd64: Pulling from supermap/yukon
ac9208207ada: Pull complete
fad6a6394995: Pull complete
a14fc1eea477: Pull complete
50707812edfd: Pull complete
390d5b4b8fc3: Pull complete
2aad33904d7b: Pull complete
49a1999b86ce: Pull complete
91a11394a4ca: Pull complete
a545b0e06bb9: Pull complete
fdc6605ec13c: Pull complete
40503c42415f: Pull complete
644cc90c068e: Pull complete
Digest: sha256:23dd276ecc6e0e90dabab34191fbb7f4a2af75c02cb134bce83db4677e170eae
Status: Downloaded newer image for supermap/yukon:1.0-opengauss2.1.0-amd64
5dcfa427449fa3ef10860c8c070a715ee187c725f5587c8c3138b5c344248986
# 外部连接需要加 -p 参数
docker run --name Yukon --privileged=true -d -e GS_PASSWORD=Bigdata@123 -p 5432:5432 supermap/yukon:1.0-opengauss2.1.0-amd64
# 通过-v参数持久化数据库
[root@VM-4-16-centos ~]# mkdir -p /Yukon/opengauss
[root@VM-4-16-centos ~]# docker run --name Yukon --privileged=true -d -e GS_PASSWORD=Bigdata@123 -v /Yukon/opengauss:/var/lib/opengauss -p 5432:5432 supermap/yukon:1.0-opengauss2.1.0-amd64
3bfdd711b0022f8fa972ec794d0fa4087c7e2d12febae442c0ee0d4a7e465d32
# 查看镜像
[root@VM-4-16-centos ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
supermap/yukon 1.0-opengauss2.1.0-amd64 4338ee356ffd 2 months ago 1.39GB
# 查看容器
[root@VM-4-16-centos ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5dcfa427449f supermap/yukon:1.0-opengauss2.1.0-amd64 "entrypoint.sh gauss…" 49 seconds ago Up 48 seconds 5432/tcp Yukon
[root@VM-4-16-centos ~]# docker exec -it 5dcfa427449f /bin/bash
[root@5dcfa427449f /]# su omm
[omm@5dcfa427449f /]$ gsql -d postgres
gsql ((openGauss 2.1.0 build 590b0f8e) compiled at 2021-09-30 14:29:04 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
openGauss=#
# postgres 数据库默认已经创建了 postgis , postgis_raster , postgis_sfcgal , yukon_geomodel, yukon_geogridcoder 扩展,可以直接使用。
# 查询 YuKon版本
openGauss=# select yukon_version();
yukon_version
----------------------------------------------------------
1.0.0 Compiled at:2022-06-24 12:10:01 Commit ID:b04a40a
(1 row)
[root@5dcfa427449f /]# su omm
[omm@5dcfa427449f /]$ gsql -d postgres
gsql ((openGauss 2.1.0 build 590b0f8e) compiled at 2021-09-30 14:29:04 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
openGauss=# CREATE USER yukontest WITH SYSADMIN password "Bigdata@123";
NOTICE: The encrypted password contains MD5 ciphertext, which is not secure.
CREATE ROLE
# 登录到数据库
gsql -d postgres -U yukontest -W Bigdata@123
# 创建表空间
# 注: /home/omm/data必须存在
CREATE TABLESPACE yukonspace LOCATION '/home/omm/data';
注:YuKon目前只有10、11 版本的SuperMap iDesktopX版本支持
以下内容及数据库函数说明请参考文档https://yukon.supermap.io/modular_api/geomodel_api.html#
椭圆串:由起始点、重点、中线点、椭圆弧方向、椭圆弧旋转角度、长半轴长度、短轴与长轴比率构成。
YuKon新增的Geometry扩展对象,在测绘制图过程中会有一些不规则的椭圆串需要设定,postgis、openGauss不具备这个能力。
ELLIPSESTRING(xstart ystart, xend yend, xcenter ycenter, minor,clockwise,rotation,axis,ratio);
注:椭圆的起始点和终止点必须要在椭圆上,否则会报错 Invalid Geometry。
-- 查看版本号
select version();
--(openGauss 2.1.0 build 590b0f8e) compiled at 2021-09-30 14:29:04 commit 0 last mr on x86_64-unknown-linux-gnu, compiled by g++ (GCC) 7.3.0, 64-bit
-- 查看postgis版本号
select postgis_full_version();
--POSTGIS="3.2.0 b04a40a" [EXTENSION] PGSQL="92" GEOS="3.10.1-CAPI-1.16.0" SFCGAL="1.3.8" PROJ="8.1.1" GDAL="GDAL 3.3.2, released 2021/09/01" LIBXML="2.9.12" LIBJSON="0.11" RASTER
-- 查看yukon版本号
select yukon_version();
--1.0.0 Compiled at:2022-06-24 12:10:01 Commit ID:b04a40a
-- 指定srid为4326
create table testgeoms (id int primary key, geom geometry);
geometry 子类型,总共有15种
这是因为数据库的安全策略,这个文件夹不属于postgres用户,所以表空间不能被建立在这个文件夹中。
解决方案:切换到root,执行命令 chown omm /home/omm/data/,将该文件夹的所有者改成postgres,再切换回postgres后,执行“create tablespace ramtablespace LOCATION '/home/omm/data”,表空间创建成功。
# omm是postgis用户名
[root@3bfdd711b002 /]# chown omm /home/omm/data/
# 再切回omm用户,连接postgresql后执行以下命令:
openGauss=> CREATE TABLESPACE yukonspace LOCATION '/home/omm/data';
CREATE TABLESPACE
解决方案: 以root进入数据库,修改数据库内部使其解锁
[omm@3bfdd711b002 /]$ gsql -d yukontutorial -U yukontest -W Bigdata@123
gsql: FATAL: The account has been locked.
[omm@3bfdd711b002 /]$ gsql -d postgres -p 5432 -r
gsql ((openGauss 2.1.0 build 590b0f8e) compiled at 2021-09-30 14:29:04 commit 0 last mr )
Non-SSL connection (SSL connection is recommended when requiring high-security)
Type "help" for help.
openGauss=# alter user yukontest account unlock;
ALTER ROLE
# 提示ALTER ROLE 之后就可以正常访问数据库了
需要登录企业微信账号:
https://doc.weixin.qq.com/txdoc/apply_page?k=AEwAawe0AAgIqwnAPsANQApAauAB0&docid=w3_ARMAUgbzAM4XPwEkZE6Qz030c5n7I
问题如下:
问:安装禹贡(Yukon)空间数据库的时候使用的是 openGauss 极简版 2.1.0,openGauss 数据库安装成功后,安装禹贡总是失败,是什么原因呢?
答:目前禹贡(Yukon)1.0 正式版只支持 openGauss 企业版 2.1.0,不建议使用 openGauss 其他版本(如:极简版、轻量版等)。问:安装 openGauss 企业版 2.1.0 的时候参考安装教程操作很复杂,请问有没有快速安装的方式呢?
答:openGauss 企业版 2.1.0 的安装包里提供了一个 simpleInstall 的目录,里面提供了 install.sh 快速安装脚本,如下图所示:问:通过 SuperMap iDesktopX 11i 新建禹贡(Yukon)空间数据库失败,是什么原因呢?
答:目前 SuperMap iDesktopX 11i 只能打开禹贡(Yukon)空间数据库,暂时不支持新建。如果想要新建禹贡空间数据库,需要先在数据库终端通过 SQL 语句创建数据库,添加禹贡扩展模块后,再使用 SuperMap iDesktopX 11i 打开禹贡空间数据库。问:SDX+ for Yukon 引擎支持操作其他(非 public) schema 下的数据表吗?
答:SDX+ for Yukon 引擎是支持操作其他(非 public)schema 下的数据表的,如需操作,建议参考以下流程:
- 新建禹贡数据库;
- 在新建数据库下新建 schema(如:yukon);
- 添加禹贡(Yukon)扩展插件的时候指定具体的 schema,如下代码所示:
a. CREATE EXTENSION postgis WITH SCHEMA yukon;
b. CREATE EXTENSION postgis_raster WITH SCHEMA yukon;
c. CREATE EXTENSION postgis_sfcgal WITH SCHEMA yukon;
d. CREATE EXTENSION yukon_geomodel WITH SCHEMA yukon;
e. CREATE EXTENSION yukon_geogridcoder WITH SCHEMA yukon;
问:禹贡(Yukon)基于 openGauss 企业版 2.1.0 数据库安装失败,请问怎么解决呢?
答:openGauss 企业版 2.1.0 数据库安装成功后,会在 /home/omm 目录下生成 env_single 文件,env_single 是 openGauss 企业版安装成功后生成的数据库环境配置文件,在安装禹贡前需要先根据该文件内容将 openGauss 数据库的环境变量导出。问:GeoSOT 网格编码有多少层?禹贡(Yukon)空间数据库目前支持到多少层?编码字段是如何存储的?
答:GeoSOT 网格编码共有 32 层;目前禹贡(Yukon)空间数据库支持对 GeoSOT 网格全部 32 层级进行编码;编码字段可以根据用户选择存储在原数据表的列上或者存储在一张新表中。问:为什么使用 SuperMap iDesktopX 11i 打开禹贡(Yukon)空间数据库后,新建、导入、复制影像、栅格数据集都会失败?
答:由于禹贡(Yukon)空间数据库中存储的影像数据格式和 SDX+ 引擎的影像存储格式不一样,所以目前暂时无法通过 SDX+ 空间数据库引擎在禹贡数据库中新建、导入、复制影像、栅格数据集。问:禹贡(Yukon)空间数据库支持影像金字塔吗?如果支持的话影像金字塔是如何存储在禹贡空间数据库中的呢?
答:目前禹贡(Yukon)空间数据库中暂不支持影像金字塔,后续可能会考虑支持。问:在禹贡(Yukon)空间数据库中 GeoSOT 二维编码和三维编码有什么区别呢?
答:GeoSOT 二维编码和三维编码的区别可以通过 ST_AsText 直观的表现出来,如下图所示,可以直观的看见禹贡 GeoSOT 三维编码的规则与二维编码一致,三维编码多记录了一个高程值(如:G001310322-232132-210132.2, 0)。
● 二维面 GeoSOT 编码 - (如:G001312100-011000-000212.0)● 三维模型 GeoSOT 编码 - (如:G001310322-232132-210132.2, 0)
问:禹贡(Yukon)空间数据库备份后恢复的时候失败,怎么办呢?
答:因为备份的数据库中含有 geometry 类型的数据,因此在还原的时候要先创建 postgis 扩展,才能恢复数据库,否则将会报错。(建议可以先将禹贡的 5 个扩展模块都添加到要恢复的数据库中,再进行恢复备份)问:为什么在禹贡(Yukon)空间数据库实现矢量面拉伸构建三维模型性能比在 SuperMap iDesktopX 11i 上低很多?
答:在禹贡(Yukon)空间数据库拉伸构建三维模型的时候,拉伸矢量面操作的时候构建 TIN 面的函数比较费时。因此在进行矢量面拉伸构建三维模型的时候,建议使用 SDX+ 空间数据库引擎(如:使用 SuperMap iDesktopX 11i 的线性拉伸代替)。