Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-9477

Docs for SERVER-26809: Update mongo shell sh.getBalancerHost() method for 3.4

    • Type: Icon: Task Task
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Engineering Ticket Description:

      Since in 3.4, balancer runs on primary of CSRS and the lock document is:

      db.locks.findOne( {_id: "balancer"})
      {
      	"_id" : "balancer",
      	"state" : 2,
      	"ts" : ObjectId("581178035b3b7dcb772022cd"),
      	"who" : "ConfigServer:Balancer",
      	"process" : "ConfigServer",
      	"when" : ISODate("2016-10-27T03:44:03.007Z"),
      	"why" : "CSRS Balancer"
      }
      

      The sh.getBalancerHost() method needs to be updated since it still expects the hostname for the mongos:

      function (configDB) {
          if (configDB === undefined)
              configDB = sh._getConfigDB();
          var x = configDB.locks.findOne({_id: "balancer"});
          if (x == null) {
              print(
                  "config.locks collection does not contain balancer lock. be sure you
      are connected to a mongos");
              return "";
          }
          return x.process.match(/[^:]+:[^:]+/)[0];
      }
      
      

            Assignee:
            kay.kim@mongodb.com Kay Kim (Inactive)
            Reporter:
            emily.hall Emily Hall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              6 years, 14 weeks, 3 days ago