[转帖]在麒麟linux上安装Postgresql12.5
https://jimolonely.github.io/tech/linux/install-postgresql-kylin/
本文主要实践在麒麟V10版本上通过源码编译安装PostgreSQL12.5,因为是源码编译,所以对于其他版本也具有参考性。
麒麟版本
V10
$ uname -a
Linux kylin-v10-02 4.19.90-24.4.v2101.ky10.aarch64 #1 SMP Mon May 24 14:45:37 CST 2021 aarch64 aarch64 aarch64 GNU/Linux
下载PostgreSQL12.5源码
下载地址为官网:https://www.postgresql.org/ftp/source/v12.5/
上传解压到服务器。
编译源码过程
官方文档.
运行
./configure
得到如下报错:
error: readline library not found
需要安装readline
yum install readline-devel -y
然后再运行 ./configure
没有报错后,再运行
make
编译完成后得到成功提示

然后开始安装, 运行
make install
安装成功后可以看到

默认安装路径为 /usr/local/pgsql,我们需要将权限改为postgres
[root@kylin-v10-02 local]# useradd postgres
[root@kylin-v10-02 local]# chown -R postgres:postgres /usr/local/pgsql/

配置环境变量
安装完成后,还要做一些配置操作.
vim /etc/profile加入下面的环境变量配置
export PATH=/usr/local/pgsql/bin:$PATH
LD_LIBRARY_PATH=/usr/local/pgsql/lib
export LD_LIBRARY_PATH
然后刷新配置:
source /etc/profile
启动服务
在启动PG之前,需要准备一个数据目录,注意修改权限:
mkdir -p /export/pgdata
chown -R postgres:postgres /export/pgdata
初始化数据库,注意,要切换到postgres用户
# sudo su - postgres
initdb -D /export/pgdata/
完整输出如下:
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 /export/pgdata ... 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 /export/pgdata/ -l logfile start
启动PG
那我们就启动服务:
[postgres@kylin-v10-02 ~]$ pg_ctl -D /export/pgdata/ -l logfile start
waiting for server to start.... done
server started
测试
[postgres@kylin-v10-02 ~]$ psql
psql (12.5)
Type "help" for help.
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
-----------+----------+----------+-------------+-------------+-----------------------
postgres | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 |
template0 | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | zh_CN.UTF-8 | zh_CN.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(3 rows)
测试ok,不过要提供给其他机器用,还需要一些监听和安全配置。
修改密码
postgres=# alter user postgres password 'postgres';
ALTER ROLE
修改监听地址
默认情况是在localhost上监听 vim /export/pgdata/postgresql.conf ,修改监听地址
listen_addresses = '*'
还要允许密码访问,vim /export/pgdata/pg_hba.conf,在最后加入:
host all all 0.0.0.0/0 md5
然后重启服务
pg_ctl -D /export/pgdata/ -l logfile restart
下一篇,我们还会接着安装 PostGIS: 在麒麟Linux安装Postgis .
[转帖]在麒麟linux上安装Postgresql12.5的更多相关文章
- linux上安装配置samba服务器
linux上安装配置samba服务器 在linux上安装配置samba服务器 在这给大家介绍一个不错的家伙,samba服务.如果您正在犯愁,如何在Windows和Linux之间实现资源共享,就请看看这 ...
- Linux上安装使用SSH(ubuntu&&redhat)
转自:http://blog.csdn.net/zxs9999/article/details/6930736 Ubuntu安装使用SSH ubuntu默认并没有安装ssh服务,如果通过ssh链接ub ...
- 在Windows和Linux上安装paramiko模块以及easy_install的安装方法
一.paramiko模块有什么用? paramiko是用python语言写的一个模块,遵循SSH2协议,支持以加密和认证的方式,进行远程服务器的连接.由于使用的是python这样的能够跨平台运行的语言 ...
- 在Linux上安装Oracle RAC 12 c(12.1) 虚拟机,一步一步向导
Oracle RAC 12 c(12.1)在Linux上安装虚拟机,一步一步向导 今天我们将看到如何安装 12 c版本1 RAC(真正的应用程序集群)数据库2 Linux 64位的虚拟机 使用VMWa ...
- WINDOWS和Linux上安装php7 alpha 并安装 yaf
WINDOWS和Linux上安装php7 alpha 并安装 yaf PHP技术 widuu 2个月前 (06-15) 126浏览 0评论 windows 1.windows上安装 php7 ...
- 在Windows和Linux上安装paramiko模块
一.paramiko模块有什么用? paramiko是用python语言写的一个模块,遵循SSH2协议,支持以加密和认证的方式,进行远程服务器的连接.由于使用的是python这样的能够跨平台运行的语言 ...
- Linux上安装使用boost入门指导
Data Mining Linux上安装使用boost入门指导 获得boost boost分布 只需要头文件的库 使用boost建立一个简单的程序 准备使用boost二进制文件库 把你的程序链接到bo ...
- 如何在Linux上安装Storm
Storm是开源的分布式实时计算系统,能够让数据流处理变得简单.可靠,也因此在大数据领域有广泛的实际 应用.下面介绍一下如何在Linux系统上安装Storm.根据Storm官网介绍,安装Storm软件 ...
- linux上安装Drupal
linux上安装Drupal 前言:国内用drupal的并不太多,网上资料也很少.要注意的是drupal尽量别使用apt来安装,特别是ubuntu平台的drupal做出了一定的更改,会妨碍后期的学习和 ...
- 在Linux上安装Hadoop
先决条件: Hadoop是用JAVA写的,所以首先要安装Java.在Ubuntu上安装JDK见:http://blog.csdn.net/microfhu/article/details/766739 ...
随机推荐
- UnionFind 并查集
简介 UnionFind 主要用于解决图论中的动态联通性的问题(对于输入的一系列元素集合,判断其中的元素是否是相连通的). 以下图为例: 集合[1, 2, 3, 4] 和 [5, 6]中的每个元素之间 ...
- centos7 安装 mysqlclient 报错
报错如下: 解决方法: 先安装依赖: yum install mysql-devel 再安装: pip3 install mysqlclient
- 防火墙添加允许服务器IP和端口方法
一.检测防火墙命令 systemctl status firewalld 如果显示如下active表示防火墙开启 ● firewalld.service - firewalld - dynamic f ...
- BM25(Best Matching 25)算法基本思想
BM25(Best Matching 25)是一种用于信息检索(Information Retrieval)和文本挖掘的算法,它被广泛应用于搜索引擎和相关领域.BM25 基于 TF-IDF(Ter ...
- js文字转语音播放SpeechSynthesisUtterance
文字转语音 SpeechSynthesisUtterance是HTML5中新增的API,用于将指定文字合成为对应的语音 function sayTTS(content) { const synth = ...
- MySQL篇:第三章_详解DQL语言
DQL语言的学习 基础查询 一.语法: SELECT 要查询的东西 [FROM 表名]; 类似于Java中 :System.out.println(要打印的东西); 特点: ①通过select查询完的 ...
- 新晋“网红”Cat1 是什么
摘要:此Cat非彼Cat,它是今年物联网通信圈新晋网红"靓仔". 引言 今年5月,工信部发布了<关于深入推进移动物联网全面发展的通知>,明确提出推动存量2G.3G物联网 ...
- SparkSQL高并发:读取存储数据库
摘要:实践解析如何利用SarkSQL高并发进行读取数据库和存储数据到数据库. 本文分享自华为云社区<SarkSQL高并发读取数据库和存储数据到数据库>,作者:Copy工程师 . 1. Sp ...
- 字节跳动开源数据集成引擎 BitSail 的演进历程与能力解析
导读 BitSail 是字节跳动开源数据集成引擎,支持多种异构数据源间的数据同步,并提供离线.实时.全量.增量场景下全域数据集成解决方案,目前支撑了字节内部和火山引擎多个客户的数据集成需求.经过字节跳 ...
- The Cluster ID Zc7nlyfTQ5qPbhY2d8I_3A doesn't match stored clusterId Some(ZvQZIX9gTB-dj05be_i_-w) in meta.properties.
启动kafka时报错(部分信息): [2022-05-12 20:26:05,589] INFO Cluster ID = Zc7nlyfTQ5qPbhY2d8I_3A (kafka.server.K ...