Skip to main content

Mongo Clustering in Simflofy

In contrast to a single-server MongoDB database, a MongoDB cluster allows a MongoDB database to either horizontally scale across many servers with sharding, or to replicate data ensuring high availability with MongoDB replica sets, therefore enhancing the overall performance and reliability of the MongoDB cluster.
More detail on Mongo Clusters


Configuring Simflofy for a MongoDB Cluster

  1. If you are using a MongoDB Cluster, you will need to list the replica sets using a (host):(port) configuration. Leave the mongo.db.host and mongo.db.port field empty. See the below sample configuration settings:
mongo.db.username=simflofy  
mongo.db.password=PASSWORD
mongo.db.host=
mongo.db.port=
mongo.db.dbname=simflofy
mongo.db.replica.set=(host1):(port),(host2):(port),(host3):(port)
warning

Remember to set your password using your organization's password policy.

caution

The master will be automatically determined. Be sure to leave the mongo.db.host and mongo.db.port fields empty.

  1. In root-context-dao.xml you will need to un-comment the "serverAsString" property:
   <bean name="simflongoConfig" class="com.simflofy.simflongo.connection.SimflongoConfig">
<property name="username" value="${mongo.db.username}" />
<property name="password" value="${mongo.db.password}" />
<property name="host" value="${mongo.db.host}" />
<property name="port" value="${mongo.db.port}" />
<property name="authMode" value="true" />
<!-- <property name="serversAsString" value="${mongo.db.replica.set}" /> -->
</bean>

Mongo DB Properties

Located: simflofy-admin/WEB-INF/classes/mongo_db.properties

  • mongo.db.username Username to authenticate with MongoDB.
  • mongo.db.password Password to authenticate with MongoDB.
  • mongo.db.host MongoDB host if running a single instance.
  • mongo.db.port MongoDB port if running a single instance.
  • mongo.db.dbname MongoDB database name.
  • mongo.db.replica.set Server port list (i.e. server1:port,server2:port) if running in replica mode.
  • simflofy.init.mongo.indexes Setting to true will drop all indexes and rebuild them when Simflofy Admin starts. This should be set to true when first installing and then set to false when done. Or set to true whenever there is a need to rebuild the indexes.

Related Articles:

Clustering Simflofy