Skip to content

How to make it work with IPs instead of DNS names? #41

@fog1985

Description

@fog1985

Hi all,

My configuration for the server look as follow:

{
"_id": "MyClusterServer2",

    "description" : "My cluster member",

    "address": "192.168.23.232:37027",
    "cmdOptions":{
        "port": 37027,
        "dbpath": "~/mongodb-data/my-cluster-server2",
        "directoryperdb": true
    }
},

for other server (closter node which is aimed to be run locally) I define "localhost" as the host.

But during run (server/cluster start) "mongoctl" produces number of errors as follow:

Unable to resolve address '192.168.132.236' for server 'MyClusterServer1'. Cause: Invalid host 'ip-192-168-132-112'. Cause: [Errno -2] Name or service not known
Unable to resolve address '192.168.132.112' for server 'MyClusterArbiter'. Cause: Invalid host 'ip-192-168-132-112'. Cause: [Errno -2] Name or service not known
Unable to determine primary server for replica set cluster 'MyCluster'

Even more complicated is that despite of that, it starts mongo instance.
But then I can't delete it:

mongoctl stop MyClusterServer1

Checking to see if server 'MyClusterServer1' is actually running before stopping it...
Unable to determine pid for server 'MyClusterServer1'. pid file '/home/ubuntu/mongodb-data/my-cluster-server1/pid.txt' does not exist
Stopping server 'MyClusterServer1' (pid=[Cannot be determined])...

Sending the following command to localhost:27017:
{
"shutdown": 1,
"force": false
}

Failed to gracefully stop server 'MyClusterServer1'. Cause: shutdown must run from localhost when running db without auth
Issue the shutdown with force command? [y/n] y

Sending the following command to localhost:27017:
{
"shutdown": 1,
"force": true
}

Failed to gracefully stop server 'MyClusterServer1'. Cause: shutdown must run from localhost when running db without auth
Cannot forcibly stop the server because the server's process ID cannot be determined; pid file '/home/ubuntu/mongodb-data/my-cluster-server1/pid.txt' does not exist.
Unable to stop server 'MyClusterServer1'.

Though server is up and running:

mongoctl status MyClusterServer1

Status for server 'MyClusterServer1':
{
"connection": true,
"serverStatusSummary": {
"connections": {
"current": 3,
"available": 419427
},
"host": "894c34d3b089",
"version": "3.2.6"
},
"selfReplicaSetStatusSummary": {
"stateStr": "SECONDARY",
"name": "192.168.132.236:27017"
}
}

Hence, everything is messed up. It somehow works, though telling me that it can't connect and actually even find other nodes.
I can't stop it at all.

Regards,
Taras.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions