溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

MongDB啟動警告 ”WARNING: soft rlimits too low.“問題的解決方法

發(fā)布時間:2021-11-12 15:11:33 來源:億速云 閱讀:176 作者:柒染 欄目:關系型數(shù)據(jù)庫

MongDB啟動警告 ”WARNING: soft rlimits too low.“問題的解決方法,針對這個問題,這篇文章詳細介紹了相對應的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

MongoDB 3.4啟動的時候有如下告警:
# mongo
MongoDB shell version v3.4.13
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.13
Server has startup warnings: 
2018-02-27T15:03:18.518+0800 I STORAGE  [initandlisten] 
2018-02-27T15:03:18.518+0800 I STORAGE  [initandlisten] ** WARNING: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine
2018-02-27T15:03:18.518+0800 I STORAGE  [initandlisten] **          See http://dochub.mongodb.org/core/prodnotes-filesystem
2018-02-27T15:03:19.055+0800 I CONTROL  [initandlisten] 
2018-02-27T15:03:19.055+0800 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-02-27T15:03:19.055+0800 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-02-27T15:03:19.055+0800 I CONTROL  [initandlisten] ** WARNING: You are running this process as the root user, which is not recommended.
2018-02-27T15:03:19.055+0800 I CONTROL  [initandlisten] 
2018-02-27T15:03:19.055+0800 I CONTROL  [initandlisten] 
2018-02-27T15:03:19.055+0800 I CONTROL  [initandlisten] ** WARNING: soft rlimits too low. rlimits set to 4096 processes, 65536 files. Number of processes should be at least 32768 : 0.5 times number of files.


 查看系統(tǒng)限制:
#  ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 192979
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 65536
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 4096
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited


解決方法:
可以直接在當前shell中設置:ulimit -n <value>
例如:


    ulimit -f unlimited  
    ulimit -t unlimited  
    ulimit -v unlimited  
    ulimit -n 64000  
    ulimit -m unlimited  
    ulimit -u 64000  
永久生效,需要寫入到/etc/profile


改完后需要重啟 mongod服務
>use admin
>db.shutdownServer()

關于MongDB啟動警告 ”WARNING: soft rlimits too low.“問題的解決方法問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關注億速云行業(yè)資訊頻道了解更多相關知識。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權內(nèi)容。

AI