知识库

错误“org.postgresql.util.PSQLException: Connection to localhost:8060 refused”


发布时间: 31 Aug 2016
上次修改日期: 20 Jul 2023

问题

Tableau Server 登录失败,并且连接到内部 PostgreSQL 存储库的 tabadmin 命令返回以下错误:

The driver encountered an unknown error: org.postgresql.util.PSQLException: Connection to localhost:8060 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.(驱动程序遇到未知错误:org.postgresql.util.PSQLException:拒绝连接到 localhost:8060。请检查主机名和端口是否正确,并且 postmaster 接受 TCP/IP 连接。)

环境

Tableau Server

解决方案

通过从命令提示符中运行 tabadmin status -v 来确定 Tableau Server 的当前状态。有关详细信息,请参见 tabadmin 命令:status
 
  • 如果 tabadmin status 显示 Tableau Server 存储库为“Stopped”(已停止)
    1. 确认用户运行身份是否具有必需的用户运行身份帐户设置中所述的必要权限。 
    2. 重新启动 Tableau Server。
  • 如果 tabadmin status 显示 Tableau Server 存储库“Setting up”(正在设置),请增加存储库的连接超时:

    以管理员身份打开命令提示符,并运行以下命令
    tabadmin stop
    tabadmin set clustercontroller.pgsql_connection_timeout_ms 6000
    tabadmin config
    tabadmin start


    如果在将值设置为 6000 后问题仍然存在,则可以再次增加该值,最大可增加到 60000。为了获得最佳效果,我们建议使用尽可能最低的值。

     
  • 如果 tabadmin status 显示“Running”(正在运行)

    防火墙或防病毒软件可能阻止与 Tableau Server 存储库通信。有关详细信息,请参见配置与 Internet 的通信

原因

Tableau Server 存储库无法正常启动。Tableau Server 存储库包含导致登录失败的所有身份验证信息。

其他信息

Tableau Server 会等待一段设定的时间(默认为 60 秒)以让数据库启动,之后再重试或重新启动它。以下两个 workgroup.yml 设置确定超时:

clustercontroller.pgsql_connection_attempts(默认值 = 20)
clustercontroller.pgsql_connection_timeout_ms(默认值 = 3000)

这两个值的乘积确定总超时时长。(60000 毫秒或 60 秒)。

增加 clustercontroller.pgsql_connection_timeout_ms 的值将会增加 clustercontroller 在尝试进行故障转移之前等待 Postgres 响应的时间。增加此设置的值可能会对 Tableau Server 的性能产生负面影响。 例如,它可能会增加 Tableau Server 在发生故障时无响应的时间,因为 clustercontroller 在重新启动 Postgres(如果其确实已停止)之前将等待更长时间。这就是为何我们建议为此设置使用尽可能最低的值的原因。 
最佳解决方案始终是:调查哪些环境因素导致 Postgres 启动缓慢。作为一种快速解决方法,修改 clustercontroller.pgsql_connection_timeout_ms 设置可能有用,同时我们正在对性能缓慢问题进行调查,以寻求一种长期修复方法。
 

此文章是否已解决问题?