MongoDB 3.0 Version Installation

Source: Internet
Author: User
Tags create mongodb

Reference official documentation

Windows Platform Installation

Results of direct execution:

1. Download via browser, no thunderbolt: https://www.mongodb.org/downloads?_ga=1.146766260.1274531242.1445581450#production

2. Basic configuration file: Mongod.cfg
-----Content
Systemlog:
Destination:file
Path:c:\data\log\mongod.log
Storage
Dbpath:c:\data\db

Note: When you start, you can also specify the data directory: C:\mongodb\bin\mongod.exe--dbpath "D:\test\mongodb\data"

# # # Start Installation: "C:\mongodb\bin\mongod.exe"--config "C:\mongodb\mongod.cfg"--install

# Note: When there is no registration service, the installation is complete, the end will stay in the display of the prompt information, the moment has been installed, open other windows to execute the command.


3. If you double-click the installation performed by the. msi package---Manually create the service.
Command: Sc.exe create MongoDB binpath= "C:\mongodb\bin\mongod.exe--service--config=\" C:\mongodb\mongod.cfg\ "" Displayname= "MongoDB" start= "Auto"

Redhat Linux Installation


1, configure the Yum warehouse.
<1> Create a file:/etc/yum.repos.d/mongodb-enterprise.repo
---content---
[Mongodb-enterprise]
Name=mongodb Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/stable/$basearch/
Gpgcheck=0
Enabled=1


<2> Create a Yum repository with a version number. <2.4 and 2.6 are all available, but 2.5 does not apply to production environments >.
Create a file:/etc/yum.repos.d/mongodb-enterprise-2.6.repo
---content----
[mongodb-enterprise-2.6]
Name=mongodb Enterprise 2.6 Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/2.6/$basearch/
Gpgcheck=0
Enabled=1


2. Install the stable version

Command: sudo yum install-y mongodb-enterprise

#安装指定版本:
sudo yum install-y mongodb-enterprise-2.6.1 mongodb-enterprise-server-2.6.1 mongodb-enterprise-shell-2.6.1 mongodb-enterprise-mongos-2.6.1 mongodb-enterprise-tools-2.6.1


3. Avoid accidental upgrade packages:
-----Write the following statement in the/etc/yum.conf file-----
Exclude=mongodb-enterprise,mongodb-enterprise-server,mongodb-enterprise-shell,mongodb-enterprise-mongos, Mongodb-enterprise-tools

4. Start

Manual start: sudo service mongod start
Random start: sudo chkconfig mongod on

The. RPM package contains a lot of content:

1.mongodb-enterprise-server
2.mongodb-enterprise-mongos
3.mongodb-enterprise-shell
4.mongodb-enterprise-tools
Also contains many initialization scripts:
mongod.conf configuration file, you can configure the data directory and log directory = =

The default/etc/mongod.conf configuration file supplied by the 3.0 series packages have bind_ip set to 127.0.0.1 by Defaul T. #已经默认绑定本地地址.
Modify This setting as needed for your environment before initializing a replica set. #若集群, change the IP address.

MongoDB 3.0 Version Installation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.