I have a problem with the abilitation of encryptio

Hi, I’m a Universitary student and for my thesis i go to study the encryption in MongoDB. According with the tutorial present in the manual. I create the local key but at the moment to start MongoDB, the service don’t start. I tried to update the mongod.conf but the service never start.

After the reboot of my computer the service start, but the encryption isn’t enable.

I’m using the following components:

  • MongoDB Enterprise v 5.0.5
  • Ubuntu 20.04 Focal Fossa.

This is the error:

This is my configuration file before modification

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1


# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

#security: 

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

This is after:

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
storage:
  dbPath: /var/lib/mongodb
  journal:
    enabled: true
#  engine:
#  wiredTiger:

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# network interfaces
net:
  port: 27017
  bindIp: 127.0.0.1


# how the process runs
processManagement:
  timeZoneInfo: /usr/share/zoneinfo

security: 
  authorization: enabled 
  enableEncryption: true
  encryptionKeyFile: /home/giuseppe/mongodb-keyfile

#operationProfiling:

#replication:

#sharding:

Thank you.

Hi @stupeppe,

Check if there are the correct permission for
/var/lib/mongodb
/var/log/mongodb/mongod.log
And for
mongodb-27017.sock
Usually the mongodb-27017.sock is in tmp, so:
/tmp/mongodb-27017.sock

Regards

1 Like

Welcome to the MongoDB Community Forums @stupeppe !

If the MongoDB service doesn’t start up as expected, the first place I’d check is the log file. The last lines in the log file should indicate a reason the instance was unable to start.

Regards,
Stennie

3 Likes

I everyone and thanks for the support.
I resolve my problem following the steps present in this guide: How To Configure Keyfile Authentication for MongoDB Replica Sets on Ubuntu 20.04 | DigitalOcean