Homebrew is MacOSX only command line installer application and it doesn't exist for Windows. The Windows alternatives are: Chocolatey. OneGet for Windows 10.
Active5 days ago
How can I install mongodb 2.6 with homebrew?
Here is what I am trying:
ddddqddddq
1 Answer
MongoDB 2.6 was released in March, 2014 and reached end of life in October, 2016. It is no longer available via Homebrew or supported by MongoDB, but if you really require this release series you can download the 2.6.12 OS X tarball from the MongoDB archives.
End of life server releases will not receive any maintenance or security updates, and will also end up removed from driver and tool compatibility testing. I would strongly recommend installing a later supported version of MongoDB (ideally 3.4 or newer so you won't have to do a major version upgrade for a while). There have been a large number of improvements and fixes in successive releases, including a new default storage engine (WiredTiger), new aggregation & security features, document validation, and rewritten command line tools.
FYI, you can check available versions in Homebrew with
brew search mongodb@
:$ brew search mongodb@
> Searching local taps...
StennieStennie
Not the answer you're looking for? Browse other questions tagged installationhomebrewversionmongodb or ask your own question.
Active8 months ago
Is it possible to install both mongodb 2.6 and 3.2 on the same Mac? I’ve been using mongodb 3.2 (Installed with homebrew) for a while but needed to install 2.6 to support an older project. I used
brew install homebrew/versions/mongodb26
and got some issues with conflicting files, which I could sort out later.But if I try to start mongod, by running
/usr/local/Cellar/mongodb/3.2.10/bin/mongod
I get the error 2016-11-15T14:26:08.132+0000 [initandlisten] exception in initAndListen: 28574 Cannot start server. Detected data files in /data/db created by storage engine 'wiredTiger'. The configured storage engine is 'mmapv1'., terminating
.I’ve also lost my database for 3.2, which appears to have been overwritten while installing 2.6.
Has anyone got this working?
Geraint AndersonGeraint Anderson
3 Answers
It is possible to install mongodb 2.x and 3.x at the same time - you have to rename some files and folders and modify config and plist files though. This will separate the old and the new MongoDB executables/config and the databases:
- Uninstall any mongodb install in brew
- Tap brew versions with
brew tap homebrew/versions
- Install mongodb 2.6.12 with
brew install mongodb26
- Rename all fourteen 'mongodb26' soft links in /usr/local/bin (e.g. bsondump to bsondump2, mongo to mongo2 etc)
- Rename /usr/local/etc/mongod.conf to /usr/local/etc/mongod2.conf
- Rename /usr/local/var/mongodb to /usr/local/var/mongodb2
- Rename /usr/local/var/log/mongodb to /usr/local/var/log/mongodb2
- Modify /usr/local/etc/mongod2.conf to reflect the changes above (path and dbpath) and a different port in the net section (e.g. port: 37017)
- Modify /usr/local/Cellar/mongodb26/2.6.12/homebrew.mxcl.mongodb26.plist to reflect the changes above (log directories and config file)
- Install mongodb
brew install mongodb
. This is MongoDB 3
MongoDB 3 will be installed with the default file and folder names then. If MongoDB 2 should be your 'default' Mongo DB, install mongodb first and rename everything to *3 (instead of *2). Then install mongodb26 with brew.
Depending on your needs copy the plists to your LaunchAgents folder, if you want to launch either mongodb version while logging in:
and load both plists:
Both mongo daemons should run independently from each other at the same time (at least in my testing VM they did).
If you want to start either mongod manually don't forget to use the renamed mongod command and config file:
klanomath![Mongodb Mongodb](/uploads/1/2/5/6/125689054/658197909.jpg)
51.4k77 gold badges7676 silver badges144144 bronze badges
![Brew Brew](/uploads/1/2/5/6/125689054/818763413.png)
I know this is an old question but I was looking for a way to have version 4.x and 3.x and found this to be the easiest solution.
Install the versions of MongoDB you want with brew
.
You can find which versions are available with
brew search mongo
. If you don't see the version you want run brew update
. I'm installing the latest version (4) and version 3.6:Start the version you want with brew service
Switch to a different version:
- Make sure you are backwards compatible:
mongo --eval 'db.adminCommand({setFeatureCompatibilityVersion: '3.6'})'
- Stop
mongod
:brew services stop mongodb
- Unlink the current version of MongoDB:
brew unlink mongodb
- Link the new version of MongoDB:
brew link --force [email protected]
- Start MongoDB version 3.6:
brew services start [email protected]
- Check your version:
mongo --version
jwerrejwerre
this could be the need to create another folder(ex: mongodb2) dbpath for the second instance, and run it in different port(ex: 27018)
originally found on https://stackoverflow.com/questions/15124610/multiple-instances-of-mongo-db-on-same-server
Community♦
bret7600bret7600