cdc读取monggodb没有权限,需要什么权限才能读,必须是root权限吗?
遇到问题能看一下官方文档吗?从flink cdc官方文档看,mongodb CDC connector需要一个具有changeStream 和read权限的用户名为flinkuser密码为flinkpw的账户。账号和密码可以自定义,但是使用cdc connector连接时需要使用该账号密码来初始化副本集和数据
Setup MongoDB Availability MongoDB version
MongoDB version >= 3.6 We use change streams feature (new in version 3.6) to capture change data.
Cluster Deployment
replica sets or sharded clusters is required.
Storage Engine
WiredTiger storage engine is required.
Replica set protocol version
Replica set protocol version 1 (pv1) is required. Starting in version 4.0, MongoDB only supports pv1. pv1 is the default for all new replica sets created with MongoDB 3.2 or later.
Privileges
changeStream and read privileges are required by MongoDB Kafka Connector.
You can use the following example for simple authorization. For more detailed authorization, please refer to MongoDB Database User Roles.
use admin; db.createUser({ user: "flinkuser", pwd: "flinkpw", roles: [ { role: "read", db: "admin" }, //read role includes changeStream privilege { role: "readAnyDatabase", db: "admin" } //for snapshot reading ] });
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。
实时计算Flink版是阿里云提供的全托管Serverless Flink云服务,基于 Apache Flink 构建的企业级、高性能实时大数据处理系统。提供全托管版 Flink 集群和引擎,提高作业开发运维效率。