This is exactly what I gave in the previous post (please refer again) -

{
  "mongoHost": "104.198.142.198",
  "mongoPort": "27017",
  "mongoDatabase": "transM",
  "mongoUser": "root",
  "mongoPass": "secret"
}

The field 'mongoHost' points to the IP address of the VM Instance of the 
mongoDB created by BITNAMI. Please read my previous post once more in 
detail.
This did not work. The authentication of Mongo failed with code-18. When I 
shifted to mlabs, and gave their hostname, it worked.

Let me know if you need any more info.

Thanks
Kriti



On Sunday, February 5, 2017 at 8:19:59 AM UTC+8, Adam (Cloud Platform 
Support) wrote:
>
> If you want the IP address of *your* MongoDB cluster that you just 
> deployed to Compute Engine using Cloud Launcher, look at the VM instances 
> in your project 
> <https://console.cloud.google.com/compute/instances?project=> to see what 
> the IP addresses are.
>
> That other doc you linked to talks about using mLab as an alternative to 
> running your own MongoDB instances, which is why it references the mLab 
> hostname *as an example*. It's important to read the wording of the 
> documentation carefully. It can be tempting to try and blaze through a 
> tutorial to get something working, but details are important.
>
> If you are still getting an error in stderr, please post the full error 
> message so that people can be properly enabled to help you, otherwise we 
> must assume that you've interpreted the error correctly.
>
> On Friday, February 3, 2017 at 11:48:42 PM UTC-5, Kriti das wrote:
>>
>> I have deployed the MongoDb using the Google cloud Launcher and BITNAMI. 
>> I got the username and password from the deployment console. 
>>
>> I used the keys.json for the credentials in nodejs application -
>>
>> {
>>   "mongoHost": "104.198.142.198",
>>   "mongoPort": "27017",
>>   "mongoDatabase": "transM",
>>   "mongoUser": "root",
>>   "mongoPass": "secret"
>> }
>>
>> My App.js -
>>
>> const username = nconf.get('mongoUser');
>> const pass = nconf.get('mongoPass');
>> const host = nconf.get('mongoHost');
>> const port = nconf.get('mongoPort');
>>
>> let uri = `mongodb://${username}:${pass}@${host}:${port}`;
>>
>> if (nconf.get('mongoDatabase')) {
>>   uri = `${uri}/${nconf.get('mongoDatabase')}`;
>> }
>>
>> console.log(uri);
>>
>> mongoose.connect(uri);
>> var db = mongoose.connection;
>> db.on('error', console.error.bind(console, 'connection error:'));
>> db.once('open', function () {
>>     // we're connected!
>>     console.log("Connected correctly Database to server");
>> });
>>
>>
>> The stderr log shows Authentication fails. But when I try remote 
>> connection using the same in terminal -
>>
>> mongo admin --username root -p --host 104.198.142.198 --port 27017
>>
>>
>> it lets me log in.
>>
>>
>> Please note -
>>
>>
>> In the example by google the mlabs hostname is used -
>>
>>
>> https://cloud.google.com/nodejs/resources/databases/mongodb
>>
>> {
>>   "mongoHost": "ds053894.mlab.com",
>>   "mongoPort": "53894",
>>   "mongoDatabase": "mydata",
>>   "mongoUser": "myapp",
>>   "mongoPass": "mypword",
>> }
>>
>>
>>
>> {
>>   "mongoHost": "ds053894.mlab.com",
>>   "mongoPort": "53894",
>>   "mongoDatabase": "mydata",
>>   "mongoUser": "myapp",
>>   "mongoPass": "mypword",
>> }
>>
>> Can you please help to get the correct host name for BITNAMI Mongo 
>> instance.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/65227751-102a-4ad6-ad1a-fa168bd9ebe8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to