This guide explains how to manage MongoDB configurations effectively using the Config Editor module in Elixir Ambience. It provides step-by-step instructions to define database connection settings, integrate them into the application configuration, and ensure proper functionality through server updates and log verification.
1. Log in to Ambience Web
Log in to the Elixir Ambience website. Upon successful login, the system redirects to the Service Chooser page.
2. Access the Config Editor Module
From the Service Chooser page, navigate to the Administration panel and select the Config Editor module.
3. Add MongoDB Configuration
In the Config Editor, perform the following steps to define your MongoDB settings:
Click Add and enter an appropriate name in the Section field.
Insert the following configuration snippet. Modify it to align with your application’s application.conf file:
elixir.data.mongodb {
# Edit "default" (you can change the name) to match your MongoDB server connection.
# The connection string can be encrypted using the {enc} syntax.
# Add a new key like "default" to define multiple MongoDB servers—the name is descriptive only.
mongo-data {
connectionString = "<MongoDB connectionString>"
database {
# Define database key=value pairs. Keys must be unique across all MongoDB connections.
# The value corresponds to the actual MongoDB database name.
# The alias (key) allows switching physical databases without modifying every caller.
ambience = "ambience"
}
}
4. Update the Application Configuration File
Ensure the application.conf file contains the following line to enable loading configurations from the Config Editor:
ambience.config-loader.mongodb.enabled = true
5. Restart the Server
Restart the server to apply the updated configurations.
6. Verify the Configuration in the Logs
After the server restarts, check the logs for messages confirming successful MongoDB setup. Example log entries include:
15:18:58.326 INFO ambience.etl.mongodb.ConnectionPool - Building mongo-data
15:18:58.328 INFO ambience.etl.mongodb.ConnectionPool - Client mongo-data created
15:18:58.328 INFO ambience.etl.mongodb.ConnectionPool - mongo-data: ambience->ambience
If these log entries appear, the configuration is successful and operational.