Amit
Amit

Reputation: 656

MongoDB node creation on AWS

I am new to MongoDB as well in AWS. I am trying to create a node for out an existing mongodb cluster on AWS. After the AWS node is started i was trying to add it into the cluster but is getting 'response status: AuthenticationFailed: Authentication failed.'

  1. So I disabled the auth configuration in mongod.conf which now looks like :

    security:
    #clusterAuthMode: keyFile
    #keyFile: /data/db/mongodb/dory.keyfile
    authorization: disabled

  2. We are using SSL(which doesn't seems to be an issue as we have configuration for that in mongod.conf and has been taken care off) and our exiting mongodb instance is hosted on unix

My question : What am i missing here?All mongoDB support docs mentioned creation of a admin/super user on first use ...i tried that but got same error. Is there a default user (master user and password) created by AWS for initial connection?

Upvotes: 0

Views: 44

Answers (1)

Amit
Amit

Reputation: 656

Turns out the issue was partly AWS and more of mongoDB one:

  1. On AWS end every new build was using the same mount from old build as it was marked as persistent ...this allows you to deploy a new build without loosing all the data. Although this is the desired behavior but not until the setup is good. So we destroyed old builds and deployed a new build with auth changes.
  2. We need to enable the auth configuration in mongod.conf and make sure that the keyfile is same across all the deployments/nodes

    security: clusterAuthMode: keyFile
    keyFile: /data/db/mongodb/dory.keyfile
    authorization: enabled

Upvotes: 1

Related Questions