简体   繁体   English

PostgreSQL 添加新节点后的 Citus Shard Rebalancing -> 连接到远程节点 localhost:5432 失败并出现以下错误

[英]PostgreSQL Citus Shard Rebalancing after adding new node -> connection to the remote node localhost:5432 failed with the following error

Here I have a problem while applying Citus rebalancing after distributing a specific PostgreSQL table and adding new nodes to scale my database.在分发特定的 PostgreSQL 表并添加新节点以扩展我的数据库后,我在应用 Citus 重新平衡时遇到问题。

You can take a look at this useful article if you would like to understand rebalancing in citus before helping out.如果您想在帮助之前了解 citus 中的再平衡,可以查看这篇有用的文章

In my case I have tried to spread my data to newly added nodes by using citus rebalancing.就我而言,我试图通过使用 citus rebalancing 将我的数据传播到新添加的节点。

So let's assume I have several servers with same credentials and have same databases created.因此,假设我有几台具有相同凭据的服务器并创建了相同的数据库。 I have assigned one of them as the coordinator node(it will be represented as " 192.168.1.100 " in the example configuration and queries below), and a node that I would like to add to scale my data (will be represented as ( "192.168.1.101" in the example configuration and queries below ).我已将其中一个指定为协调节点(在下面的示例配置和查询中将表示为“ 192.168.1.100 ”),以及我想添加以扩展我的数据的节点(将表示为( “ 192.168.1.101”在下面的示例配置和查询中)。

First of all, I have set the coordinator node by executing the following query.首先,我通过执行以下查询设置了协调器节点。

SELECT citus_set_coordinator_host('192.168.1.100', 5432);

Then, I have distributed my table by然后,我分配了我的桌子

select create_distributed_table('public."Table"','distributedField')

As you may know, For "citus rebalancing" to make sense, we should be capable of rebalancing our data after adding/removing nodes.您可能知道,为了使“citus 重新平衡”有意义,我们应该能够在添加/删除节点后重新平衡我们的数据。

SELECT * from citus_add_node('192.168.1.101', 5432);

So we have executed the following query to manage it.所以我们执行了以下查询来管理它。

Select * from rebalance_table_shards('public."Table"');

The following error occured every time we tried to execute the query with different configurations or fixes.每次我们尝试使用不同的配置或修复执行查询时都会发生以下错误。

connection to the remote node localhost:5432 failed with the following error: fe_sendauth: no password supplied

After hours of research and applying all the suggested solutions in this question , I decided to create a new question to discuss about this.经过数小时的研究并在这个问题中应用了所有建议的解决方案,我决定创建一个新问题来讨论这个问题。

The system details and configuration files are below.系统详细信息和配置文件如下。

OS: Ubuntu 20.04.4 LTS操作系统: Ubuntu 20.04.4 LTS

Citus Version: 11.0-2 Citus版本: 11.0-2

DB : PostgreSQL 14.4 (Ubuntu 14.4-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit DB : PostgreSQL 14.4 (Ubuntu 14.4-1.pgdg20.04+1) on x86_64-pc-linux-gnu, 由 gcc (Ubuntu 9.4.0-1ubuntu1~20.04-bit) 编译 (Ubuntu 9.4.0-1ubuntu1~20.04-bit)

pg_hba.conf file content: pg_hba.conf文件内容:

local   all             postgres                                peer

local   all             all                                     peer

host    all             all             127.0.0.1/32            scram-sha-256

host    all             all             ::1/128                 scram-sha-256

local   replication     all                                     peer
host    replication     all             127.0.0.1/32            scram-sha-256
host    replication     all             ::1/128                 scram-sha-256
host    all             all             192.0.0.0/8             trust

host    all             all             127.0.0.1/32            trust
host    all             all             ::1/128                 trust
host    all             all             192.168.1.101/32        trust

Any help would be appreciated, thanks in advance.任何帮助将不胜感激,在此先感谢。

Thank you jjanes.谢谢你。

  • I moved trust lines above the scram lines in pg_hba.conf,我将trust线移到了 pg_hba.conf 中的scram线之上,
  • Defined a primary key for the distributed table and为分布式表定义主键和
  • set wal_level=logical in the postgresql.conf在 postgresql.conf 中设置wal_level=logical

then my table have been successfully rebalanced now.那么我的桌子现在已经成功地重新平衡了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 添加新节点时的重新平衡率 - Rebalancing rate when new node is added PostgreSQL - 与本地主机的连接:“****”拒绝错误 - PostgreSQL - Connection to localhost:"****" refused error (节点:1184)UnhandledPromiseRejectionWarning:错误:连接 ECONNREFUSED 127.0.0.1:5432 - (node:1184) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:5432 连接错误:我是Mongodb的新手,现在我在创建与节点js的连接到mongodb图集显示以下错误时遇到mongodb问题 - connection error:I am new in Mongodb and now I face a problem with mongodb when create connection with node js to mongodb atlas display following erro Node js mongodb数据库连接错误无法连接到服务器 - Node js mongodb database connection error failed to connect to server 节点 OracleDB 连接在远程服务器中不起作用 - Node OracleDB connection not working in remote server MikroORM 无法连接到 postgresql://postgres@127.0.0.1:5432 上的数据库 lireddit - MikroORM failed to connect to database lireddit on postgresql://postgres@127.0.0.1:5432 与 pgAdmin 的远程 PostgreSQL 连接 - Remote PostgreSQL connection with pgAdmin 本地主机中的节点 postgres ECONNREFUSED - Node postgres ECONNREFUSED in localhost 与 node.js 的 postgres 连接中的 SASL 错误 - SASL error in postgres connection with node.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM