Postgresql 和主机

标签 postgresql ssl ruby-on-rails-4 capistrano3

我正在尝试通过 Capistrano 3 部署我的 Rails 应用程序。 在我自己的服务器上一切正常,但在我的新服务器上,我在访问数据库时遇到了一些问题:

DEBUG [05c115bf]        FATAL:  no pg_hba.conf entry for host "ip.address.of.the.server", user "postgres", database "my_database", SSL on
DEBUG [05c115bf]        FATAL:  no pg_hba.conf entry for host "ip.address.of.the.server", user "postgres", database "my_database", SSL off

我知道问题来自 pg_hba,但我找不到确切的位置。

这是我试过的:

# Database administrative login by Unix domain socket
local   all             postgres                                md5

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     peer
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
hostssl    all             all             ip.address.of.the.server/24          md5
hostnossl    all             all             ip.address.of.the.server/24          md5

# IPv6 local connections:
host    all             all             ::1/128                 md5

# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     postgres                                peer
#host    replication     postgres        127.0.0.1/32            md5
#host    replication     postgres        ::1/128                 md5

目前我被阻止了。

最佳答案

如果ip.address.of.the.server,请输入您要连接的服务器的真实 IP 地址以获取更多信息,请访问 pg_hba.conf

关于Postgresql 和主机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23127199/

相关文章:

ruby-on-rails - 我可以在没有开始...结束的情况下将重试放在救援 block 中吗?

PostgreSQL 表名或列名大小写

ruby-on-rails - rubyonrails 和 heroku 中的证书

ruby-on-rails - Mongoid 5.0 - Rails 4 - Finder 停止工作

postgresql - 部分索引表达式的不一致统计

sql - 在字符串列表中搜索 super 字符串 - POSTGRES

客户端-服务器应用程序上的 Linux 套接字输入通知

WCF:如何对 SSL 服务执行 "Add Service Reference"(我收到错误)

sql - rails : get parent records having ZERO has_many associations

mongoid - 使用强参数的 Mongoid 中的动态哈希字段