title: Unable to start MongoDB shell for mongos daemon
body: <p>I am trying to setup a sharded mongodb cluster using 4 solaris-11 servers which are on the same rack. The following sharded config is being attempted:</p>
  
  <ul>
  <li>Server A : Replica set 1(rs1)</li>
  <li>Server B : Replica Set 2(rs2) </li>
  <li>Server C : Configuration Server </li>
  <li>Server D : Sharding Router</li>
  </ul>
  
  #
  
  <p>On Server A, rs1 has been set up as follows:
  mongod --port 27017 --replSet rs1 --dbpath "/mongo/datadb"</p>
  
  <p>Now the rs1 configuration in mongo shell:</p>
  
  <blockquote>
    <p>config =
    {
        _id:"rs1",
        members:
        [
            { _id:0, host:"Server A IP:27017" },
        ]
    }
    rs.initiate( config )</p>
    
    <p>rs.conf()</p>
    
    <p>rs.status()</p>
  </blockquote>
  
  <p>On Server B , rs2 has been similarly configured.</p>
  
  #
  
  <p>On Server C, the config server has been configured as follows:</p>
  
  <p>mongod --configsvr --port 37017 --dbpath "/rpool/mongo/datadb"</p>
  
  #
  
  <p>Now on Server D, I am running mongos using the following :</p>
  
  <p>mongos --port 27017 --configdb rs1/'Server C IP':37017</p>
  
  <p>When I am trying to open mongo Shell on server D to add the shards using the mongos port and connect to mongos, I am unable to do so. The following error is thrown :</p>
  
  <p>**./mongo --port 27017 --host 'Server C '</p>
  
  <p>MongoDB shell version v3.4.1
  connecting to: mongodb://'Server C ip':27017/
  2017-11-09T11:21:51.666+0000 W NETWORK  [main] Failed to connect to :27017, in(checking socket for error after poll), reason: Connection refused
  2017-11-09T11:21:51.686+0000 E QUERY    [main] Error: couldn't connect to server 'Server C ip':27017, connection attempt failed :
  connect@src/mongo/shell/mongo.js:234:13
  @(connect):1:6
  exception: connect failed**</p>
  
  <p>When I tried to debug, I found the port 27017 on Server C to be in 'BOUND' state:</p>
  
  <p><strong>netstat -an |grep 27017
        *.27017              <em>.</em>                  0      0  128000      0 BOUND</strong></p>
  
  <p><strong>'Server ip' stream-ord server ip' 0000000000000000 /tmp/mongodb-27017.sock</strong></p>
  
  <p>Shouldn't mongos occupy this port in Listening mode? Can someone help me in solving this?</p>
  
  <p>Is there any issue with the configuration?</p>