银河麒麟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的 先安装一些必要的库 ---------------------------------------- ...
随机推荐
- MySQL学习笔记-索引
索引 索引(index)是帮助MySQL高效获取数据的数据结构(有序).在数据之外,数据库系统还维护着满足特定查找算法的数据结构,这些数据结构以某种方式引用(指向)数据,这样就可以在这些数据结构上实现 ...
- js 判断闰年
首先,我们需要了解闰年的判断方式 1.能被4整除 2.并且不能被100整除 3.或者被400整除的 其次我们再来回顾下函数封装的知识,所谓的函数封装就是将一段函数封装成一个工具,有人用到了拿过来就可以 ...
- .NET5 .NET CORE 使用Apollo
Apollo默认有一个"SampleApp"应用,"DEV"环境 和 "timeout" KEY. nuget 中下载 "Com. ...
- Kubernetes监控手册02-宿主监控概述
咱们这个系列是讲解 Kubernetes 监控,Kubernetes 自身也是要跑在机器上的,那机器的监控自然也是整个体系的一环.机器层面的监控分为两部分,带内网络和带外网络,通过带内网络做监控主要是 ...
- The bean ‘xxx‘ could not be injected as a ‘xxx‘because it is a JDK dynamic proxy that implements错误解决
1.解决方法:使用@Autowired 2.@autowired和@resource注解的区别区别:1.@Autowired注解由Spring提供,只按照byType注入:@resource注解由J2 ...
- 使用Blazor WebAssembly整合PocketBase的基础项目模板
使用Blazor WebAssembly整合PocketBase的基础项目模板 在这篇博客文章中,我们将探讨如何创建一个集成PocketBase的基础Blazor WebAssembly项目.我们将涵 ...
- __int1024!
使用说明: 数据范围约为\(-2^{1024}\le N \le2^{1024}\),反映到十进制约为\(-10^{309}\le N \le10^{309}\),但不保证完全如此. 输入输出使用自带 ...
- 端口占用,无法通过netstat找到进程,占用的端口又不能修改,该怎么办?
最近遇到一个奇葩的问题,项目跑的好好的,没有安装其它特殊软件,突然服务器启动报错,日志如下,显然是服务器的8080端口占用了. Caused by: java.net.BindException: A ...
- 阿里云ecs自定义镜像并导出到OSS、并下载
OSS是什么? 有个文章说得比较浅显清楚:什么是OSS?5分钟带你了解! - 知乎 (zhihu.com) 这里摘选核心内容: 白话文解释就是将系统所要用的文件上传到云硬盘上,该云硬盘提供了文件下载. ...
- Vim的移动大法
Vim的移动大法 移动光标的按键 "h" 向左移动 "j"向下移动 "k"向上移动 "l"向右移动 在单词之间移动 注: ...