码迷,mamicode.com
首页 > 数据库 > 详细

mongodb3.2安装与基本配置

时间:2016-06-20 00:55:58      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:mongodb3.2 install configure

一、使用yum安装mongodb 3.2

[root@node2 ~]# cat /etc/yum.repos.d/mongodb.repo

[mongodb-org-3.2]

name=MongoDB Repository

baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/

gpgcheck=0

enabled=1

[root@node2 ~]# yum install mongodb-org*


[root@node2 ~]# egrep -v "^(#|$)" /etc/mongod.conf

systemLog:

  destination: file

  logAppend: true

  path: /data/mongodb/log/mongod.log

storage:

  dbPath: /data/mongodb/data

  directoryPerDB: true

  journal:

    enabled: true

processManagement:

  fork: true  # fork and run in background

  pidFilePath: /data/mongodb/conf/mongod.pid  # location of pidfile

net:

  port: 27027

  #bindIp: 127.0.0.1  # Listen to local interface only, comment to listen on all interfaces.

[root@node2 ~]# mkdir -p /data/mongodb/{conf,data,log} 

[root@node2 ~]# chown -R mongod.  /data/mongodb


[root@node2 ~]# tail /etc/security/limits.conf

# End of file

mongod soft nproc 40000

* hard nofile 1000000

* soft nofile 1000000

* soft core unlimited

* soft stack 10240

* - nofile 65535

push - nproc 65535

push - nofile 320000

work - nproc 10000


[root@node2 ~]# cat /etc/security/limits.d/90-nproc.conf

# Default limit for number of user‘s processes to prevent

# accidental fork bombs.

# See rhbz #432903 for reasoning.


*          soft    nproc     1024

root       soft    nproc     unlimited

[root@node2 ~]#


[root@node2 ~]# sed -n ‘62,64p‘ /etc/init.d/mongod

if [ -f /sys/kernel/mm/transparent_hugepage/defrag ] ; then

echo never > /sys/kernel/mm/transparent_hugepage/defrag

fi

[root@node2 ~]# service mongod  start 


二、macbook pro 上安装mongodb

  参考: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-os-x/

安装brew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

brew update

brew install mongodb

mongod  - -config /usr/local/etc/mongod.conf

三、mongo 客户端工具有: http://docs.mongodb.org/ecosystem/tools/administration-interfaces/



本文出自 “11462293” 博客,请务必保留此出处http://11472293.blog.51cto.com/11462293/1790860

mongodb3.2安装与基本配置

标签:mongodb3.2 install configure

原文地址:http://11472293.blog.51cto.com/11462293/1790860

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!