开发者社区 > 大数据与机器学习 > 实时计算 Flink > 正文

cdc读取monggodb没有权限,需要什么权限才能读,必须是root权限吗?

cdc读取monggodb没有权限,需要什么权限才能读,必须是root权限吗?

展开
收起
游客3oewgrzrf6o5c 2022-08-20 17:18:30 2287 0
1 条回答
写回答
取消 提交回答
  • 遇到问题能看一下官方文档吗?从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 ] });

    2022-08-21 17:05:38
    赞同 展开评论 打赏

实时计算Flink版是阿里云提供的全托管Serverless Flink云服务,基于 Apache Flink 构建的企业级、高性能实时大数据处理系统。提供全托管版 Flink 集群和引擎,提高作业开发运维效率。

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载