测试postgresql集群

发布时间:2020-06-04 14:05:07 作者:Chrisu
来源:网络 阅读:3736

一、yum安装pgsql10
二、


一、yum安装pgsql10

  1. 先安装pgsql
    环境centos 7 64位
    数据库:pg10dev
    参考网址:
    http://blog.csdn.net/silenceray/article/details/70577610

创建用户

[root@localhost ~]#useradd postgres

配置你的yum存储库

[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Base.repo
[base] 和[updates] 区段之间添加:
exclude=postgresql*

安装pg的rpm文件

[root@localhost ~]# yum localinstall https://download.postgresql.org/pub/repos/yum/testing/10/redhat/rhel-7-x86_64/pgdg-centos10-10-1.noarch.rpm

安装pg数据库
[root@localhost ~]# yum list postgresql*

[root@localhost ~]# yum install postgresql10-server.x86_64
[root@localhost ~]# mkdir postgres /var/lib/pgsql/10/data
初始化数据库
[root@localhost ~]# /usr/pgsql-10/bin/postgresql10-setup initdb
Initializing database ... OK

[root@localhost ~]# su - postgres

[postgres@localhost ~]$ /usr/pgsql-10/bin/pg_ctl -D /var/lib/pgsql/10/data start

[postgres@localhost ~]$ /usr/pgsql-10/bin/psql -p 5432
psql (10devel)
输入 "help" 来获取帮助信息.

postgres=#

安装完成!

  1. 配置pgsql,使客户端能访问
    2.1 改密码
    (1)su postgres
    (2) psql -U postgres -p5433
    (3)alter user postgres with password 'postgres' ;

2.2 修改配置文件,允许远程登陆。
和pg_hba.conf一个目录下的,postgresql.conf,

    listen_addresses = 'localhost' ,改成listen_addresses = '*'

2.3 修改端口
测试postgresql集群

推荐阅读:
  1. 搭建Redis 集群,测试集群:对节点主机重新分片
  2. postgresql高可用集群的安装步骤

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

postgre sql 集群

上一篇:如何搭建golang框架

下一篇:计算机中丢失mfc100.dll处理方法

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》