zoukankan      html  css  js  c++  java
  • mongodb 主从服务器

    @set mongod=..inmongod.exe
    
    set keyFile=key.key
    
    if not exist %keyFile% (
    echo 123456>%keyFile%
    )
    
    md %1 2>nul 1>nul
    
    %mongod% --port %1 --replSet %2 --dbpath %1 --logpath %1\_output_%1.log %3 %4 %5 %6
    
    ::接着运行↓
    config_rs1 = {
        _id: "rs",
        members: [{
            _id: 0,
            host: "127.0.0.1:27017",
            priority: 4
        },
        {
            _id: 1,
            host: "127.0.0.1:27018",
            priority: 3
        },
        {
            _id: 2,
            host: "127.0.0.1:27019",
            priority: 2
        },
        {
            _id: 3,
            host: "127.0.0.1:27020",
            priority: 1
        }]
    };
    
    rs.initiate(config_rs1);
  • 相关阅读:
    IOTest-InputStream-OutputStream
    JSP
    java链表
    区块链
    MySQL常用命令
    jQuery
    javascript
    Nginx
    Linux
    Hive
  • 原文地址:https://www.cnblogs.com/arliang/p/3273060.html
Copyright © 2011-2022 走看看