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/911d934b-530f-4b0f-86a7-177a1c557b04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to