Database installation
MongoDB
This page contains information on installing and configuring MongoDB to be used with Step.
Supported version
We do support MongoDB version starting from 4.0.x up to 5.0.x.
Installation
Follow instructions at : MongoDB documentation
Configuration
If you want to tune your MongoDB instance, you will find all necessary information on the official website at : MongoDB configuration and maintenance.
Activate authentication (optional)
For activating the authentication between the controller and the MongoDB server, the following actions have to be taken:
- Start the MongoDB server without authentication (use the --noauth option upon startup)
- Create your user on the Step database:
use step; db.createUser({ user: "[myUser]", pwd: "[myPassword]", roles: [{ role: "dbOwner", db: "step"}]})
- Restart the MongoDB server with authentication enabled (add the --auth option to the startup script)
- Add the following properties to the …/conf/step.properties file:
db.username=[myUser] db.password=[myPassword]
Installation as a Service (optional, Windows only)
In order to install MongoDB as a Windows service, follow below steps :
- download nssm at https://nssm.cc/download
- open a new command prompt as Administrator and navigate to the nssm executable location
- execute the following command :
nssm install
- nssm GUI will open, you can now specify the “startMongo.bat” location (usually located into the Controller bin folder) and the service name, then click on “Install service” :
- You should then be prompted that the service installation has been successful :
- you can double-check into Windows service list that the service has been properly installed and then you can start it :
PostgreSQL
PostgreSQL can be used as an alternative to MongoDB. To do so you will need to modify the configuration of the database in the step.properties on the Step controller.
Supported version
We support PostgreSQL version 12.
Installation
Please refer to the official documentation for installation instruction.
Configuration
Remove the configuration for MongoDB:
# Configuration of the MongoDB data source
datasource.mongo.type=step.core.collections.mongodb.MongoDBCollectionFactory
# Defines the MongoDB data source as default data source
datasource.mongo.collections=all
datasource.mongo.properties.host=127.0.0.1
datasource.mongo.properties.port=27017
# The authentication user of the MongoDB database
#datasource.mongo.properties.user=user
#datasource.mongo.properties.password=password
# The name of the MongoDB database
datasource.mongo.properties.database=step
# The maximum number of connections to the MongoDB
datasource.mongo.properties.minConnections=10
datasource.mongo.properties.maxConnections=200
Replace it by the PostgreSQL configuration and adapt it to your needs:
datasource.postgresql.type=step.core.collections.postgresql.PostgreSQLCollectionFactory
datasource.postgresql.collections=all
datasource.postgresql.properties.jdbcUrl=jdbc:postgresql://localhost/step
datasource.postgresql.properties.user=postgres
datasource.postgresql.properties.password=<password>
datasource.postgresql.properties.maxConnections=50