August 16, 2023

tMongoDBConfiguration – Docs for ESB 6.x

tMongoDBConfiguration

Stores connection information and credentials to be reused by other MongoDB
components.

You configure the connection to a MongoDB database in tMongoDBConfiguration and configure the other
MongoDB components to reuse this configuration. At runtime, the Spark
executors read this configuration in order to connect to MongoDB.

Depending on the Talend solution you
are using, this component can be used in one, some or all of the following Job
frameworks:

tMongoDBConfiguration properties for Apache Spark Batch

These properties are used to configure tMongoDBConfiguration running in the Spark Batch Job framework.

The Spark Batch
tMongoDBConfiguration component belongs to families.

The component in this framework is available only if you have subscribed to one
of the
Talend
solutions with Big Data.

Basic settings

Property type

Either Built-In or Repository.

Built-In: No property data stored centrally.

Repository: Select the repository file where the
properties are stored.

DB Version

Select the version of the MongDB database you need to connect to.

Use replica set address or multiple query
routers

Select this check box to show the Server
addresses
table.

In the Server addresses
table, define the sharded MongoDB databases or the MongoDB replica sets
you want to connect to.

Server and Port

Enter the IP address and listening port of the database
server.

Available when the Use replica set
address or multiple query routers
check box is not
selected.

Database

Enter the name of the MongoDB database to be connected to.

Use SSL connection

Select this check box to enable the SSL or TLS encrypted connection.

Then you need to use the tSetKeystore
component in the same Job to specify the encryption information.

In addition, set the spark.executor.extraJavaOptions
property in the Advanced properties table in the
Spark configuration tab of the Run view. For
example:
This
property sets the same parameters as tSetKeystore does for the Spark executors, so you can copy the
values from tSetKeystore, Furthermore, you must
deploy the keystore on all worker nodes at the exact same location. In the example
above, it is /tmp/keystore.jks.

For further information about tSetKeystore, see tSetKeystore.

Note that the SSL connection is available only for the version 2.4 + of
MongoDB.

Use authentication

If the MongoDB database to be used requires authentication, select this check box
to enable the database authentication.

Among the mechanisms listed on the Authentication mechanism
drop-down list, the NEGOTIATE one is recommended if
you are not using Kerberos, because it automatically select the authentication mechanism
the most adapted to the MongoDB version you are using.

For details about the other mechanisms in this list, see MongoDB Authentication from the MongoDB
documentation.

Set Authentication database

If the username to be used to connect to MongoDB has been created in a specific
Authentication database of MongoDB, select this check box to enter the name of this
Authentication database in the Authentication database
field that is displayed.

For further information about the MongoDB Authentication database, see User Authentication database.

Username and Password

DB user authentication data.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

Available when the Use authentication
check box is selected.

If the security system you have selected from the Authentication mechanism drop-down list is Kerberos, you need to
enter the User principal, the Realm and the KDC
server
fields instead of the Username and the Password
fields.

Advanced settings

Connection string options

You can define more properties in this table for the connection to MongoDB,
in addition to the properties defined in the Basic
settings
tab.

For example, you can add the following option to specify a timeout value
for this connection.

For further information about the options you can add in this table, see
Connection options.

Usage

Usage rule

This component is used with no need to be connected to other components.

The configuration in a tMongoDBConfiguration component applies only on the MongoDB related
components in the same Job. In other words, the MongoDB components used in a child
or a parent Job that is called via tRunJob
cannot reuse this configuration.

This component, along with the Spark Batch component Palette it belongs to, appears only
when you are creating a Spark Batch Job.

Note that in this documentation, unless otherwise
explicitly stated, a scenario presents only Standard Jobs,
that is to say traditional
Talend
data integration Jobs.

Spark Connection

You need to use the Spark Configuration tab in
the Run view to define the connection to a given
Spark cluster for the whole Job. In addition, since the Job expects its dependent jar
files for execution, you must specify the directory in the file system to which these
jar files are transferred so that Spark can access these files:

  • Yarn mode: when using Google
    Dataproc, specify a bucket in the Google Storage staging
    bucket
    field in the Spark
    configuration
    tab; when using other distributions, use a
    tHDFSConfiguration
    component to specify the directory.

  • Standalone mode: you need to choose
    the configuration component depending on the file system you are using, such
    as tHDFSConfiguration
    or tS3Configuration.

This connection is effective on a per-Job basis.

Related scenarios

For a scenario in which tMongoDBConfiguration is used,
see Writing and reading data from MongoDB using a Spark Batch Job.

tMongoDBConfiguration properties for Apache Spark Streaming

These properties are used to configure tMongoDBConfiguration running in the Spark Streaming Job framework.

The Spark Streaming
tMongoDBConfiguration component belongs to families.

The component in this framework is available only if you have subscribed to Talend Real-time Big Data Platform or Talend Data
Fabric.

Basic settings

Property type

Either Built-In or Repository.

Built-In: No property data stored centrally.

Repository: Select the repository file where the
properties are stored.

DB Version

Select the version of the MongDB database you need to connect to.

Use replica set address or multiple query
routers

Select this check box to show the Server
addresses
table.

In the Server addresses
table, define the sharded MongoDB databases or the MongoDB replica sets
you want to connect to.

Server and Port

Enter the IP address and listening port of the database
server.

Available when the Use replica set
address or multiple query routers
check box is not
selected.

Database

Enter the name of the MongoDB database to be connected to.

Use SSL connection

Select this check box to enable the SSL or TLS encrypted connection.

Then you need to use the tSetKeystore
component in the same Job to specify the encryption information.

In addition, set the spark.executor.extraJavaOptions
property in the Advanced properties table in the
Spark configuration tab of the Run view. For
example:
This
property sets the same parameters as tSetKeystore does for the Spark executors, so you can copy the
values from tSetKeystore, Furthermore, you must
deploy the keystore on all worker nodes at the exact same location. In the example
above, it is /tmp/keystore.jks.

For further information about tSetKeystore, see tSetKeystore.

Note that the SSL connection is available only for the version 2.4 + of
MongoDB.

Use authentication

If the MongoDB database to be used requires authentication, select this check box
to enable the database authentication.

Among the mechanisms listed on the Authentication mechanism
drop-down list, the NEGOTIATE one is recommended if
you are not using Kerberos, because it automatically select the authentication mechanism
the most adapted to the MongoDB version you are using.

For details about the other mechanisms in this list, see MongoDB Authentication from the MongoDB
documentation.

Set Authentication database

If the username to be used to connect to MongoDB has been created in a specific
Authentication database of MongoDB, select this check box to enter the name of this
Authentication database in the Authentication database
field that is displayed.

For further information about the MongoDB Authentication database, see User Authentication database.

Username and Password

DB user authentication data.

To enter the password, click the […] button next to the
password field, and then in the pop-up dialog box enter the password between double quotes
and click OK to save the settings.

Available when the Use authentication
check box is selected.

If the security system you have selected from the Authentication mechanism drop-down list is Kerberos, you need to
enter the User principal, the Realm and the KDC
server
fields instead of the Username and the Password
fields.

Advanced settings

Connection string options

You can define more properties in this table for the connection to MongoDB,
in addition to the properties defined in the Basic
settings
tab.

For example, you can add the following option to specify a timeout value
for this connection.

For further information about the options you can add in this table, see
Connection options.

Usage

Usage rule

This component is used with no need to be connected to other components.

The configuration in a tMongoDBConfiguration component applies only on the MongoDB related
components in the same Job. In other words, the MongoDB components used in a child
or a parent Job that is called via tRunJob
cannot reuse this configuration.

This component, along with the Spark Streaming component Palette it belongs to, appears
only when you are creating a Spark Streaming Job.

Note that in this documentation, unless otherwise explicitly stated, a scenario presents
only Standard Jobs, that is to say traditional
Talend
data
integration Jobs.

Spark Connection

You need to use the Spark Configuration tab in
the Run view to define the connection to a given
Spark cluster for the whole Job. In addition, since the Job expects its dependent jar
files for execution, you must specify the directory in the file system to which these
jar files are transferred so that Spark can access these files:

  • Yarn mode: when using Google
    Dataproc, specify a bucket in the Google Storage staging
    bucket
    field in the Spark
    configuration
    tab; when using other distributions, use a
    tHDFSConfiguration
    component to specify the directory.

  • Standalone mode: you need to choose
    the configuration component depending on the file system you are using, such
    as tHDFSConfiguration
    or tS3Configuration.

This connection is effective on a per-Job basis.

Related scenarios

For a scenario in which tMongoDBConfiguration is used,
see Reading and writing data in MongoDB using a Spark Streaming Job.


Document get from Talend https://help.talend.com
Thank you for watching.
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x