zoukankan      html  css  js  c++  java
  • 使用postgresql作为cm的数据库时候添加报错

    如下图,当postgresql安装成功,建立好数据库scm,rman,amon之后,添加cm对应服务报错hadoopNode2没有相应数据库:

    No database server found running on host hadoopNode2.

    错误原因:

    在客户端访问PostgreSQL数据库时,PostgreSQL会读取文件pg_hba.conf判断是否信任该主机,故所有需要连接PostgreSQL Server的主机都应当在pg_hba.conf中添加对其信任,即使是Server主机也不例外!

    解决方法:

    出现上述问题时,需修改postgresql.confpg_hba.conf文件。

    此文件位于postgresql数据文件目录中,默认为/var/lib/pgsql/data/。将postgresql.conf修改如下:

    listen_addresses = '*'

    pg_hba.conf中增加需要连接该数据库主机的ip地址。如下所示,增加对主机10.xxx.xxx.xxx的信任。

    host    all             all             10.xxx.xxx.xxx/32         trust

    如上设置后,使用10.xxx.xxx.xxx可正常连接。

    我的配置是:

    # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
    
    # "local" is for Unix domain socket connections only
    local   all         all                               trust
    # IPv4 local connections:
    host    all         all         127.0.0.1/32          trust
    host    all         all         192.168.33.47/32      trust
    host    all         all         192.168.33.96/32      trust
    # IPv6 local connections:
    host    all         all         ::1/128               trust

    其中192.168.33.96对应就是hadoopNode2;

    然后重启postgresql服务:

    service postgresql restart

    done!

  • 相关阅读:
    JQUERY
    五分钟技术演讲
    T-SQL基础--chp10可编程对象学习笔记[下]
    SQL中用SET赋值和用SELECT赋值的区别。
    Can't find file: './mysql/plugin.frm' (errno: 13)[mysql数据目录迁移错位]错误解决
    jetty属性
    JRebel 5.3.2
    vue+mongoodb+node连接数据库
    css样式
    超出文本显示一行文字
  • 原文地址:https://www.cnblogs.com/gxc2015/p/9284265.html
Copyright © 2011-2022 走看看