zoukankan      html  css  js  c++  java
  • mongodb 的一些启动命令

    1. 启动命令  
    2. nohup /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/bin/mongod -dbpath /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/db &  
    3. 启动  
    4. nohup /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/bin/mongod --config /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/bin/mongodb.conf -master &  
    5. 停止  
    6. /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/bin/mongod --shutdown -dbpath /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/db  
    7.   
    8. 从库启动  
    9. nohup /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/bin/mongod --config /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/bin/mongodb.conf -slave -source 192.168.1.130:27017 &  
    10.   
    11. 停止  
    12. /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/bin/mongod --shutdown -dbpath /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/db  
    13. 访问mongo  
    14. /home/sh/local/mongodb-linux-x86_64-rhel62-3.4.0/bin/mongo  
    15.   
    16.   
    17. Error: error: {  
    18.         "ok" : 0,  
    19.         "errmsg" : "not master and slaveOk=false",  
    20.         "code" : 13435,  
    21.         "codeName" : "NotMasterNoSlaveOk"  
    22. }  
    23. db.getMongo().setSlaveOk();  #启动slave
    24.   
    25.   
    26. 查看服务状态  
    27. db.printReplicationInfo();  
    28.   
    29.   
    30. 杀掉服务  
    31. kill -3 `ps -ef|grep mongod|grep -v grep|awk '{print $2}'`  
    32.   
    33. slaveok=ok  
    34.   
    35. wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.4.0.tgz 
  • 相关阅读:
    D
    NOI 1.7编程基础之字符串(35题)
    HYSBZ 2145 悄悄话
    POJ 2406 Power Strings
    POJ 3461 Oulipo[附KMP算法详细流程讲解]
    POJ 3974 Palindrome
    POJ 1002 487-3279
    POJ 1182 食物链
    POJ 2524 Ubiquitous Religions
    HDU 1251 统计难题
  • 原文地址:https://www.cnblogs.com/moss_tan_jun/p/6269172.html
Copyright © 2011-2022 走看看