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 ...
随机推荐
- SSH框架(2)
个人分类: Java面试 Struts 谈谈你对Struts的理解. 答: 1.struts是一个按MVC模式设计的Web层框架,其实它就是一个大大的servlet,这个Servlet名为Acti ...
- [Luogu1527][国家集训队]矩阵乘法
luogu 题意 给你一个\(N*N\)的矩阵,每次询问一个子矩形的第K小数.(居然连修改都不带的) \(N\le500,Q\le60000\) sol 整体二分+二维树状数组裸题. 复杂度是\(O( ...
- UVA11168 Airport
题意 PDF 分析 首先发现距离最短的直线肯定在凸包上面. 然后考虑直线一般方程\(Ax+By+C=0\),点\((x_0,y_0)\)到该直线的距离为 \[ \frac{|Ax_0+By_0+C|} ...
- CODEVS4650 破损的键盘
传送门 题目大意:一个字符串,将[]内的字符提前. 题解:链表,数组元素高效交换 cur表示目前元素插入下标为cur的元素后面. 所以,假设目前把下标为i的元素插到cur后面. 那么,next[i]= ...
- hadoop之 Zookeeper 分布式应用程序协调服务
(1) Zookeeper 在 Hadoop 集群中的作用 Zookeeper 是分布式管理协作框架,Zookeeper 集群用来保证 Hadoop 集群的高可用,(高可用的含义是:集群中就算有一部分 ...
- 完整的CRUD——javaweb
1,总体架构 index是进去的页面, 可以跳转Insert的增加页面,operatePerson是根据传进来的URI来判断增删改查的页面, DbManager.java是封装的数据库操作类, Pag ...
- Java课程设计——坦克大战
坦克大战——坦克类 一. 团队课程设计博客链接 https://www.cnblogs.com/chenhuilin/p/10275664.html 二.个人负责模块和任务说明 模块:坦克类(玩家坦克 ...
- nextSibling VS nextElementSibling
2. nextSibling vs nextElementSibling { //FF { 在Firefox中,link2的nextSibling并不是link3,因为两者之间有一个换行符. 这被认为 ...
- spring mvc 返回字符串带双引号及StringHttpMessageConverter乱码处理
本文转载自:http://blog.csdn.net/wangyangbto/article/details/48804155 很多人都碰到过,SpringMVC使用 @ResponseBody 注解 ...
- 使用CMake生成sln项目和VS工程遇到的问题
用vs运行cmake后的工程 参考:http://zhidao.baidu.com/link?url=AZRxI0jGDzo6Pikk68qylee0g7leXbpbZGiVuyiijWbd8scUK ...