MongoDB is a NoSQL database that can be used both for storing configuration and sessions. You need to install Perl MongoDB module to be able to use this backend.
Tip
MongoDB has officially deprecated the Perl driver, so we advice to choose another backend
For Debian, you can install mongodb module with:
apt install libmongodb-perl
For CentOS:
yum install perl-MongoDB
See how to change configuration backend to change your configuration database.
To use a MongoDB backend, configure your lemonldap-ng.ini file (section configuration) :
Example :
[configuration]
type = MongoDB
dbName = llConfDB
collectionName = configuration
; using a single server
host = 127.0.0.1:27017
; using a replicaSet
; host = mongodb://mongo1.example.com,mongo2.example.com/?replicaSet=myset
ssl = 1
; authentication parameters
db_name = admin
user = lluser
password = llpassword
Optional parameters (see MongoDB::MongoClient man page) | ||
---|---|---|
Name | Comment | Example |
db_name | Admin database (default: admin) | admin |
auth_mechanism | Authentication mechanism | PLAIN |
auth_mechanism_properties | ||
connect_timeout | Connection timeout | 10000 |
ssl | Boolean or hash ref (default: 0) | 1 |
username | Username to use to connect | lluser |
password | Password | llpassword |
Just some commands needed to create collection and user:
$ mongo
connecting to: test
> use configuration
switched to db configuration
> db.createCollection("configuration")
...
> db.createUser({user:"lluser",pwd:"llpassword",roles:["readWrite"]})
...
> exit
bye
$