首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >无法从wso2流处理写入远程mongodb实例

无法从wso2流处理写入远程mongodb实例
EN

Stack Overflow用户
提问于 2019-05-17 15:19:06
回答 1查看 381关注 0票数 2

我正在运行一个siddhi应用程序,该应用程序侦听事件并将它们写入在远程机器上运行的mongodb实例。mongo db实例具有基本的身份验证设置(用户名、密码)。我尝试连接到mongodb实例并将事件写入到一个集合中,在日志中我能够看到wso2可以连接到远程实例

代码语言:javascript
复制
[2019-05-17 12:30:25,753]  INFO {org.mongodb.driver.cluster} - Cluster created with settings {hosts=[10.x.x.xxx:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
[2019-05-17 12:30:25,763]  INFO {org.mongodb.driver.cluster} - Cluster created with settings {hosts=[10.x.x.xxx:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
[2019-05-17 12:30:25,765]  INFO {org.wso2.carbon.siddhi.editor.core.internal.WorkspaceDeployer} - Siddhi App xxxxxxxxxx successfully deployed.
[2019-05-17 12:30:26,017]  INFO {org.mongodb.driver.connection} - Opened connection [connectionId{localValue:430, serverValue:1009}] to 10.x.x.xxx:27017
[2019-05-17 12:30:26,018]  INFO {org.mongodb.driver.connection} - Opened connection [connectionId{localValue:432, serverValue:1010}] to 10.x.x.xxx:27017

当我尝试写入mongodb时,我得到以下错误

代码语言:javascript
复制
[2019-05-17 12:30:35,334] ERROR {org.wso2.siddhi.core.SiddhiAppRuntime} - Error starting Siddhi App 'IntegrationTesting', triggering shutdown process. Error on 'IntegrationTesting'. Error in retrieving collection names from the database 'IntegrationTesting' : Command failed with error 13: 'command listCollections requires authentication' on server 10.x.x.xxx:27017. The full response is { "ok" : 0.0, "errmsg" : "command listCollections requires authentication", "code" : 13, "codeName" : "Unauthorized" }

我尝试在siddhi app @store()中添加用户名和密码,还尝试在/conf/worker/deployment.yaml中添加数据源。在这两种情况下,我都得到了相同的错误。

请协助。

致以问候和感谢,

Chaithanya Kumar.S

数据科学家- Koinearth

EN

回答 1

Stack Overflow用户

发布于 2019-05-20 04:47:49

您是如何配置凭据的,MongoDB扩展要求将用户名和密码插入URI。

代码语言:javascript
复制
@Store(type="mongodb",mongodb.uri="mongodb://admin:admin@localhost/Foo")

https://siddhi-io.github.io/siddhi-store-mongodb/api/1.1.0/

更新:需要adminDB的读权限和写权限

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56181471

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档