广告
返回顶部
首页 > 资讯 > 数据库 >centos6安装postgresql9主从节点重点提要
  • 296
分享到

centos6安装postgresql9主从节点重点提要

2024-04-02 19:04:59 296人浏览 八月长安
摘要

1、需求分析系统版本:cat /etc/redhat-release Red Hat Enterprise linux Server release 6.7 (SantiaGo)在PGsql9之后

1、需求分析

系统版本:

cat /etc/redhat-release 

Red Hat Enterprise linux Server release 6.7 (SantiaGo)


在PGsql9之后才有了主从的功能,但是在Centos6的源中默认是安装PGSQL8,所以就需要去网上下载软件包安装。


2、卸载旧版PGSQL

# yum remove postgresql-server


3、在下面网站找到自己需要的版本

https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-6.7-x86_64/

postgresql94-9.4.18-1PGDG.rhel6.x86_64.rpm

postgresql94-devel-9.4.18-1PGDG.rhel6.x86_64.rpm

postgresql94-libs-9.4.18-1PGDG.rhel6.x86_64.rpm

postgresql94-server-9.4.18-1PGDG.rhel6.x86_64.rpm


4、上传并安装

# yum install -y postgresql94-libs-9.4.18-1PGDG.rhel6.x86_64.rpm postgresql94-9.4.18-1PGDG.rhel6.x86_64.rpm postgresql94-server-9.4.18-1PGDG.rhel6.x86_64.rpm postgresql94-devel-9.4.18-1PGDG.rhel6.x86_64.rpm


5、命令执行注意点

因为不是按照系统默认安装的,所以需要把执行路径添加到环境变量


通过命令查看相关命令的具体位置

# rpm -qa | grep postgres*

postgresql94-libs-9.4.18-1PGDG.rhel6.x86_64

postgresql94-devel-9.4.18-1PGDG.rhel6.x86_64

postgresql-libs-8.4.20-8.el6_9.x86_64

postgresql94-9.4.18-1PGDG.rhel6.x86_64

postgresql94-server-9.4.18-1PGDG.rhel6.x86_64


# rpm -ql postgresql94-server-9.4.18-1PGDG.rhel6.x86_64 | more

/usr/pgsql-9.4/bin/psql

/usr/pgsql-9.4/bin/initdb

/usr/pgsql-9.4/bin/pg_ctl


# vi /etc/profile

添加

export PATH=$PATH://usr/pgsql-9.4/bin


# source /etc/profile


6、启动方式和开机启动配置

启动方式

$ pg_ctl -D /data/pg_data start


开机启动服务配置

vi /etc/rc.d/rc.local

添加

/usr/pgsql-9.4/bin/pg_ctl -D /data/pg_data start


如果服务起不来,可以查看日志文件/data/pg_data/pg_log/postgresql-xxx.log进行排查。

其他配置与我之前的文章生产环境postgresql主从环境配置并无二致


参考:

Https://blog.csdn.net/kongxx/article/details/52883383

您可能感兴趣的文档:

--结束END--

本文标题: centos6安装postgresql9主从节点重点提要

本文链接: https://www.lsjlt.com/news/43147.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作