银河麒麟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的 先安装一些必要的库 ---------------------------------------- ...
随机推荐
- 8.5考试总结(NOIP模拟31)[Game·Time·Cover]
我们总是在注意错过太多,却不注意自己拥有多少. 前言 考场上疯狂搞第一题,终于把人给搞没了.. T1 Game 解题思路 线段树+二分 总体来讲就是用线段树维护三个值: 没有产生贡献的 a(小 B 的 ...
- 7.26考试总结(NOIP模拟24)[matrix·block·graph]
你那无聊的幻想,就由我来打破! 前言 补坑中.. 我都不知道自己这场模拟赛怎么打的了. 非常玄学,前三个小时一直在想正解,然后最后 20min 感觉 T1 不太稳,就又加上了一个暴力. 后来一看只有最 ...
- Web 页面性能衡量指标-以用户为中心的效果指标
Web 页面性能衡量指标-以用户为中心的性能指标 以用户为中心的性能指标是理解和改进站点体验的关键点 一.以用户为中心的性能指标 1. 指标是用来干啥的? 指标是用来衡量性能和用户体验的 2. 指标类 ...
- C语言打印数字前补0
1.要求说明 例如有个数据为a = 0x10,要求打印输出为0x000010. 2.实现 1 #include <stdio.h> 2 3 4 int main() 5 { 6 int a ...
- for while 要求选慢速的,但是for不卡,while 跟 递归 这两个容易卡
for比while慢,但是for不卡,while跟递归容易卡 int index = 0; bool jump=flase: for( index;index==0;;)/*这个空分号算一个语句*/ ...
- django通过channels实现websocket
WebSocket协议是基于TCP的一种新的协议.WebSocket最初在HTML5规范中被引用为TCP连接,作为基于TCP的套接字API的占位符.它实现了浏览器与服务器全双工(full-duplex ...
- jquery中$.get()提交和$.post()提交有区别吗?
相同点: 都是异步请求的方式来获取服务端的数据: 异同点: a.请求方式不同:$.get() 方法使用GET方法来进行异步请求的.$.post() 方法使用POST方法来进行异步请求的. b.参数传递 ...
- [踩坑记录] Vue3 customRef 传入对象没有进入set方法
问题描述 学习Vue3 Ref 相关 API 的时候,遇到了 customRef 这个 API,它可以让我们自定义 ref 的更新的过程 但是使用 customRef 有一个问题就是,如果你传入的是初 ...
- Vue 打包相关
Vue 打包相关 vue-cli-service build# 用法:vue-cli-service build [options] [entry|pattern] 选项: --mode 指定环境模式 ...
- tampermonkey脚本 百度搜索屏蔽CSDN
// ==UserScript==// @name 屏蔽CSDN// @namespace http://tampermonkey.net/// @version 20 ...