Installation of MongoDB under Mac

Source: Internet
Author: User
Tags brew install mongodb install mongodb openssl openssl version

For a long time did not send blog ~ today came a ~ nonsense less say ~goon.


A: Homebrew Introduction and Installation

Introduction: Is the software package management tools on Mac, easy to install and uninstall.

Installation: Open terminal, enter the following command, the period will enter a carriage return + two boot password.

Ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"

Two: MongoDB installation

1: Open terminal, enter the following command

Brew Update

2: Continue to enter the following instruction, there will be about two progress bar (forget)

Brew Install MongoDB

3: Enter the command to start MongoDB

Mongod

The following error occurred: About to say there is no /data/db directory.

2016-08-02t18:19:16.825+0800 I CONTROL [Initandlisten] MongoDB starting:pid=37113 port=27017 dbpath=/data/db 64-bit hos T=c02q6n1gfvh5-3.local

2016-08-02t18:19:16.826+0800 I CONTROL [initandlisten] DB version v3.2.8

2016-08-02t18:19:16.826+0800 I CONTROL [Initandlisten] git version:ed70e33130c977bda0024c125b56d159573dbaf0

2016-08-02t18:19:16.826+0800 I CONTROL [Initandlisten] OpenSSL Version:openssl 1.0.2h 3 May 2016

2016-08-02t18:19:16.826+0800 I CONTROL [Initandlisten] Allocator:system

2016-08-02t18:19:16.826+0800 I CONTROL [Initandlisten] Modules:none

2016-08-02t18:19:16.826+0800 I CONTROL [Initandlisten] Build environment:

2016-08-02t18:19:16.826+0800 I CONTROL [Initandlisten] distarch:x86_64

2016-08-02t18:19:16.826+0800 I CONTROL [Initandlisten] target_arch:x86_64

2016-08-02t18:19:16.826+0800 I CONTROL [Initandlisten] options: {}

2016-08-02t18:19:16.828+0800 I STORAGE [Initandlisten] exception in initandlisten:29 Data directory/data/db not fou nd., terminating

2016-08-02t18:19:16.828+0800 I CONTROL [Initandlisten] dbexit:rc:100

4: Continue to enter instructions, create /data/db, solve the above problems. The password will be in and out once.

sudo mkdir-p/data/db

5: Try to start MongoDB again

Mongod

The following error occurred: About say no permission.

2016-08-02t19:15:14.592+0800 I CONTROL [Initandlisten] MongoDB starting:pid=38311 port=27017 dbpath=/data/db 64-bit hos T=c02q6n1gfvh5-3.local

2016-08-02t19:15:14.593+0800 I CONTROL [initandlisten] DB version v3.2.8

2016-08-02t19:15:14.593+0800 I CONTROL [Initandlisten] git version:ed70e33130c977bda0024c125b56d159573dbaf0

2016-08-02t19:15:14.593+0800 I CONTROL [Initandlisten] OpenSSL Version:openssl 1.0.2h 3 May 2016

2016-08-02t19:15:14.593+0800 I CONTROL [Initandlisten] Allocator:system

2016-08-02t19:15:14.593+0800 I CONTROL [Initandlisten] Modules:none

2016-08-02t19:15:14.593+0800 I CONTROL [Initandlisten] Build environment:

2016-08-02t19:15:14.593+0800 I CONTROL [Initandlisten] distarch:x86_64

2016-08-02t19:15:14.593+0800 I CONTROL [Initandlisten] target_arch:x86_64

2016-08-02t19:15:14.593+0800 I CONTROL [Initandlisten] options: {}

2016-08-02t19:15:14.595+0800 I STORAGE [Initandlisten] exception in initandlisten:98 unable to create/open lock file :/data/db/mongod.lock errno:13 Permission denied is a Mongod instance already running?, terminating

2016-08-02t19:15:14.595+0800 I CONTROL [Initandlisten] dbexit:rc:100

6: Execute the following instruction, solve the above problem, give permission (hehe, no reaction after the execution)

sudo chown-r user name/data/db

7: Try to start MongoDB again

Mongod

Waitting 27017 ... Success!!!

2016-08-02t19:16:06.621+0800 I CONTROL [Initandlisten] MongoDB starting:pid=38338 port=27017 dbpath=/data/db 64-bit hos T=c02q6n1gfvh5-3.local

2016-08-02t19:16:06.622+0800 I CONTROL [initandlisten] DB version v3.2.8

2016-08-02t19:16:06.622+0800 I CONTROL [Initandlisten] git version:ed70e33130c977bda0024c125b56d159573dbaf0

2016-08-02t19:16:06.622+0800 I CONTROL [Initandlisten] OpenSSL Version:openssl 1.0.2h 3 May 2016

2016-08-02t19:16:06.622+0800 I CONTROL [Initandlisten] Allocator:system

2016-08-02t19:16:06.622+0800 I CONTROL [Initandlisten] Modules:none

2016-08-02t19:16:06.622+0800 I CONTROL [Initandlisten] Build environment:

2016-08-02t19:16:06.622+0800 I CONTROL [Initandlisten] distarch:x86_64

2016-08-02t19:16:06.622+0800 I CONTROL [Initandlisten] target_arch:x86_64

2016-08-02t19:16:06.622+0800 I CONTROL [Initandlisten] options: {}

2016-08-02t19:16:06.622+0800 I STORAGE [Initandlisten] Wiredtiger_open config:create,cache_size=4g,session_max= 20000,eviction= (threads_max=4), config_base=false,statistics= (FAST), log= (enabled=true,archive=true,path=journal , Compressor=snappy), file_manager= (close_idle_time=100000), checkpoint= (WAIT=60,LOG_SIZE=2GB), statistics_log= ( wait=0),

2016-08-02t19:16:07.239+0800 I CONTROL [Initandlisten]

2016-08-02t19:16:07.239+0800 I CONTROL [initandlisten] * * warning:soft rlimits too low. Number of files is a, should be at least 1000

2016-08-02t19:16:07.239+0800 I ftdc [Initandlisten] Initializing full-time diagnostic data capture with directory '/da Ta/db/diagnostic.data '

2016-08-02t19:16:07.239+0800 I NETWORK [hostnamecanonicalizationworker] starting hostname canonicalization worker

2016-08-02t19:16:07.390+0800 I NETWORK [Initandlisten] waiting for connections on port 27017

8: Open the browser at this time, enter the following address:

http://127.0.0.1:27017/

The page that appears as shown below also represents a successful start.

It looks like you is trying to access MongoDB over HTTP on the native driver port.



Oh, God, that's all.

This article is from the "Cinderella" blog, please be sure to keep this source http://cinderella7.blog.51cto.com/7607653/1833705

Installation of MongoDB under Mac

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.