【问题标题】:finding server IP on postgres heroku database在 postgres heroku 数据库上查找服务器 IP
【发布时间】:2013-03-17 17:03:22
【问题描述】:

我有一个 Heroku Postgres 数据库。有三个插槽可以连接到 Heroku 服务器:

  • 服务器:?
  • 用户名:(我有)
  • 密码:(我有)

如何找到连接到 Heroku DB 的服务器 IP?

【问题讨论】:

  • 从命令提示符 ping 它。

标签: postgresql heroku coldfusion


【解决方案1】:

heroku config 的输出中,您将看到DATABASE_URL 的条目,它采用以下形式:

postgres://username:password@host:port/database_name

在您的情况下,您将希望主机中的值紧跟在 @ 符号之后。

【讨论】:

    【解决方案2】:

    您不应使用 IP 地址进行连接,而应使用主机名。主机名在连接字符串中。 Heroku 开发中心有更多详细信息:https://devcenter.heroku.com/articles/heroku-postgresql#external-connections-ingress

    如果你确实需要IP地址,可以通过nslookup之类的命令将主机名解析为地址:

    nslookup foo-domain.com
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-29
      • 2018-11-21
      • 1970-01-01
      • 2013-08-17
      • 2015-01-08
      • 1970-01-01
      • 2013-01-19
      • 2014-05-13
      相关资源
      最近更新 更多