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 
  • 相关阅读:
    Webpack 学习2
    Webpack 学习
    JS魔法堂:彻底理解0.1 + 0.2 === 0.30000000000000004的背后
    JS魔法堂:再识Number type
    基础野:细说浮点数
    基础野:细说有符号整数
    基础野:细说无符号整数
    基础野:细说原码、反码和补码
    Vim魔法堂:认识快捷键绑定
    Httpd运维日志:通过apxs添加模块
  • 原文地址:https://www.cnblogs.com/moss_tan_jun/p/6269172.html
Copyright © 2011-2022 走看看