zoukankan      html  css  js  c++  java
  • mongo2.4.5

    #!/bin/bash
    cd /usr/local/src
    tar fxvz mongodb-linux-x86_64-2.4.5.tgz
    mkdir /usr/local/mongodb/
    mkdir /home/mongologs/
    mkdir /home/mongodb
    mv mongodb-linux-x86_64-2.4.5/* /usr/local/mongodb/
    rm -rf mongodb-linux-x86_64-2.4.5
    cd /usr/local/mongodb/
    mkdir conf
    cat >> /usr/local/mongodb/conf/mongo.conf<<EOF
    logpath=/home/mongologs/mongodb.log
    dbpath=/home/mongodb
    port = 27017
    master = true
    logappend = true
    fork = true
    rest = true
    directoryperdb=true
    #auth = true

    #auth = true

    maxConns = 20000
    EOF
    ln -s /usr/local/mongodb/bin/mongo /usr/bin
    /usr/local/mongodb/bin/mongod -f /usr/local/mongodb/conf/mongo.conf
    echo "/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/conf/mongo.conf" >> /etc/rc.local
    mongo <<EOF
    use admin;
    db.addUser('root','密码');
    db.shutdownServer();
    quit();
    EOF
    sed -i 's/#auth = true/auth = true/g' /usr/local/mongodb/conf/mongo.conf
    /usr/local/mongodb/bin/mongod -f /usr/local/mongodb/conf/mongo.conf


    /usr/local/mongodb/bin/mongodump -d opener -o /mnt/bak_mongodb/$D -u=root -p=xxxx --authenticationDatabase=admin

    http://blog.csdn.net/sinat_30397435/article/details/50774175
    .
    /usr/local/mongodb/bin/mongodump -h 192.168.10.175 --port 27017 -d sina -c 201801 -o ./mongo_qianyi/ -uback -pback123


    db.getCollection('201503').drop()

    所有的悲情叙事,都是因为你的基础体能不够
  • 相关阅读:
    软件上线标准
    rap使用手册
    微服务
    什么是集合?
    什么是maven?maven中的pom文件是做什么的?
    什么是连接池?
    架构
    什么是反射?
    产品
    描述下fastJSON,jackson等等的技术
  • 原文地址:https://www.cnblogs.com/gaoyuechen/p/9235190.html
Copyright © 2011-2022 走看看