Linux Platform Installation MongoDB
Method One:
MongoDB offers 32-bit and 64-bit installation packages on the Linux platform, which you can download on the website.
: http://www.mongodb.org/downloads , select the appropriate platform version.
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M01/8D/76/wKiom1idIKjBxiBwAAAp8jgjj3Q893.png-wh_500x0-wm_ 3-wmp_4-s_3912538528.png "title=" 2017-02-10_100803.png "alt=" Wkiom1idikjbxibwaaap8jgjj3q893.png-wh_50 "/>
Download the installation package and unzip tgz (The following shows the installation on a 64-bit Linux).
Curl-o https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz #下载tar-ZXVF mongodb-linux-x86_64-3.0.6.tgz #解压mv mongodb-linux-x86_64-3.0.6//usr/local/mongodb #将解压包拷贝到指定目录
the MongoDB executable file is located in the bin directory, so you can add it to the PATH in the path:
Export Path=<mongodb-install-directory>/bin: $PATH
<mongodb-install-directory> for your MongoDB installation path. As the/usr/local/mongodb of this article .
Create a database directory
MongoDB data is stored in the DB directory in the database directory, but this directory is not created automatically during the installation process, so you need to create the data directory manually and create the DB directory in the data directory.
In the following example we create the data directory under the root directory (/).
Note:/data/db is the default startup database path for MongoDB (--dbpath).
Mkdir-p/data/db
Run MongoDB service on the command line
You can then execute the mongod command to start the MONGDB service by executing the bin directory in the MONGO installation directory on the command line.
Note: If your database directory is not/data/db, you can specify it through--dbpath.
$./mongod2015-09-25t16:39:50.549+0800 I JOURNAL [Initandlisten] JOURNAL dir=/data/db/journal2015-09-25t16:39:50.550 +0800 i JOURNAL [initandlisten] recover:no JOURNAL files present, no recovery needed2015-09-25t16:39:50.869+0800 I JOUR NAL [Initandlisten] preallocateisfaster=true 3.162015-09-25t16:39:51.206+0800 I JOURNAL [Initandlisten] Preallocateisfaster=true 3.522015-09-25t16:39:52.775+0800 I JOURNAL [Initandlisten] preallocateisfaster=true 7.7
Note: If the Mongod service is wrong at startup, the following:
[Email protected] bin]#./mongod./mongod:/usr/lib64/libcrypto.so.10:no version information available (required by./mo Ngod)./mongod:/usr/lib64/libcrypto.so.10:no version information available (required by./mongod)./mongod:/usr/lib64/ Libssl.so.10:no version information available (required by./mongod)./mongod:relocation error:./mongod:symbol tlsv1_2_ Client_method, version libssl.so.10 not defined in file libssl.so.10 with link time reference
Workaround: Because OpenSSL is not up-to-date, it causes the startup service to error.
Download the latest openssl-1.0.1e-48.el6.x86_64.rpm,rpm upgrade.
RPM-UVH openssl-1.0.1e-48.el6.x86_64.rpm
Linux Platform Installation MongoDB