Overview
Remote Manager can operate with relational and document databases. As of Remote Manager 7.0, the System can be integrated with MongoDB database. Integration with MongoDB is not a complete substitution of the RDBMS usage. Instead, the System must be configured with both – RDBMS and MongoDB, where the MongoDB will only handle a certain critical part of the device management data, more specially the Device Tree data and the generic Control Units system storage as described here:
Configuration of the Remote Manager system with MongoDB is expected to bring performance boost for scenarios involving
- OSGi device management with intensive use of Client Control Units and Functional Items;
- mobile device management;
- any custom device management relying on the generic Control Units storage.
Database setup
- Install the MongoDB database
- Connect to the MongoDB instance as admin user and create read and readWrite users for the Remote Manager:
- Execute from the MongoDB console the following commands to create Read and Write user
db.createUser( { "user" : "<ReadWriteUserName>", "pwd" : "<ReadWriteUserDBPASS>", "roles" : [ { "role" : "readWrite", "db" : "<DB_NAME>" } ]}); - Execute from the MongoDB console the following commands to create Read only user
db.createUser( { "user" : "<ReadOnlyUser>", "pwd" : "<ReadOnlyUserDBPASS>", "roles" : [ { "role" : "read", "db" : "<DB_NAME>" } ]}); - Create a file bin/mserver/scm.xml with the following example content. Note that it should provide the proper configuration for both – RDMS and MongoDB databases as well as for the system topology setup.
--- scm.xml ---<scmConfig> <version>1</version> <dbServers> <jdbcServer isSystemDatabase="true"> <dbServerName>System Database Server</dbServerName> <jdbcDriver>org.h2.Driver</jdbcDriver> <jdbcURL>jdbc:h2:h2db/mprm;DEFAULT_LOCK_TIMEOUT=30000</jdbcURL> <dbUserName>sa</dbUserName> <dbUserPassword></dbUserPassword> <readOnlyConnections>50</readOnlyConnections> <readWriteConnections>10</readWriteConnections> <cachedStatementsSize>100</cachedStatementsSize> </jdbcServer> <dbServer isSystemDatabase="false"> <dbServerName>CentralMongoDB</dbServerName> <dbServerType>mongodb</dbServerType> <properties> <property> <name>readWrite</name> <value>mongodb://rwUser:rw_DBPASS@MONGODB_IP:MONGODB_PORT/DB_NAME</value> </property> <property> <name>read</name> <value>mongodb://rUser:r_DBPASS@MONGODB_IP:MONGODB_PORT/DB_NAME</value> </property> </properties> </dbServer> </dbServers> <dbServices> <dbService> <dbServicePid>tree.mongodb</dbServicePid> <mongoServerName>CentralMongoDB</mongoServerName> </dbService> </dbServices> <backendServers> <managementServer> <id>ms</id> <context>ROOT</context> </managementServer> </backendServers></scmConfig>- Substitute the following:
- * DB_NAME with the name of the database.
- * rw_DBPASS with the password for the readWrite user.
- * r_DBPASS with the password for the read user.
- * MONGODB_IP with the network address of the MongoDB database.
Cleaning the database(s)It is very important to know that both – RDBS and MongoDB databases go always together and it is not possible to clean only one of the databases while keeping the other. There is some essential cross-db data which integrity should be preserved in terms that if you want to start from a clean database – both should be reset.
Migrating a Mongo Database from an Older Remote Manager Version
In order to migrate an older Mongo Database, for example from Remote Manager 7.0 to 7.0.1, please execute the following steps:
- Copy (and paste) the scm.xml file from the older RM version.
- Update its version as shown in the code snippet below:
<scmConfig> <version>1</version> <!--here change to higher version --> .........</scmConfig>