mongoDB 3.0 installed on Red Hat

发布时间:2020-09-09 17:30:01 作者:传奇库子
来源:网络 阅读:649

官方安装手册

http://docs.mongodb.org/manual/tutorial/install-mongodb-on-red-hat/

安装完成后,登录出现如下告警:

1.登录mongo shell

[root@localhost ~]# mongo

缺少openssl、libssh3

yum -y install openssl
service mongod restart

2.I use mongodb 3.0 and find a warning:

[root@localhost ~]# mongo
MongoDB shell version: 3.0.1
connecting to: test
Server has startup warnings: 
2015-03-13T16:28:29.405+0800 I CONTROL  [initandlisten] 
2015-03-13T16:28:29.406+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-03-13T16:28:29.406+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-03-13T16:28:29.406+0800 I CONTROL  [initandlisten] 
2015-03-13T16:28:29.407+0800 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-03-13T16:28:29.407+0800 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-03-13T16:28:29.407+0800 I CONTROL  [initandlisten]

solved:

vi /etc/init.d/mongod
#行首添加
if test -f /sys/kernel/mm/transparent_hugepage/enabled; then
  echo never > /sys/kernel/mm/transparent_hugepage/enabled
fi
if test -f /sys/kernel/mm/transparent_hugepage/defrag; then
   echo never > /sys/kernel/mm/transparent_hugepage/defrag
fi

重启mongod
service mongod restart

3.Recommended ulimit Settings

Every deployment may have unique requirements and settings; however, the following thresholds and settings are particularly important for mongod and mongos deployments:

-f (file size): unlimited

-t (cpu time): unlimited

-v (virtual memory): unlimited [1]

-n (open files): 64000

-m (memory size): unlimited [1] [2]

-u (processes/threads): 64000

Always remember to restart your mongod and mongos instances after changing the ulimit settings to ensure that the changes take effect.


vi /etc/profile

在最后添加

ulimit -n 64000

ulimit -u 64000

source /etc/profile

2015-04-02T01:36:21.150-0700 I CONTROL  [initandlisten] 
2015-04-02T01:36:21.150-0700 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 1024 processes, 64000 files. Number of processes should be at least 32000 : 0.5 times number of files.


推荐阅读:
  1. 在CentOS 7上使用Yum源安装和卸载 MongoDB
  2. mongodb搭建详解

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

mongodb 3.0 install inst st

上一篇:iOS设置圆角的4种方法实例(附性能评测)

下一篇:基于java线程安全问题及原理性分析

相关阅读

您好,登录后才能下订单哦!

密码登录
登录注册
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》