暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

记录|PG-PCA学习笔记-参数配置

chkl 2024-04-25
106

1、连接加密方式

\conninfo
alter system set password_encryption='scram-sha-256';
select pg_reload_conf() ;
show password_encryption ;
select * from pg_shadow ;
复制

需注意:在pg_hba.conf中修改加密连接方式后,(需与postgres.conf中的password_encryption参数保持一致)需要重启或重载后生效。

2、用户映射配置文件pg_ident.conf

允许指定系统用户下实现免密登录(映射表里配置的系统用户下登录指定用户)

vim pg_ident.conf
# MAPNAME  SYSTEM-USERNAME PG-USERNAME
  pgmap        test           postgres
  pgmap        test           username

vim pg_hba.conf
lcoal all  all  ident  map=pgmap
复制

3、连接异常及排查

常见连接问题:端口异常及监听异常会报“connection refused”;访问控制异常会报:“no encruption”;客户端报:“Connection timed out”
原因分析:防火墙未关闭、未监听客户端IP地址、未开放客户端地址访问权限。
解决方法:关闭防火墙systemctl status firewalld;修改postgresql.conf中listen_addresses=’*’(监听);修改pg_hba.conf文件中host all all 0.0.0.0/0 md5(访问地址);重启数据库服务。
日志查看:/var/log/message、$PG_HOME/data/log/

systemctl stop firewalld
systemctl restart postgresql
复制
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论

目录
  • 1、连接加密方式
  • 2、用户映射配置文件pg_ident.conf
  • 3、连接异常及排查