zoukankan      html  css  js  c++  java
  • CSHARP349

    Dear ratam:

        I write the information about the problem with richTextFormat:

         I am developing a GUI for MongoDB with your C# Driver.

          I create a environment to simulate Replset:

    Shard1:
    cd C:\runmongo\bin
    mongod --shardsvr  --port 10001 --dbpath  C:\mongodb\shard1 --replSet set1 --rest 

    Shard2:
    cd C:\runmongo\bin
    mongod --shardsvr  --port 10002 --dbpath  C:\mongodb\shard2 --replSet set1 --rest 

    Shard3:
    cd C:\runmongo\bin
    mongod --shardsvr  --port 20001 --dbpath  C:\mongodb\shard3 --replSet set2 --rest 

    Shard4:
    cd C:\runmongo\bin
    mongod --shardsvr  --port 20002 --dbpath  C:\mongodb\shard4 --replSet set2 --rest 

    Config:
    cd C:\runmongo\bin
    mongod --configsvr --port 30001 --dbpath  C:\mongodb\config1 --rest 


    Route:
    cd C:\runmongo\bin
    mongos --configdb localhost:30001

         I Create 2 Sets of ReplSet.

         I think the relpsetname is a property of MongoSrv,So when a new mongosvr is register to system,
    the replsetName is save in config file.
        Now I user MongoSetting to create MongoService Instance:

                        if (config.ReplSetName != string.Empty)
                        {
                            mongoSvrSetting.ReplicaSetName = config.ReplSetName;
                        }
                        MongoServer masterMongoSvr = new MongoServer(mongoSvrSetting);
                        _mongoSrvLst.Add(config.HostName, masterMongoSvr);


    Then when I want to get ReplicaSetName, it is always null.
    I have initReplset with replSetInitiate command.

     
    By the way,ConnectionMode is setting with Direct (I have tried with ReplSet,but the replsetname is still null)

                        mongoSvrSetting.ConnectionMode = ConnectionMode.Direct;
                        mongoSvrSetting.SlaveOk = config.IsSlaveOk;

     


  • 相关阅读:
    UItableView的cell重用机制
    iOS开发中常遇到的面试题
    iOS UIScrollView 的基本用法
    iOS的CocoaPods手动挡到自动挡到导入第三方框架 转发
    iOS之NSPredicate(正则表达式和UIBarController):谓词
    iOS UISearchController 搜索框
    PHP 基本用法及基本知识点
    iOS 九宫格的实现
    iOS XML 系统自带的解析方法
    iOS xml文件的解析方式 XMLDictionary,GDataXMLNode,NSXMLParser 转发自徒步天涯
  • 原文地址:https://www.cnblogs.com/TextEditor/p/2235718.html
Copyright © 2011-2022 走看看