Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-15775

Make mongos ping _id configurable

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Works as Designed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Sharding
    • Labels:
      None

      Description

      The _id field in config.mongos pings collection comes from the balancer id and is based on the gethostname() call result:

          bool Balancer::_init() {
              try {
       
                  log() << "about to contact config servers and shards" << endl;
       
                  // contact the config server and refresh shard information
                  // checks that each shard is indeed a different process (no hostname mixup)
                  // these checks are redundant in that they're redone at every new round but we want to do them initially here
                  // so to catch any problem soon
                  Shard::reloadShardInfo();
                  _checkOIDs();
       
                  log() << "config servers and shards contacted successfully" << endl;
       
                  StringBuilder buf;
                  buf << getHostNameCached() << ":" << serverGlobalParams.port;
                  _myid = buf.str();
                  _started = time(0);
       
                  log() << "balancer id: " << _myid << " started at " << time_t_to_String_short(_started) << endl;
       
                  return true;
       
              }

      The ping _id fields are used by MMS (and probably some other monitoring software) for mongoS auto-discovery. However, in some use cases hostnames might not actually be resolvable, or they might not make any sense at all (e.g. if Dockers containers are used for automation).

      I think it will be useful if mongoS would have a parameter to override the ping _id value through the config file.

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            alex.komyagin Alexander Komyagin
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: