Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt
Code Block
languagexml
firstline78
linenumberstrue
  <!-- noSql database provider for the 4.0 connector framework -->
  <noSQLConnectionProvider sslEnabled="false" sslInvalidHostNameAllowed="false">
    <implementation>com.searchtechnologiesaccenture.aspire:aspire-mongodb-provider</implementation>
    <servers>mongodb-host:27017</servers>
  </noSQLConnecitonProvider>noSQLConnectionProvider>

Aspire will create one MongoDB database for each content source configured. When the content source is deleted, the database will be dropped. The database name will the taken from the normalised value of the content source name. Starting in Aspire 4.0, the database names will be prefixed with "aspireas-" to avoid possible conflicts of name. If you wish to change the prefix, add a "namespace" to the configuration:

...

languagexml
firstline78
linenumberstrue

...

 

Anchor
Connect+to+a+Multi-node+MongoDB+Installation
Connect+to+a+Multi-node+MongoDB+Installation

...

Code Block
languagexml
firstline78
linenumberstrue
  <!-- noSql database provider for the 4.0 connector framework -->
  <noSQLConnectionProvider sslEnabled="false" sslInvalidHostNameAllowed="false">
    <implementation>com.searchtechnologiesaccenture.aspire:aspire-mongodb-provider</implementation>
    <servers>mongodb-host1:27017,mongodb-host2:27017,mongodb-host3:27017,mongodb-host4:27017</servers>
  </noSQLConnecitonProvider>noSQLConnectionProvider>

Using TLS/SSL

If you need to connect to a MongoDB configured to Use TLS/SSL you need to set the following attributes into the noSQLConnectionProvider tag:

...

After importing it into a truststore you need to add it into the Aspire startup script, read Crawling via HTTPs for more instructions on how to add the truststore into the startup script.

Retries Settings

The Provider will automatically retry the operations in case they couldn't be completed because of connections errors. The maximum retries to execute is configurable using the "maxRetries" option. By default (if nothing is provided), it will not retry operations at all.

Code Block
languagexml
firstline78
linenumberstrue
  <!-- noSql database provider for the 4.0 connector framework -->
  <noSQLConnectionProvider sslEnabled="false" sslInvalidHostNameAllowed="false">
    <implementation>com.accenture.aspire:aspire-mongodb-provider</implementation>
    <servers>mongodb-host:27017</servers>
	<maxRetries>5</maxRetries>
  </noSQLConnectionProvider>

MongoDB Authentication

Aspire 4.0 supports authenticating to MongoDB using X.509 or SCRAM. Based on the requirement will be necessary modify the settings.xml file.

...

SCRAM Authentication

Aspire 4.0 supports authenticating to MongoDB using SCRAM.

...

Code Block
languagexml
firstline72
titlesettings.xml
linenumberstrue
<!-- noSql database provider for the 3.0 connector framework -->
  <noSQLConnectionProvider sslEnabled="truefalse" sslInvalidHostNameAllowed="false">
    <implementation>com.searchtechnologiesaccenture.aspire:aspire-mongodb-provider</implementation>
    <servers>mongodb-host:27017</servers>
    <authentication>       
  		<scram>
			<username>aspireUser</username>
			<source>admin</source>
			<password>encrypted:302B58140B6ED1FBEBDC33A9263EF742</password>
		</scram>     
  	</authentication>     
  </noSQLConnecitonProvider>noSQLConnectionProvider>

MongoDB provider will verify the supplied user credentials against:

...

Code Block
languagebash
titlemongo.exe
> use admin
> db.getUser("aspireAdmin");
  {
    "_id_": "admin.myUserAdmin",
    "user": "myUserAdmin",
    "db": "admin",
    "roles": [ 
        {    
          "role": "clusterAdmin", 
          "db"": "admin" 
        },
        {
          "role": "readWriteAnyDatabase", 
          "db": "admin" 
        }
     ]
  }
> 


Enable

...

Scram Authentication in MongoDB

  1. Start MongoDB without access control
    $ mongod.exe --port 27017

  2. Connect a mongo shell to the instance.
    $ mongo.exe  --port 27017

  3. Create the user administrator: The database where you create the user (in this example, admin) is the user’s authentication database. For Aspire requirements, create the user with the roles: clusterAdmin and readWriteAnyDatabase.
Code Block
languagepowershellbash
titlemongo.exe
> use admin
> db.createUser(
  { 
	user: "myUserAdmin",
	pwd: "abc123",   
	roles: [
    	    { role: "clusterAdmin", db: "admin" },
        	{ role: "readWriteAnyDatabase", db: "admin" }
	     	]
  		}
	)

...

    1. Instance with access control.
      $mongod.exe  --auth –port 27017
    2. Re-start the MongoDB using configuration file. MongoDB configuration files use the YAML format.  Adding security.authorization:enable
      $ mongod --config /etc/mongod.conf

                Configuration Example

Code Block
languagepowershell
titleConfiguration Example
systemLog:
   destination: file
   path: "/var/log/mongodb/mongod.log"
   logAppend: true
storage:

...

Code Block
languagexml
firstline78
linenumberstrue
  <!-- noSql database provider for the 4.0 connector framework -->
  <noSQLConnectionProvider sslEnabled="true" sslInvalidHostNameAllowed="false">
    <implementation>com.searchtechnologiesaccenture.aspire:aspire-mongodb-provider</implementation>
    <servers>mongodb-host:27017</servers>
    <x509username>CN=user,OU=OrgUnit,O=myOrg</x509username>
  </noSQLConnecitonProvider>noSQLConnectionProvider>

If you don't know what to use into the <x509username> field execute the following command using the x509 client certificate:

...

Code Block
languagexml
firstline78
linenumberstrue
  <!-- noSql database provider for the 4.0 connector framework -->
  <noSQLConnectionProvider sslEnabled="false" sslInvalidHostNameAllowed="false">
    <implementation>com.searchtechnologiesaccenture.aspire:aspire-mongodb-provider</implementation>
    <servers>mongodb-host:27017</servers>
    <encryptFields>
      <field>_id</field> <!-- Encrypts all the IDs -->
      <field>url</field> <!-- Encrypts the url fields -->
      <field>fetchUrl</field> 
      <field>parentId</field> 
    </encryptFields>
  </noSQLConnecitonProvider>noSQLConnectionProvider>