HAWQ配置之客戶端訪問

一、配置簡單的口令訪問

1,建立數據庫和用戶

postgres=# create database epbd;
CREATE DATABASE
postgres=# create role user1 with login;
NOTICE:  resource queue required -- using default resource queue "pg_default"
CREATE ROLE
postgres=# alter role user1 with password 'user1';
ALTER ROLE
postgres=# grant all on epbd to user1;
ERROR:  relation "epbd" does not exist
postgres=# grant all on database epbd to user1;
GRANT

 

2,修改master訪問配置文件pg_hba.conf,添加一個口令訪問用戶

local    all         gpadmin         ident
host     all         gpadmin         127.0.0.1/28    trust
host  all     gpadmin    ::1/128       trust
host  all     gpadmin    192.168.58.15/32       trust
host  all     gpadmin    fe80::4ecc:6aff:fe93:3250/128       trust
host  all     gpadmin    192.168.58.11/32       trust
local all yh password host all user1
192.168.0.0/16 password

 

3,重載配置文件使之生效

 hawq stop cluster -u -a -M fast

注意這個命令並非停止集羣,只是爲了重新裝載配置。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章