MongoDB in place of the default H2 (no postgres)

Greetings-

How do I use MongoDB in place of the default H2 database? Is it recommended that each Nuxeo node in a cluster use a SINGLE shared database(mongodb in this context) instance, as well as another sql database (postgres or something else) instead of h2? How do I actually confirm that Nuxeo is infact using MongoDB in this instance and not h2.

I'm in the process of propping up AWS in a clustered, cross-az single region model. The cluster has 2 nodes in 3 AZ's netting 6 nodes. I've also stood up MongoDB in a primary, secondary, seconday relationship, also cross az with a single mongos in a given AZ. I've also enabled GridFS in nuxeo.conf for the MongoDB BLOB store. I've also stood up an AWS ElasticCache (redis 2.8.23) also single node in a given AZ spanning the same 3 AZ's above.

I've confirmed that the nuxeo hosts are in clustered mode, also using the redis cache by looking at the redis cache for KEYS nuxeo, and I can see the different nodeID's as well as various session stores. I've also confirmed that in MongoDB I can use the nuxeo database, and see nuxeo and other tables.

Below is the contents of the existing mongo cluster. You can see that GridFS is being used below because of default.fs.chunks and default.fs.files tables are listed.

mongos> use nuxeo
switched to db nuxeo
mongos> show tables
default
default.fs.chunks
default.fs.files
quartz_calendars
quartz_jobs
quartz_locks
quartz_schedulers
mongos>

I've been following the documentation https://doc.nuxeo.com/nxdoc/mongodb/. about enabling the MongoDB database and it says “You must keep the template corresponding to your SQL database in nuxeo.templates, because the SQL database is still used for other things (directories, audit, etc.). “

If I look at default-repository-config I even see my db settings amongst other important items.

<component name="default-repository-config">
  <extension target="org.nuxeo.ecm.core.blob.BlobManager" point="configuration">
    <blobprovider name="default">
      <class>org.nuxeo.ecm.core.storage.sql.S3BinaryManager</class>
      <property name="path">/opt/nuxeo</property>
      <property name="key"></property>
    </blobprovider>
  </extension>
  <extension target="org.nuxeo.ecm.core.storage.mongodb.MongoDBRepositoryService"
      point="repository">
    <repository name="default" label="label.default.repository">      
<server>mongodb://primarydb01.companydomain.internal,secondarydb01.companydomain.internal,secondarydb02.companydomain.internal/?maxPoolSize=200</server>
      <dbname>nuxeo</dbname>
      <fulltext disabled="false" searchDisabled="false" />
      <cache enabled="true" maxSize="1000" concurrencyLevel="10" ttl="10" />
      <clustering id="167773350" enabled="true">
        <invalidatorClass>org.nuxeo.ecm.core.redis.contribs.RedisDBSClusterInvalidator</invalidatorClass>
      </clustering>
    </repository>
  </extension>
</component>

When I log into the Nuxeo console and view the Admin page I can clearly see that the h2 db is still enabled(see attached screenshot). Where did I go wrong?

0 votes

1 answers

2940 views

ANSWER



Not that you haven't said what Nuxeo version you're using.

The Admin > System Information > Setup page attempts to show a synthetic view of the configuration but has not yet been extended to support showing MongoDB configuration. What you're seeing displayed is the h2 configuration still needed as described in the doc you point out (the SQL database is still used for other things (directories, audit, etc.)). The MongoDB configuration is missing from this screen, although you'll see it if you click the “Advanced Setup” button.

Note that h2 is not supported for cluster mode or production mode. You must configure Nuxeo to use PostgreSQL or another database instead.

0 votes



Thank you for the response. Am I correct in the assertion that PostgresSQL or some other database is needed in addition to MongoDB?

I guess I'm confused as I would have thought that nuxeo would be able to store its directories, audit and others in the MongoDB cluster.

To that point, I've been reading on how to use elasticsearch for the audit stuff so thats one less thing that is needed in the SQL store…

Thanks for clarifying!

03/27/2017

Yes, PostgresSQL or some other database is still needed in addition to MongoDB. That's what the sentence because the SQL database is still used for other things (directories, audit, etc.) intends to explain. We're working on this and Nuxeo Fast Track 9.1 will improve this.
03/27/2017

Thank you!
03/28/2017