centos 安装mongodb3.0
一、添加yum源
- vi /etc/yum.repos.d/mongodb-org-3.0.repo
请添加如下配置(64位系统):
- [mongodb-org-3.0]
- name=MongoDB Repository
- baseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.0/x86_64/
- gpgcheck=0
- enabled=1
二、安装MongoDB
- sudo yum install -y mongodb-org
三、修改soft rlimits的限制
- vi /etc/security/limits.conf
在文件最后加上
- mongod soft nproc 65536
- mongod hard nproc 65536
如果不做第三步,启动mongodb后会出现下面的提示
- 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引擎)
- vi /etc/mongod.conf
根据下面的配置修改/etc/mongod.conf里的配置
- # mongod.conf
- #where to log
- logpath=/var/log/mongodb/mongod.log
- logappend=true
- # fork and run in background
- fork=true
- #port=27017
- dbpath=/var/lib/mongo
- # location of pidfile
- pidfilepath=/var/run/mongodb/mongod.pid
- # Listen to local interface only. Comment out to listen on all interfaces.
- #bind_ip=192.168.0.31
- # Disables write-ahead journaling
- nojournal=true
- # Enables periodic logging of CPU utilization and I/O wait
- #cpu=true
- # Turn on/off security. Off is currently the default
- #noauth=true
- #auth=true
- # Verbose logging output.
- #verbose=true
- # Inspect all client data for validity on receipt (useful for
- # developing drivers)
- #objcheck=true
- # Enable db quota management
- #quota=true
- # Set oplogging level where n is
- # 0=off (default)
- # 1=W
- # 2=R
- # 3=both
- # 7=W+some reads
- #diaglog=0
- # Ignore query hints
- #nohints=true
- # Enable the HTTP interface (Defaults to port 28017).
- #httpinterface=true
- # Turns off server-side scripting. This will result in greatly limited
- # functionality
- #noscripting=true
- # Turns off table scans. Any query that would do a table scan fails.
- #notablescan=true
- # Disable data file preallocation.
- #noprealloc=true
- # Specify .ns file size for new databases.
- # nssize=<size>
- storageEngine=wiredTiger
- wiredTigerCacheSizeGB=10
- wiredTigerStatisticsLogDelaySecs=0
- wiredTigerJournalCompressor=snappy
- wiredTigerDirectoryForIndexes=true
- wiredTigerCollectionBlockCompressor=snappy
- wiredTigerIndexPrefixCompression=1
- # Replication Options
- # in replicated mongo databases, specify the replica set name here
- #replSet=yourrs
- # maximum size in megabytes for replication operation log
- oplogSize=10240
- # path to a key file storing authentication info for connections
- # between replica set members
- #keyFile=/path/to/keyfile
五、启动MongoDB
- /etc/init.d/mongod start
六、创建管理员账号
进入mongo
- mongo
在mongo shell里面输入
- use admin
进入admin库之后,输入
- db.createUser({user: "admin",pwd: "admin",roles: [ "dbAdmin" ]})
这样就创建了一个用户名是admin,密码是admin的管理员角色的用户。
版权声明:本文为博主原创文章,未经博主允许不得转载。
centos 安装mongodb3.0的更多相关文章
- CentOS 安装mongodb3.0 二进制包
1.下载mongodb因为64位系统CentOS,所以下载64位的安装包: wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0 ...
- 【推荐】CentOS安装Tomcat-7.0.57+启动配置+安全配置+性能配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. #准备工作# 在安装Tomcat之前,请确保已经安装了JDK-1.7环境,具体见<CentOS安装JDK-1.7>. ...
- 【推荐】CentOS安装vsftpd-3.0.2+安全配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. FTP的登录一般有三种方式,分别是: 匿名用户形式:默认安装的情况下,系统只提供匿名用户访问,只需要输入用户anonymous/f ...
- centos 安装php7.0.2
PHP7.0正式版已经在2015年11月份左右发布,目前是PHP7.0.2版本,本人最早是从2015年8月php7的第一个测试版跟起,现在正式版发布. linux版本:64位CentOS 6.6 Ng ...
- 【推荐】CentOS安装vsftpd-3.0.3+安全配置
注:以下所有操作均在CentOS 6.5 x86_64位系统下完成. FTP的登录一般有三种方式,分别是: 匿名用户形式:默认安装的情况下,系统只提供匿名用户访问,只需要输入用户anonymous/f ...
- CentOS安装GlassFish4.0 配置JDBC连接MySQL
转自:http://linux.it.net.cn/CentOS/course/2014/0724/3319.html 版本glassfish-4.0.zip 1.解压,拷贝到指定安装路径 unz ...
- centos 安装mysql8.0.16
清除自带的mariadb > rpm -qa|grep mariadb mariadb-libs-5.5.44-2.el7.centos.x86_64 > rpm -e --nodeps ...
- centos 安装 mongo3.0
官方网站传贴,每次去翻doc,麻烦 vi /etc/yum.repos.d/mongodb-org-3.0.repo [mongodb-org-3.0]name=MongoDB Repository ...
- centos安装tomcat7.0.70
抄自:https://www.cnblogs.com/www1707/p/6592504.html apache-tomcat-7.0.70jdk-7u67-linux-x64 下载tomcathtt ...
随机推荐
- request.getDispatcher().forward(request,response)和response.sendRedirect()的区别
在进行web开发时,跳转是最常见的,今天在这里来学习下2种跳转: 第一种是request.getDispatcher().forward(request,response): 1.属于转发,也是服务器 ...
- 重温CLR(五)类型和成员基础
类型的各种成员 类型可以定义以下种类的成员 1 常量 常量是指出数据值恒定不变的符号.这种符号使代码更易阅读和维护.常量总与类型管理,不与类型的实例管理.常量逻辑上总是静态成员. 2 字段 字段表示只 ...
- 如何理解Robot Framework
不知不觉公众号已经有很多人关注了,小编先谢谢大家的支持-今天我们就来谈一谈我对RF的理解,因为前段时间换了工作,目前RF知识基本用不上了.其实我在上一份工作中大部分都是在反复的使用前面讲过的知识——其 ...
- 一个苹果证书如何多次使用——导出p12文件[多台电脑使用]
为什么要导出.p12文件 当我们用大于三个mac设备开发应用时,想要申请新的证书,如果在我们的证书里,包含了3个发布证书,2个开发证书,可以发现再也申请不了开发证书和发布证书了(一般在我们的证书界面中 ...
- Oracle变量的定义、赋值及使用
首先我们来看看代码,然后我们在说明和解释代码: declare l_dept ; currtime date := sysdate; l_nam ) :),'yyyymmdd'); -- to_cha ...
- ASM概述
ASM的全称是 Automatic Storage Management,ASM 是为存放oracle 数据文件而设计的一个volume manager 和 文件系统 管理的技术. ASM 支持ora ...
- 管理11gRAC基本命令 (转载) 很详细
在 Oracle Clusterware 11g 第 2 版 (11.2) 中,有许多子程序和命令已不再使用: crs_stat crs_register crs_unregiste ...
- bzoj 3295 (洛谷3157、3193) [Cqoi2011]动态逆序对——树套树 / CDQ分治
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=3295 题目--洛谷3157:https://www.luogu.org/problemnew ...
- 织梦 dede 笔记
将项目转移到另一服务器 方法: https://www.genban.org/news/dedecms-13096.html 在实际中,我走的是第二种方法 方法一: 1 后台>系统>备份 ...
- 安装ruby-pg报错解决
ruby用pgsql做orm的时候,需要安装ruby-pg库,默认编译安装会提示缺少xx头文件 max下,我用的傻瓜式pgsql.app gem install pg -- --with-pg-con ...