我正在尝试按照Postgres的Debezium教程设置一个复制用户。创建复制用户的命令如下:
CREATE ROLE replication_role WITH REPLICATION LOGIN;
CREATE USER debezium WITH PASSWORD 'my-secret-pw';
GRANT replication_role TO debezium;
CREATE ROLE replication_group WITH LOGIN;
GRANT replication_group TO postgres;
GRANT replication_group TO debezium;
ALTER TABLE person OWNER TO replication_group;
,它设置了复制用户,如下所示:
List of roles
Role name | Attributes | Member of
-------------------+------------------------------------------------------------+--------------------------------------
debezium | | {replication_role,replication_group}
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {replication_group}
replication_group | | {}
replication_role | Replication | {}
当我尝试启动Postgres源连接器时,我得到如下错误:
io.debezium.DebeziumException: Creation of replication slot failed
...
Caused by: org.postgresql.util.PSQLException: FATAL: must be superuser or replication role to start walsender
我如何修复权限问题,以便我可以开始从Postgres复制?
不继承复制属性。该属性必须直接在使用它的角色上设置。你说你在遵循教程,但据我所知你并没有。您似乎混淆了创建出版物所需的权限/属性,以及传输出版物所需的权限/属性。