一、添加yum源

  1. vi /etc/yum.repos.d/mongodb-org-3.0.repo

请添加如下配置(64位系统):

  1. [mongodb-org-3.0]
  2. name=MongoDB Repository
  3. baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
  4. gpgcheck=0
  5. enabled=1

二、安装MongoDB

  1. sudo yum install -y mongodb-org

三、修改soft rlimits的限制

  1. vi /etc/security/limits.conf

在文件最后加上

  1. mongod soft nproc 65536
  2. mongod hard nproc 65536

如果不做第三步,启动mongodb后会出现下面的提示

  1. 2015-05-21T14:58:52.493+0800 I CONTROL [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 1024 processes, 65536 files. Number of processes should be at least 32768 : 0.5 times number of files.

四、配置MongoDB(使用wiredTiger引擎)

  1. vi /etc/mongod.conf

根据下面的配置修改/etc/mongod.conf里的配置

  1. # mongod.conf
  2.  
  3. #where to log
  4. logpath=/var/log/mongodb/mongod.log
  5.  
  6. logappend=true
  7.  
  8. # fork and run in background
  9. fork=true
  10.  
  11. #port=27017
  12.  
  13. dbpath=/var/lib/mongo
  14.  
  15. # location of pidfile
  16. pidfilepath=/var/run/mongodb/mongod.pid
  17.  
  18. # Listen to local interface only. Comment out to listen on all interfaces.
  19. #bind_ip=192.168.0.31
  20.  
  21. # Disables write-ahead journaling
  22. nojournal=true
  23.  
  24. # Enables periodic logging of CPU utilization and I/O wait
  25. #cpu=true
  26.  
  27. # Turn on/off security. Off is currently the default
  28. #noauth=true
  29. #auth=true
  30.  
  31. # Verbose logging output.
  32. #verbose=true
  33.  
  34. # Inspect all client data for validity on receipt (useful for
  35. # developing drivers)
  36. #objcheck=true
  37.  
  38. # Enable db quota management
  39. #quota=true
  40.  
  41. # Set oplogging level where n is
  42. # 0=off (default)
  43. # 1=W
  44. # 2=R
  45. # 3=both
  46. # 7=W+some reads
  47. #diaglog=0
  48. # Ignore query hints
  49. #nohints=true
  50.  
  51. # Enable the HTTP interface (Defaults to port 28017).
  52. #httpinterface=true
  53.  
  54. # Turns off server-side scripting. This will result in greatly limited
  55. # functionality
  56. #noscripting=true
  57.  
  58. # Turns off table scans. Any query that would do a table scan fails.
  59. #notablescan=true
  60.  
  61. # Disable data file preallocation.
  62. #noprealloc=true
  63.  
  64. # Specify .ns file size for new databases.
  65. # nssize=<size>
  66.  
  67. storageEngine=wiredTiger
  68. wiredTigerCacheSizeGB=10
  69. wiredTigerStatisticsLogDelaySecs=0
  70. wiredTigerJournalCompressor=snappy
  71. wiredTigerDirectoryForIndexes=true
  72. wiredTigerCollectionBlockCompressor=snappy
  73. wiredTigerIndexPrefixCompression=1
  74.  
  75. # Replication Options
  76.  
  77. # in replicated mongo databases, specify the replica set name here
  78. #replSet=yourrs
  79. # maximum size in megabytes for replication operation log
  80. oplogSize=10240
  81. # path to a key file storing authentication info for connections
  82. # between replica set members
  83. #keyFile=/path/to/keyfile

五、启动MongoDB

  1. /etc/init.d/mongod start

六、创建管理员账号

进入mongo

  1. mongo

在mongo shell里面输入

  1. use admin

进入admin库之后,输入

  1. db.createUser({user: "admin",pwd: "admin",roles: [ "dbAdmin" ]})

这样就创建了一个用户名是admin,密码是admin的管理员角色的用户。

版权声明:本文为博主原创文章,未经博主允许不得转载。

centos 安装mongodb3.0的更多相关文章

  1. CentOS 安装mongodb3.0 二进制包

    1.下载mongodb因为64位系统CentOS,所以下载64位的安装包: wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0 ...

  2. 【推荐】CentOS安装Tomcat-7.0.57+启动配置+安全配置+性能配置

    注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Tomcat之前,请确保已经安装了JDK-1.7环境,具体见<CentOS安装JDK-1.7>. ...

  3. 【推荐】CentOS安装vsftpd-3.0.2+安全配置

    注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. FTP的登录一般有三种方式,分别是: 匿名用户形式:默认安装的情况下,系统只提供匿名用户访问,只需要输入用户anonymous/f ...

  4. centos 安装php7.0.2

    PHP7.0正式版已经在2015年11月份左右发布,目前是PHP7.0.2版本,本人最早是从2015年8月php7的第一个测试版跟起,现在正式版发布. linux版本:64位CentOS 6.6 Ng ...

  5. 【推荐】CentOS安装vsftpd-3.0.3+安全配置

    注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. FTP的登录一般有三种方式,分别是: 匿名用户形式:默认安装的情况下,系统只提供匿名用户访问,只需要输入用户anonymous/f ...

  6. CentOS安装GlassFish4.0 配置JDBC连接MySQL

    转自:http://linux.it.net.cn/CentOS/course/2014/0724/3319.html 版本glassfish-4.0.zip 1.解压,拷贝到指定安装路径   unz ...

  7. centos 安装mysql8.0.16

    清除自带的mariadb > rpm -qa|grep mariadb mariadb-libs-5.5.44-2.el7.centos.x86_64 > rpm -e --nodeps ...

  8. centos 安装 mongo3.0

    官方网站传贴,每次去翻doc,麻烦 vi  /etc/yum.repos.d/mongodb-org-3.0.repo [mongodb-org-3.0]name=MongoDB Repository ...

  9. centos安装tomcat7.0.70

    抄自:https://www.cnblogs.com/www1707/p/6592504.html apache-tomcat-7.0.70jdk-7u67-linux-x64 下载tomcathtt ...

随机推荐

  1. request.getDispatcher().forward(request,response)和response.sendRedirect()的区别

    在进行web开发时,跳转是最常见的,今天在这里来学习下2种跳转: 第一种是request.getDispatcher().forward(request,response): 1.属于转发,也是服务器 ...

  2. 重温CLR(五)类型和成员基础

    类型的各种成员 类型可以定义以下种类的成员 1 常量 常量是指出数据值恒定不变的符号.这种符号使代码更易阅读和维护.常量总与类型管理,不与类型的实例管理.常量逻辑上总是静态成员. 2 字段 字段表示只 ...

  3. 如何理解Robot Framework

    不知不觉公众号已经有很多人关注了,小编先谢谢大家的支持-今天我们就来谈一谈我对RF的理解,因为前段时间换了工作,目前RF知识基本用不上了.其实我在上一份工作中大部分都是在反复的使用前面讲过的知识——其 ...

  4. 一个苹果证书如何多次使用——导出p12文件[多台电脑使用]

    为什么要导出.p12文件 当我们用大于三个mac设备开发应用时,想要申请新的证书,如果在我们的证书里,包含了3个发布证书,2个开发证书,可以发现再也申请不了开发证书和发布证书了(一般在我们的证书界面中 ...

  5. Oracle变量的定义、赋值及使用

    首先我们来看看代码,然后我们在说明和解释代码: declare l_dept ; currtime date := sysdate; l_nam ) :),'yyyymmdd'); -- to_cha ...

  6. ASM概述

    ASM的全称是 Automatic Storage Management,ASM 是为存放oracle 数据文件而设计的一个volume manager 和 文件系统 管理的技术. ASM 支持ora ...

  7. 管理11gRAC基本命令 (转载) 很详细

    在 Oracle Clusterware 11g 第 2 版 (11.2) 中,有许多子程序和命令已不再使用:    crs_stat    crs_register    crs_unregiste ...

  8. bzoj 3295 (洛谷3157、3193) [Cqoi2011]动态逆序对——树套树 / CDQ分治

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3295 题目--洛谷3157:https://www.luogu.org/problemnew ...

  9. 织梦 dede 笔记

    将项目转移到另一服务器 方法: https://www.genban.org/news/dedecms-13096.html 在实际中,我走的是第二种方法 方法一: 1  后台>系统>备份 ...

  10. 安装ruby-pg报错解决

    ruby用pgsql做orm的时候,需要安装ruby-pg库,默认编译安装会提示缺少xx头文件 max下,我用的傻瓜式pgsql.app gem install pg -- --with-pg-con ...