银河麒麟V10高级服务器编译安装pg13.4
安装postgres依赖
yum install -y openssl openssl-devel pam pam-devel libxml2 libxml2-devel libxslt libxslt-devel perl perl-devel python-devel perl-ExtUtils-Embed readline readline-devel zlib zlib-devel gettext gettext-devel bison flex gcc gcc-c++ uuid uuid-devel
创建用户
useradd postgres
passwd postgres
创建目录
mkdir /home/postgres/pg13
mkdir /home/postgres/pg13/data
chown -R postgres:postgres /home/postgres
安装postgresql 13
[postgres@localhost postgres] tar -zxvf postgresql-13.4.tar.gz
[postgres@localhost postgres] cd postgresql-13.4/
[postgres@localhost postgresql-14.5] ./configure --prefix=/home/postgres/pg13/ --with-pgport=5432 --with-openssl --with-ossp-uuid --with-libxml --with-libxslt --with-perl --with-blocksize=16
[postgres@localhost postgresql-14.5] make && make install
## 参数说明
--with-blocksize=16 #根据业务需求选择编译的内容
--with-system #可注册成系统服务。
初始化数据库
[postgres@localhost postgres]$ initdb -D /home/postgres/pg13/data -E UTF8 --locale=zh_CN.utf8
配置远程访问
[postgres@local postgres]$ vi /home/postgres/pg13/data/pg_hba.conf
···
host all all 0.0.0.0/0 trust
配置端口
vi /home/postgres/pg13/data/postgresql.conf
listen_addresses = '0.0.0.0'
prot = 5432
max_connections = 10000
启动postgresql
[postgres@local pg14]$ mkdir logs
[postgres@local pg14]$ /home/postgres/pg13/bin/pg_ctl -D /home/postgres/pg13/data -l /home/postgres/pg13/logs/pgsql.log start
环境变量设置
使用postgres用户,环境变量使用/home/postgres/.bashrc文件
vi /home/postgres/.bashrc
export PGHOME=/home/postgres/pg13
export PGDATA=/home/postgres/pg13/data
export LD_LIBRARY_PATH=$PGHOME/lib:lib64:/usr/lib64:/usr/local/lib64:/lib:/usr/lib:/usr/local/lib:$LD_LIBRARY_PATH
export DATE='date +"%Y%m%d%H%M"'
export PATH=$PGHOME/bin:$PATH:.
export MANPATH=$PGHOME/share/man:$MANPATH
设置密码
[postgres@localhost system]$ psql
psql (13.4)
Type "help" for help.
postgres=# alter user postgres with password 'postgres';
ALTER ROLE
postgres=# exit;
开放端口
切换为root用户
(1)查看对外开放的端口状态
查询已开放的端口 netstat -anp
查询指定端口是否已开 firewall-cmd --query-port=5432/tcp
提示 yes,表示开启;no表示未开启。
(2)查看防火墙状态 查看防火墙状态 systemctl status firewalld 开启防火墙 systemctl start firewalld
关闭防火墙 systemctl stop firewalld
开启防火墙 service firewalld start
若遇到无法开启
先用:systemctl unmask firewalld.service
然后:systemctl start firewalld.service
(3)对外开发端口
查看想开的端口是否已开:
firewall-cmd --query-port=5432/tcp
(4)添加指定需要开放的端口:
firewall-cmd --add-port=5432/tcp --permanent
重载入添加的端口:
firewall-cmd --reload
查询指定端口是否开启成功:
firewall-cmd --query-port=5432/tcp
(5)移除指定端口:
firewall-cmd --permanent --remove-port=5432/tcp
注册为服务
# 创建服务文件
[root@localhost ~]# vim /etc/systemd/system/postgres.service
# 添加以下内容
[Unit]
Description=PostgreSQL database server
After=network.target
[Service]
Type=forking
User=postgres
ExecStart=/home/postgres/pg13/bin/pg_ctl start -D /home/postgres/pg13/data -l /home/postgres/pg13/logs/pgsql.log
ExecStop=/home/postgres/pg13/bin/pg_ctl stop -D /home/postgres/pg13/data
[Install]
WantedBy=multi-user.target
# 保存退出
# 加载系统配置并设置为开机自启
[root@localhost system]# systemctl daemon-reload
[root@localhost system]# systemctl enable postgres.service
# 完成重启电脑
创建企业级地理数据库
# 将GeoScene Enterprise安装目录下的对应PostGres版本的st_geometry.dll文件移动到PostGres目录下的lib文件夹里面
[root@jyxx sysgen]# cd /home/geoscene/geoscene/server/DatabaseSupport/PostgreSQL/13/Linux64/
[root@jyxx Windows64]# ll
总用量 166356
-rw------- 1 geoscene GEOscene 303104 12月 23 2022 st_geometry.so
-rw------- 1 geoscene GEOscene 42509824 12月 23 2022 PGSQLEngine.so
[root@localhost lib]# cd /home/postgres/pg13/lib
[root@localhost lib]# ll
总用量 46896
......
-rwxr-xr-x 1 postgres postgres 223144 1月 22 10:45 plpgsql.so
-rw-r--r-- 1 root root 42507776 1月 22 13:54 st_geometry.so
-rwxr-xr-x 1 postgres postgres 131568 1月 22 10:45 utf8_and_big5.so
......
# 修改用户及用户组
[root@localhost lib]# chown -R postgres:postgres /home/postgres/pg13/lib/st_geometry.so
[root@localhost lib]# chmod 755 /home/postgres/pg13/lib/st_geometry.so
## 打开Geoscene Pro 操作
# 授权文件位置:/home/geoscene/geoscene/server/framework/runtime/.wine/drive_c/Program Files/ESRI/License10.9/sysgen
打开工具“创建企业级地理数据库”
输入以下参数:
数据库平台:PostgreSQL
实 例:192.168.0.21,5432(根据自己数据库地址修改)
数 据 库 :xiluodu (数据库名称)
数据库管理员:postgres (自己数据库的账号)
数据库管理员密码:postgres (自己数据库的密码)
地理数据库管理员密码:sde (不理解)
表空间名称: (不填)
授权文件: (根据前面的路径去找)
表空间类型:ST_Geometry
银河麒麟V10高级服务器编译安装pg13.4的更多相关文章
- 银河麒麟V10 SP1服务器操作系统-单用户模式与救援模式调试方法
单用户模式 单用户模式:该模式下系统并没有完全运行进来,只是部分程序运行,包括网络服务,ssh服务等部分服务未运行,因此无法通过远程登录到操作系 统.进入单用户方式进行系统维护由是ROO ...
- .NET 6应用程序适配国产银河麒麟V10系统随记
最近想在麒麟系统上运行.NET 6程序,经过一番折腾最终完成了,简单记录一下. 目标系统: CPU: aarch64架构(ARM64) 操作系统:银河麒麟V10高级服务器系统 银河麒麟V10系统(以下 ...
- 【转载】Linux升级NTPD服务器-编译安装ntp-4.2.8p12与配置
[转载]Linux升级NTPD服务器-编译安装ntp-4.2.8p12与配置 1. 系统与软件版本 1.1 系统版本 rhel6.4(Red Hat Enterprise Linux Server r ...
- 银河麒麟V10安装ASP.NET Core并配置Supervisor让网站开机自动运行
银河麒麟高级服务器操作系统V10是针对企业级关键业务,适应虚拟化.云计算.大数据.工业互联网时代对主机系统可靠性.安全性.性能.扩展性和实时性的需求,依据CMMI 5级标准研制的提供内生安全.云原生支 ...
- 银河麒麟V10安装MySQL5.7
环境: Kylin-Server-10-SP2-Release-Build09-20210524-x86_64.isomysql-5.7.28-linux-glibc2.12-x86_64.tar ...
- Linux64位服务器编译安装MySQL5.6(CentOS6.4)
首先到MySQL官网下载MySQL最新版(目前是mysql-5.6.12)上传到服务器上,下面说一下详细的安装过程. 安装依赖包,可以在线更新也可以配置本地源(CentOS本地源配置)yum -y i ...
- 阿里云ECS云服务器编译安装PHP遇到virtual memory exhausted: Cannot allocate memory
阿里云编译安装php时遇到virtual memory exhausted: Cannot allocate memory 买了个服务器, 1G 的内存阿里云服务器,编译东西按说应该够了,安装相关的内 ...
- 银河麒麟V10在线安装Postgresql步骤
参考资料https://blog.csdn.net/u010430471/article/details/81663248 https://blog.csdn.net/qq_41619524/arti ...
- centos 服务器编译安装apache+php
1.检查服务器中是否自带httpd,如果/etc/httpd/httpd.conf,说明系统自带httpd服务,需要卸载或关闭服务,不要让他影响到本次安装的服务启动 可以用 service httpd ...
- linux-centos7中lnmp服务器编译安装含systemctl启动service(转)
centos7 nginx mysql php 可以分开安装 然后在配置nginx互php的 先安装一些必要的库 ---------------------------------------- ...
随机推荐
- 【论文笔记】轻量级网络MobileNet
[深度学习]总目录 MobileNet V1:<MobileNets: Efficient Convolutional Neural Networks for MobileVision Appl ...
- 鸿蒙HarmonyOS实战-ArkTS语言基础类库(概述)
一.概述 1.什么是语言基础类库 语言基础类库,也称为标准库或核心库,是编程语言提供的一组内置的基础功能和常用工具的集合.它通常包含了各种数据结构.算法.输入输出处理.字符串处理.日期时间处理.文件操 ...
- 面向对象编程 es5和es6的构造函数
/* 面向对象编程 本质 创建一个对象 可以用 属性属性值的 方式 存储 数据参数 ...
- INTEL S4500 960G 入手评测
INTEL S4500 960G 入手评测 简易上个图: CDI AS SSD: CDM: AS SSD AND CDM: -
- n. Elasticsearch JAVA API操作
引言 Elasticsearch所支持的客户端连接方式有两种 Transport 连接 底层使用socket连接,用官方提供的TransPort客户端,网络IO框架使用的是netty Http连接(R ...
- c++ win32 纤程
Win32纤程是一种轻量级的协程机制,它能够在同一个线程中实现多个线程执行的效果,从而提高了程序的并发性和可伸缩性. 在C++中,可以使用Win32 API中的fiber来实现纤程.以下是一个使用纤程 ...
- python安装pywifi
1.Windows安装: 在Dos窗口中输入以下命令: pip install pywifi 如果找不到pip命令,那么需要将Python安装文件夹下Scripts文件夹的绝对路径加入环境变量中. 2 ...
- vue3.4的更新,保证你看的明明白白
defineModel 同学已经转正 defineModel 在vue3.3中还是一个实验性功能, 但是经过一个学期的努力,该同学已经转正. defineModel的简单介绍 defineModel( ...
- Freertos学习:01 移植到STM32
--- title: rtos-freertos-01-移植到STM32 EntryName: rtos-freertos-01-porting-on-stm32 date: 2020-06-17 1 ...
- FFmpeg开发笔记(三十四)Linux环境给FFmpeg集成libsrt和librist
<FFmpeg开发实战:从零基础到短视频上线>一书的"10.2 FFmpeg推流和拉流"提到直播行业存在RTSP和RTMP两种常见的流媒体协议.除此以外,还有比较两 ...