溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

測試postgresql集群

發(fā)布時(shí)間:2020-06-04 14:05:07 來源:網(wǎng)絡(luò) 閱讀:3741 作者:Chrisu 欄目:數(shù)據(jù)庫

一、yum安裝pgsql10
二、


一、yum安裝pgsql10

  1. 先安裝pgsql
    環(huán)境centos 7 64位
    數(shù)據(jù)庫:pg10dev
    參考網(wǎng)址:
    http://blog.csdn.net/silenceray/article/details/70577610

創(chuàng)建用戶

[root@localhost ~]#useradd postgres

配置你的yum存儲(chǔ)庫

[root@localhost ~]# vim /etc/yum.repos.d/CentOS-Base.repo
[base] 和[updates] 區(qū)段之間添加:
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數(shù)據(jù)庫
[root@localhost ~]# yum list postgresql*

[root@localhost ~]# yum install postgresql10-server.x86_64
[root@localhost ~]# mkdir postgres /var/lib/pgsql/10/data
初始化數(shù)據(jù)庫
[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 修改配置文件,允許遠(yuǎn)程登陸。
和pg_hba.conf一個(gè)目錄下的,postgresql.conf,

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

2.3 修改端口
測試postgresql集群

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI