本文介绍了talend , mongoDB 连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了 mongo DB 连接问题.

I am facing a problem with mongo DB connection.

我已成功将 tMongo 组件导入到我的 Talend Open Studio 5.1.1 并通过将 mongo 1.3.jar 文件复制到 lib/java 文件夹,我的 Mongo DB 作业成功运行,但问题是即使我提供了一些mongoDB 的假服务器路径(IP)和假端口,我的工作运行没有错误,它给了我 1 行没有数据.正确的 IP 和端口也是如此.

I have succefully imported tMongo components it to my Talend Open Studio 5.1.1 and by copying the mongo 1.3.jar file to lib/java folder, my Mongo DB jobs are running successfully, but the problem is even if I provide some fake server path(IP) and fake port for mongoDB, my job is running without an error and it is giving me 1 row with no data. and same goes with right IP and port.

我该如何解决.

推荐答案

我认为连接不起作用.您一定知道,mongoDB 会在您对其执行查询时检查该连接是否确实有效.(是的,当您连接到它时,它不会检查连接是否成功).

I think the connection is not working. As you must be knowing, mongoDB checks that the connection is actually working or not when you perform a query on it.(Yeah, it doesn't check for a successful connection when you just connect to it ).

我建议按照以下步骤添加 Talend for Big Data 中存在的 mongoDB 组件:为 MongoDB 提供的组件有:tMongoDBInput、tMongoDBOutput、tMongoDBConnection 等

I would suggest to instead add the mongoDB components present in Talend for Big Data by following the steps below:Components provided for MongoDB are :tMongoDBInput, tMongoDBOutput, tMongoDBConnection etc.

  1. 或者您可以从 http://www.talendforge.org/exchange/ 下载组件并搜索 Mongo 而不是使用 Talend Big Data.但我建议将 Talend 用于大数据.
  2. 组件将以压缩格式,解压缩相同.在 Talend Big data 中,您将在 Component 文件夹中找到组件.
  3. 将这些解压后的组件复制到TOS的安装路径中.C:TalendTOS_DI-Win32-r84309V5.1.1pluginsorg.talend.designer.components.localprovider_5.1.1.r84309components
  4. 将component文件夹中的mongo-1.3.jar文件复制到C:TalendTOS_DI-Win32-r84309-V5.1.1libjava中在许多系统中,您可能无法看到此文件,然后使用管理员权限.
  5. 少数系统可选——>>> 在 index.xml 中添加保存 index.xml
  6. 重启服务条款
  1. Or you can Download the components from http://www.talendforge.org/exchange/ and search for Mongo instead of using Talend Big Data. But I would suggest use Talend for big Data for it.
  2. The components will be zipped format , Unzip the same. In Talend Big data you will find the components in Component folder.
  3. Copy these Unzipped Components to the installation Path of TOS.C:TalendTOS_DI-Win32-r84309V5.1.1pluginsorg.talend.designer.components.localprovider_5.1.1.r84309components
  4. Copy the mongo-1.3.jar file in the component folder into the C:TalendTOS_DI-Win32-r84309-V5.1.1libjavaIn many systems you might not be able to see this file then go with ADMINISTRATOR priviliges.
  5. optional for few systems——>>> Inside index.xml add save index.xml
  6. Restart TOS

然后您就可以将它们用作普通组件.

Then you will be able to use them as normal components.

干杯!

这篇关于talend , mongoDB 连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 09:48