繁体   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

在分发特定的 PostgreSQL 表并添加新节点以扩展我的数据库后,我在应用 Citus 重新平衡时遇到问题。

如果您想在帮助之前了解 citus 中的再平衡,可以查看这篇有用的文章

就我而言,我试图通过使用 citus rebalancing 将我的数据传播到新添加的节点。

因此,假设我有几台具有相同凭据的服务器并创建了相同的数据库。 我已将其中一个指定为协调节点(在下面的示例配置和查询中将表示为“ 192.168.1.100 ”),以及我想添加以扩展我的数据的节点(将表示为( “ 192.168.1.101”在下面的示例配置和查询中)。

首先,我通过执行以下查询设置了协调器节点。

SELECT citus_set_coordinator_host('192.168.1.100', 5432);

然后,我分配了我的桌子

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

您可能知道,为了使“citus 重新平衡”有意义,我们应该能够在添加/删除节点后重新平衡我们的数据。

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

所以我们执行了以下查询来管理它。

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

每次我们尝试使用不同的配置或修复执行查询时都会发生以下错误。

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

经过数小时的研究并在这个问题中应用了所有建议的解决方案,我决定创建一个新问题来讨论这个问题。

系统详细信息和配置文件如下。

操作系统: Ubuntu 20.04.4 LTS

Citus版本: 11.0-2

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文件内容:

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

任何帮助将不胜感激,在此先感谢。

谢谢你。

  • 我将trust线移到了 pg_hba.conf 中的scram线之上,
  • 为分布式表定义主键和
  • 在 postgresql.conf 中设置wal_level=logical

那么我的桌子现在已经成功地重新平衡了。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM