Taddeusz Posted February 15, 2017 Share Posted February 15, 2017 This template can be found at: https://github.com/jason-bean/template-mongodb This is a template for the official MongoDB docker container. This template exposes port 27017 so that remote connections are possible. What is MongoDB? MongoDB (from "humongous") is a cross-platform document-oriented database. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas (MongoDB calls the format BSON), making the integration of data in certain types of applications easier and faster. Released under a combination of the GNU Affero General Public License and the Apache License, MongoDB is free and open-source software. Quote Link to comment
s34nDROID Posted February 11, 2018 Share Posted February 11, 2018 How do I start with --auth or is it on by default? Quote Link to comment
Taddeusz Posted February 11, 2018 Author Share Posted February 11, 2018 I honestly have no idea. I just created the template for the official Mongo Docker. You can try the instructions for the docker here: https://hub.docker.com/_/mongo/ Quote Link to comment
mazice Posted March 15, 2018 Share Posted March 15, 2018 On 10/2/2018 at 9:53 PM, s34nDROID said: How do I start with --auth or is it on by default? It's not on by default. You can do it by editing the container, enabling Advanced view, and setting the extra parameters field like so: mongo --auth # 1 Quote Link to comment
sansoo22 Posted August 30, 2019 Share Posted August 30, 2019 (edited) Posting my procedure steps to upgrade mongoDB image from 3.6 to 4.0/4.2 because it was a pain to figure out. Before you begin it is highly recommended to open a terminal window to your current mongodb instance and run... mongod --version Write that version number down somewhere. Mine was 3.6.14 and corresponds with a docker image tag if this whole process goes tits up and you need to revert. Backup your old mongodb volume Open a terminal into unRAID Run the following command assuming you have a cache drive. If not modify your path to wherever your appdata is stored cp -avr /usr/mnt/appdata/mongodb /usr/mnt/appdata/mongodb-bak Mount a new volume to your current MongoDB container: create a new directory in /usr/mnt/cache/appdata called mongodb-temp open your containers configuration click the + to add new path, variable, etc Fill out the form as follows and click add Save your docker configuration Dump current mongodb database to temp directory These next steps assume your mongodb instance is running on the default port and you mounted a volume named temp. Open a terminal window to your mongodb container Run the following command mongodump -v --host localhost:27017 --out=/temp The -v flag is for verbose so you should see a bunch of stuff scroll by and when its done it should report successful on the last line printed in the terminal. Upgrading MongoDB!!! This next step can be done one of two ways. The first method is nuke your current container and install brand new. The second method requires you have the "Enable Reinstall Default" setting set to "Yes" in your Community Application Settings. This write up will not cover turning that setting on. Upgrade Option 1: Open the mongodb container menu and choose remove Un-check "also remove image" Click Yes and watch it go bye-bye a. Delete the contents of your old /appdata/mongodb directory Go to Community Apps and re-install MongoDB Remember to add the /temp path to this new container just like in the screen shot above Skip down to Restoring Mongodb data Upgrade Option 2: This is the one I chose to use because it left my old mongodb instance completely intact Shutdown your current Mongodb container With "Enable Reinstall Default" turned on in Community Apps go to your "Installed" apps page Click the first icon on the MongoDb listing to reinstall from default Be sure to CHANGE the NAME and HOST PATH 1 values to create a new duplicate container. And don't forget to remap the /temp volume so we can do the restore later. If using custom br0 feel free to use the same IP address since your other container is now dormant Click Apply to create the container Move on to Restoring Mongodb data Restoring Mongodb data Open a terminal window into your current running mongodb instance. Enter the following command mongorestore -v --host localhost:27017 /temp Assuming you mounted the volume named /temp and everything went ok you should see a giant list of stuff scroll by the terminal window. At the bottom will be a report of successful and failed imports You can now leave the /temp volume mapped for later use or remove it if you like I created this process for myself last night after attempting to upgrade from 3.6 to 4.2 and running into a pesky "Invalid feature compatibility version" error. You can read about that here. I tried all the steps in the mongo documentation but being installed in a docker made things a bit trickier. I found it easier just to backup, dump, recreate image, and restore my data. Edited August 30, 2019 by sansoo22 Quote Link to comment
docbrown Posted October 17, 2019 Share Posted October 17, 2019 On 8/31/2019 at 5:11 AM, sansoo22 said: Before you begin it is highly recommended to open a terminal window to your current mongodb instance and run... mongod --version I cannot even do this, the container shuts down almost straight away. Not sure how I can do the demo/restore without the container running. Quote Link to comment
tazire Posted December 4, 2020 Share Posted December 4, 2020 I have been using this with Rocket chat. but just in the last few days it has stopped working. I keep getting the following re occurring in the logs. {"t":{"$date":"2020-12-04T11:46:09.052+00:00"},"s":"I", "c":"STORAGE", "id":3856202, "ctx":"IndexBuildsCoordinatorMongod-2","msg":"'voteCommitIndexBuild' command failed.","attr":{"indexBuildUUID":{"uuid":{"$uuid":"7d0cfc2d-1a22-40fd-88fa-bc7740c41fd7"}},"responseStatus":{"operationTime":{"$timestamp":{"t":1607082359,"i":1}},"ok":0.0,"errmsg":"command voteCommitIndexBuild requires authentication","code":13,"codeName":"Unauthorized","$clusterTime":{"clusterTime":{"$timestamp":{"t":1607082359,"i":1}},"signature":{"hash":{"$binary":{"base64":"w16K3Ax9dNrRM28e4KL7aAJD+5Y=","subType":"0"}},"keyId":6861917765322670082}}}}} certain variables change but its the same over and over again. I have tried to delete the docker and image and reinstall but just goes back to the same thing. Rocket chat obviously wont start without it. Quote Link to comment
Taddeusz Posted December 5, 2020 Author Share Posted December 5, 2020 @tazire I'm not sure. I personally haven't actually used MongoDB in quite a while. All I did was create the template for Unraid. It just uses the publicly available Docker container from Docker Hub. When was the last time you updated your container? If it's not that it might be database corruption. Quote Link to comment
tazire Posted December 6, 2020 Share Posted December 6, 2020 yea if im honest i havent liked mongo at all. i use maria with my nextcloud and have found it rock solid. but ive been using this with rocketchat and its very flakey I had it corrupt on me in my early use. Then it seemed more stable so i deployed if for my use case and now this. im on the most recent build for it. i have left it stopped until the most recent build just to see if that solved my problem but it hasnt. thanks for getting back to me but looks like its a fresh install and hope for the best. Quote Link to comment
konaboy Posted December 11, 2020 Share Posted December 11, 2020 (edited) On 12/6/2020 at 7:58 AM, tazire said: yea if im honest i havent liked mongo at all. i use maria with my nextcloud and have found it rock solid. but ive been using this with rocketchat and its very flakey I had it corrupt on me in my early use. Then it seemed more stable so i deployed if for my use case and now this. im on the most recent build for it. i have left it stopped until the most recent build just to see if that solved my problem but it hasnt. thanks for getting back to me but looks like its a fresh install and hope for the best. I'm getting the same error you are - started this morning for me. I'm going to try going back a build and see if that helps. I've tried restoring the appdata mongodb folder from a day ago, and that didn't help. Found this over in the RocketChat thread - It worked for me. Edited December 11, 2020 by konaboy added link Quote Link to comment
tazire Posted December 11, 2020 Share Posted December 11, 2020 24 minutes ago, konaboy said: I'm getting the same error you are - started this morning for me. I'm going to try going back a build and see if that helps. I've tried restoring the appdata mongodb folder from a day ago, and that didn't help. Found this over in the RocketChat thread - It worked for me. cheers for the response. I have just started from scratch. Stopped using it completely for now and im looking into alternatives at this point. Quote Link to comment
konaboy Posted December 11, 2020 Share Posted December 11, 2020 18 minutes ago, tazire said: cheers for the response. I have just started from scratch. Stopped using it completely for now and im looking into alternatives at this point. I'm interested in an alternative too - Nextcloud (which I use for files) has a chat facility, but they don't have a windows app and I don't like chats in a browser. Let me know if you find a good alternative I'd appreciate!... Quote Link to comment
tazire Posted December 12, 2020 Share Posted December 12, 2020 On 12/11/2020 at 6:29 PM, konaboy said: I'm interested in an alternative too - Nextcloud (which I use for files) has a chat facility, but they don't have a windows app and I don't like chats in a browser. Let me know if you find a good alternative I'd appreciate!... i was looking at mattermost... i had a quick try to get it working but couldnt get it to connect to a database for whatever reason. Didnt spend alot of time with it though. I was thinking about nextcloud but i dont want to use my own nextcloud for my chat. TBH my ideal app would be a self hosted discord server. I really like all the features it has. Quote Link to comment
blaine07 Posted February 10, 2021 Share Posted February 10, 2021 Appears RC still works but anyone have any ideas on what this is in log? Quote Link to comment
blaine07 Posted February 10, 2021 Share Posted February 10, 2021 1 hour ago, blaine07 said: Appears RC still works but anyone have any ideas on what this is in log? For me this ended up being fix... Quote Link to comment
odiby Posted February 17, 2021 Share Posted February 17, 2021 (edited) Hi, I just updates to the latest version, all settings to default. Now the container does not start anymore. The log shows the message: BadValue: security.keyFile is required when authorization is enabled with replica sets try 'mongod --help' for more information How can I fix this. thx Edited February 17, 2021 by odiby Quote Link to comment
caseyparsons Posted February 17, 2021 Share Posted February 17, 2021 3 hours ago, odiby said: Hi, I just updates to the latest version, all settings to default. Now the container does not start anymore. The log shows the message: BadValue: security.keyFile is required when authorization is enabled with replica sets try 'mongod --help' for more information How can I fix this. thx Having the same problem after update. Quote Link to comment
Vesko Posted February 18, 2021 Share Posted February 18, 2021 (edited) Me too Mongod cant start anymore i try reinstall and same.I get error: BadValue: security.keyFile is required when authorization is enabled with replica sets try 'mongod --help' for more information Edited February 18, 2021 by Vesko Quote Link to comment
odiby Posted February 18, 2021 Share Posted February 18, 2021 OK 😅 even if I would understand what a Replica Set is and why I would need it ... as long as the server does not start, I guess i have no chance to do what ever needs to be done as mentioned here. So for now, I will stick to the version 4.4.3 1 Quote Link to comment
Vesko Posted February 18, 2021 Share Posted February 18, 2021 4 hours ago, odiby said: OK 😅 even if I would understand what a Replica Set is and why I would need it ... as long as the server does not start, I guess i have no chance to do what ever needs to be done as mentioned here. So for now, I will stick to the version 4.4.3 Thank you for the advice i reinstall with mongo:4.4.3 and now works i will never update if works like this. Dont see point to update until works normal .Updates brakes things:) Quote Link to comment
caseyparsons Posted February 18, 2021 Share Posted February 18, 2021 4 hours ago, Vesko said: Thank you for the advice i reinstall with mongo:4.4.3 and now works i will never update if works like this. Dont see point to update until works normal .Updates brakes things:) Hmm I tried this but didn't work for me. Just got new errors. This seems to be the important part: {"t":{"$date":"2021-02-18T12:35:47.675-05:00"},"s":"W", "c":"STORAGE", "id":22347, "ctx":"initandlisten","msg":"Failed to start up WiredTiger under any compatibility version. This may be due to an unsupported upgrade or downgrade."} Quote Link to comment
blaine07 Posted February 18, 2021 Share Posted February 18, 2021 This post/thread...Yall gonna have to skim and read around but they solve your issue; despite that it's about RocketChat. I successfully upgraded to 4.4.4. I do have a error every hour about some time crap but the DB itself works and etc. 🙂 https://forums.unraid.net/topic/61337-support-rocketchat/?do=findComment&comment=816403 You all WILL HAVE TO READ around to find exact post with info but in this "area" of thread you'll find conversation about the RS junk. Quote Link to comment
xPliZit_xs Posted February 20, 2021 Share Posted February 20, 2021 (edited) 2 hours ago, slimshizn said: That finally worked!! Make sure to spell "keyFile" with CAPITAL F Edited February 20, 2021 by xPliZit_xs Quote Link to comment
BTPBen Posted February 24, 2021 Share Posted February 24, 2021 Hey, wondering if anyone can help. My MongoDB docker might be installed to my cache and I want to ensure the database files are going to the array. I assume I could just create a share that doesn't use the cache then change the storage parameter in my mogod.conf to aim at a folder in that share. Then I would stop mongodb, move the *.wt files to the new share. storage: dbPath: journal: enabled: true would I just configure storage: dbPath: /mnt/user/<databaseshare>/<mongodb>/ journal: enabled: true Quote Link to comment
Recommended Posts
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.