How to decide which MongoDB binary to install on MacOS? - mongodb

The official documentation of MongoDB provides two commands for downloading binaries:
brew install mongodb
brew install mongodb --with-openssl
I want to know what are the differences between the two of them. Primarily, I would like to understand which binary should I download under what scenarios?

Recent versions of the MongoDB Homebrew recipe include SSL by default (which matches the default downloads from the MongoDB Download Center). The --with-openssl option has been removed and there is no longer a need to choose between versions. The MongoDB documentation will be updated to reflect this (see DOCS-10347).
Distributions with TLS/SSL support are recommended (even if you aren't currently using this feature) so you have the option available. Third party cloud-hosted services (eg. MongoDB Atlas) generally require network encryption, and this is also one of the recommendations in the MongoDB Security Checklist for protecting your own deployments.

Do you need TLS/SSL support?
If the answer is "no", use command 1.
If the answer is "I don't know", use command 1.
If the answer is "yes", use command 2.
Command 1 will download MongoDB pre-compiled binaries, that don't include TLS/SSL support. Command 2 will compile MongoDB source code with TLS/SSL support, which is useful if you want the communication between your application and MongoDB to be encrypted, or if you're trying to access a database that only accept encrypted connections.
Command 1 will be much faster than command 2 since it will only fetch binaries rather than compiling plenty of stuff.

Related

Mongodump from MongoDB 4 and Mongorestore to MongoDB 5

After reading this in the official Mongo Documentation: https://docs.mongodb.com/database-tools/mongorestore/#restore-to-matching-server-version
I‘m having doubts on how the best practice is in the following case.
Our old Server has Mongo 4 installed and our new Server is Running Mongo 5. Both Stand-alone installations.
I can‘t install or Update Mongo on the old Server.
Is there a way on how i can transfer my databases without having Datacorruption or Problems like the official Documentation talks about?
I know i have to use the —gzip tag, but that‘s about it.
Thanks for helping.
It is a recommendation to use the same verdion
Mongo tools are now separate package and had its own version.
restore is compatible with mongo 4 and 5.
dump also compatible with verdion 4 and 5.
But if there are some unsupported things in mongo 5 from mongo 4 which is used in your schema and queries, you would take a dump and give a try out in your prestaging environment.
And do not forget to read about the release notes.
Apart from the mentioned versions, it also says
While mongodump may work on earlier versions of MongoDB server, any such compatibility is not guaranteed.

Why is mongoimport.exe is gone from my package?

I'm a begineer at learning MongoDB. I had followed some course and installed windows mongodb enterprise edition package in the downloads section on MongoDB website. After installing and adding environment variables to PATH, I used mongoimport command. Then it said mongodb is not recognized as an internal or external command, operable program or batch file. But I could execute mongo command
I had checked C:\Program Files\MongoDB\Server\4.4\bin and the only are mongo.exe, mongod.exe, mongodecrypt.exe, mongoldap.exe, and mongos.exe. No others.
So, where can I find downloadable executable file or is there a way to install the rest of the addition tools/package (such as mongodump, mongoimport, mongoexport, and else) so I could do mongoimport?
I ran into the same issue myself. As of MongoDB 4.4, the database tools is now a separate installation for all platforms except Linux. You can find the instructions to install for your platform here.
I faced same issue. Please find below information might help you to solve your issue related to mongoimport.
The Database Tools are now separately versioned and installed as of the MongoDB 4.4 server release. These tools release independently from the MongoDB Server schedule enabling you to receive more frequent updates and leverage new features as soon as they are available. These include, among other things: mongodump, mongorestore, mongoimport, and mongoexport.
This is the download link for MongoDB Database Tools
In case of Windows installation, don't forget to add Database Tools folder to your path

How do I install MongoDB on FreeDSB if the port was apparently removed?

Running sudo pkg install mongodb produces an error stating that no such package exists. I figured this is because it says on this website https://www.freshports.org/databases/mongodb/ that the MongoDB port has expired and has been removed. How do I get a version of MongoDB on my FreeBSD server now?
I recommend that every time you want to install a package you perform a pkg search
pkg search packagename
For MongoDB:
root#demo:/ # pkg search mongodb
mongodb32-3.2.11_2 Distributed document-oriented "NoSQL" database
mongodb32-tools-3.2.11 Tools for MongoDB
mongodb34-3.4.16 Distributed document-oriented "NoSQL" database
mongodb34-tools-3.4.9 Tools for MongoDB
mongodb36-3.6.6_2 Distributed document-oriented "NoSQL" database
mongodb36-tools-3.6.3 Tools for MongoDB
p5-Mojolicious-Plugin-Mongodb-1.16_1 Use MongoDB in Mojolicious
p5-MongoDB-2.0.1 Mongo Driver for Perl
php56-pecl-mongodb-1.5.2 PECL classes for MongoDB
php70-pecl-mongodb-1.5.2 PECL classes for MongoDB
php71-pecl-mongodb-1.5.2 PECL classes for MongoDB
php72-pecl-mongodb-1.5.2 PECL classes for MongoDB
py27-mtools-mongodb-1.2.3_2 Setup test environments; parse, filter and visualize MongoDB log files
py27-nagios-check_mongodb-0.1 Nagios plugin to check mongodb server
As you can see there are mongodb32, mongodb34 and mongodb36
You can then perform the following:
pkg install mongodb36-3.6.6_2
You could also install packages from ports but it's more time consuming and in the most cases is not necessary, unless you want to enable custom flags/modules to your mongodb installation.
https://www.freebsd.org/doc/handbook/ports-using.html
There is a note on the website you linked to that the MongoDB port was moved to databases/mongodb34.
Chapter 4.4. Using pkg for Binary Package Management of the FreeBSD Handbook might help you to deal with the situation you describe (especially 4.4.9. Modifying Package Metadata).
I am not sure, however, if there is an easy update path. I've never tried it.

How to configure ssl in mongodb?

I have followed document to configure ssl in mongodb. But no luck.The mongod service doesnot start after configuring ssl in mongo.conf.
I have gone through and looks like i need to use Scon first to support SSL/TLS.
Can anyone please share steps or document, I need to follow first .
I am using mongo version 2.6
This wiki should cover everything you need to build from source using scons. Ensure you have the correct ssl package installed as mentioned in the System Specific Requirements. Your scons command will look
scons mongod --ssl
If you are able to upgrade to mongodb 3.0+ from 2.6 most distributions include ssl support.

Ensure standard library linked to boost matches mongo C++ driver's

I want to install MongoDB C++ client. I read in its manual that:
On systems offering multiple C++ standard libraries, you must ensure
that the standard library linked into boost matches that linked into
the driver.
My O.S is ubuntu 14.04.
Does the above quote applies to my system?
How do I ensure which standard library is linked into the boost which I installed apt-get install libboost-all-dev?
In case libboost-all-dev is not linked against c++11, do I need to build from source?
My application is going to be using multi threading, do I need to make sure boost, mongodb C++ client and other libraries are linked using some multi threaded flag?
Ubuntu is not a system that is offering multiple C++ standard libraries. e.g. in ubuntu you would use GPLish libstdc++ and don't need the libc++.
I don't know how to tell whether the boost package for ubuntu was linked with c++11 but it must have since once I matched my mongo to be linked with c++11 it - mongo stopped crashing.
So if you are using ubuntu and want to use mongo legacy c++ driver you should build mongo with the c++11 flag.
for example:
scons --c++11 install