[Support] jasonbean - MongoDB


Recommended Posts

  • 2 months later...
  • 1 month later...
On 5/20/2023 at 3:36 AM, Denocyte said:

Hello, How do I enable authorization?

Editing `mongod.conf.orig` or creating new `mongod.conf` doesn't help.


1. Open a terminal and create the mongodb folder
- mkdir /mnt/user/appdata/mongodb
 

2. Change directory
- cd /mnt/user/appdata/mongodb
 

3. Create key file mongodb.key (mongodb will use it for authorization)
- openssl rand -base64 741 > mongodb.key
- chmod 600 mongodb.key

Step 3 is how you create the key and then in your mongod.conf file you need to add the below if you don't already have it:

 

security:
  authorization: "enabled"
  keyFile: /data/db/mongodb.key

Link to comment
  • 1 month later...

My MongDB container no longer stays running. This started after a recent update, but no other action taken or config changes. I see the following in the logs:

 

{"t":{"$date":"2023-08-23T08:35:12.363-05:00"},"s":"F",  "c":"CONTROL",  "id":20573,   "ctx":"initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"5.0\" }. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '5.0'; expected '6.0' or '6.3' or '7.0'. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 6.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/6.0/#upgrade-procedures."}}

 

Does anyone know how to solve this issue?

Link to comment

I just encountered the same problem with the same error:


{"t":{"$date":"2023-08-23T23:31:04.280+02:00"},"s":"F",  "c":"CONTROL",  "id":20573,   "ctx":"initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"5.0\" }. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '5.0'; expected '6.0' or '6.3' or '7.0'. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 6.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/6.0/#upgrade-procedures."}}

 

I did a quick google and followed some links but no solution was found.

Link to comment
On 8/23/2023 at 10:17 PM, guipace said:

My MongDB container no longer stays running. This started after a recent update, but no other action taken or config changes. I see the following in the logs:

 

{"t":{"$date":"2023-08-23T08:35:12.363-05:00"},"s":"F",  "c":"CONTROL",  "id":20573,   "ctx":"initandlisten","msg":"Wrong mongod version","attr":{"error":"UPGRADE PROBLEM: Found an invalid featureCompatibilityVersion document (ERROR: Location4926900: Invalid featureCompatibilityVersion document in admin.system.version: { _id: \"featureCompatibilityVersion\", version: \"5.0\" }. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility. :: caused by :: Invalid feature compatibility version value '5.0'; expected '6.0' or '6.3' or '7.0'. See https://docs.mongodb.com/master/release-notes/6.0-compatibility/#feature-compatibility.). If the current featureCompatibilityVersion is below 6.0, see the documentation on upgrading at https://docs.mongodb.com/master/release-notes/6.0/#upgrade-procedures."}}

 

Does anyone know how to solve this issue?

Same for me. set mine to Repository = mongo:5.0 back up and running. 

Link to comment

I installed the official MongoDB app through unraid and it uses Mongo 7 (no option to select a version from the deployment page). 

 

With regards to starting with authentication required, it took me longer than I care to admit, that there are two important environment variables missing that you have to manually add when deploying the docker app:

MONGO_INITDB_ROOT_USERNAME

MONGO_INITDB_ROOT_PASSWORD

 

Without those, it will not start mongodb with --auth. However, once you add those (and set them) it works as expected, no further modifications needed.

Link to comment
  • 4 weeks later...

 Hello,

since a few days I have problems with Rocket Chat and MongoDB. Perhaps you can help me further.

I updated the two Dockers and since then MongoDB no longer starts with the following error message:

Unrecognized option: storage.journal.enabled
try 'mongod --help' for more information

Unfortunately I can not find a solution to start the database again.

Thank you in advance.

Link to comment
On 8/30/2023 at 10:50 AM, simplysuperc said:

I installed the official MongoDB app through unraid and it uses Mongo 7 (no option to select a version from the deployment page). 

 

With regards to starting with authentication required, it took me longer than I care to admit, that there are two important environment variables missing that you have to manually add when deploying the docker app:

MONGO_INITDB_ROOT_USERNAME

MONGO_INITDB_ROOT_PASSWORD

 

Without those, it will not start mongodb with --auth. However, once you add those (and set them) it works as expected, no further modifications needed.

 

was there anything else you needed to do? It looks like the lastest docker image includes those variables.  But adding the mongo --auth # still doesnt work for me?

Link to comment
On 9/24/2023 at 9:41 AM, i-B4se said:

 Hello,

since a few days I have problems with Rocket Chat and MongoDB. Perhaps you can help me further.

I updated the two Dockers and since then MongoDB no longer starts with the following error message:

Unrecognized option: storage.journal.enabled
try 'mongod --help' for more information

Unfortunately I can not find a solution to start the database again.

Thank you in advance.

Does no one have an idea what this could be? 😅

Link to comment
On 9/29/2023 at 5:03 PM, i-B4se said:

Does no one have an idea what this could be? 😅

according to this info https://www.mongodb.com/docs/manual/core/journaling/ journaling is automatic now in the latest versions so there is no need to manually enabling it in .conf file

therefore you have to change the file appdata\mongodb\mongod.conf and remove the lines:

journal:
enabled: true

or put # in front, like so:

# journal:
# enabled: true

it worked for me, hopefully will work for you too. cheers

Link to comment
  • 4 weeks later...

I am trying to get the unifi-network-application docker from Linuxserver running. It requires MongoDB running externally so I have also installed this docker. Unfortunately when I start the UNA docker I get an error- 

Defined MONGO_HOST is not reachable, cannot proceed

This probably indicates that I have the wrong value for the MONGO_HOST variable defined in the UNA docker but I don't know how to determine the correct value.

 

MongoDB docker run

docker run
  -d
  --name='MongoDB'
  --net='unifi'
  -e TZ="America/New_York"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Brunnhilde"
  -e HOST_CONTAINERNAME="MongoDB"
  -e 'MONGO_INITDB_ROOT_USERNAME'='unifi'
  -e 'MONGO_INITDB_ROOT_PASSWORD'='password'
  -e 'MONGO_INITDB_DATABASE'='unifi'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/jason-bean/docker-templates/master/jasonbean-repo/mongo.sh-600x600.png'
  -p '27017:27017/tcp'
  -v '/mnt/user/appdata/mongodb/':'/data/db':'rw' 'mongo:4.4.25'
27d1cb80431f39864d8c72479b155efbb0ca5e554f0b4b7cd87ed47c85358e0a

The command finished successfully!

 

unifi-network-application docker run

docker run
  -d
  --name='unifi-network-application'
  --net='unifi'
  -e TZ="America/New_York"
  -e HOST_OS="Unraid"
  -e HOST_HOSTNAME="Brunnhilde"
  -e HOST_CONTAINERNAME="unifi-network-application"
  -e 'MONGO_USER'='unifi'
  -e 'MONGO_PASS'='password'
  -e 'MONGO_HOST'='unifi-db'
  -e 'MONGO_PORT'='27017'
  -e 'MONGO_DBNAME'='unifi'
  -e 'MEM_LIMIT'='1024'
  -e 'MEM_STARTUP'='1024'
  -e 'MONGO_TLS'=''
  -e 'MONGO_AUTHSOURCE'=''
  -e 'PUID'='99'
  -e 'PGID'='100'
  -e 'UMASK'='022'
  -l net.unraid.docker.managed=dockerman
  -l net.unraid.docker.icon='https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/unifi-network-application-icon.png'
  -p '8443:8443/tcp'
  -p '3478:3478/udp'
  -p '10001:10001/udp'
  -p '8080:8080/tcp'
  -p '1900:1900/udp'
  -p '8843:8843/tcp'
  -p '8880:8880/tcp'
  -p '6789:6789/tcp'
  -p '5514:5514/udp'
  -v '/mnt/cache/appdata/unifi-network-application':'/config':'rw' 'lscr.io/linuxserver/unifi-network-application'
11418dad9c98efa345f75bd91d63abd411d69a4620d9c3e3f2d6bead7156e3bd

The command finished successfully!

 

Hoping someone here can help with getting the UNA docker connected to this one.

  • Upvote 1
Link to comment
  • 3 months later...

Guys I'm having trouble understanding this vs. MariaDB.

I'm not expert but I have a fundamental understanding on MySQL and MariaDB.

 

I also use Adminer to admin MariaDB.

 

The thing I don't understand is in MariaDB, I create different databases for different things such as Fireflly3 and SpeedtestTracker.  

Each one gets their own database within the MariaDB container. I can also create users, etc.

 

But with my initial look into MondoDB, I'm not really seeing that it works the same way.  

Do you not "log into" MondoDB and then create different databses (with their own unique names)?

 

I tried to get into MondoDB from Adminer but it told me 

None Of The Supported PHP Extensions (Mongo, Mongodb) Are Available.

 

I have Graylog installed and I believe that's using MongoDB, I'm just not exactly sure how haha

 

Thanks for any info guys! Ultimately I wanna get in there and create separate databases so it's nice and clean.

Link to comment
17 hours ago, DevanteWeary said:

Ultimately I wanna get in there and create separate databases so it's nice and clean.

I get what you want to do, but there are good reasons to not do it that way.

 

Multiple separate containers have advantages, if one database gets messed up you can blow it away and redo it without disturbing the others. There is no extra storage penalty for multiple identical containers, the program parts all share the same data layers, the only extra storage for each additional container is the data and custom configuration, very close to the total of one container with all your databases anyway.

 

The only extra work is keeping track of the names and ports, but that's minor compared to the extra work of fixing one bad database while keeping the rest running in a single container.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.