0

Following Google-Parse tutorial to deploy Node.js with MongoDB

https://cloud.google.com/nodejs/resources/frameworks/parse-server

results in Node.js error:

connect ECONNREFUSED 127.0.0.1:27017

Node.js errors are in https://console.cloud.google.com/logs at App-Engine-Service stderr

3 Answers3

0

VM instances

Name                Internal IP
mongodb-1-arbiter-1 10.128.0.3
mongodb-1-server-1  10.128.0.4

Changed mongo uri to point to mongo arbiter node, redeployed app and got following error

not master and slaveOk=false

Node.js connects to server, but question is will internal ip change when node is restarted ?

  • In your original question it appears you had trouble connecting to the right port on the right machine. Now it appears you have some other error, after correctly connecting to [port 27017](https://docs.mongodb.com/v3.2/reference/default-mongodb-port/) on the arbiter. On Stack Overflow you shouldn't continue to ask questions in an answer, and you should post a new question with enough information for users to work on the new problem. – Nick May 10 '16 at 13:18
  • It seems that in trying to follow the tutorial, you might be missing an understanding of how the system is meant to work. The error you saw comes from attempting to read from a replica instance, not from the primary. You can enable this, but it comes with caveats. – Nick May 10 '16 at 20:51
  • how about answering question? – Isaak Osipovich Dunayevsky May 11 '16 at 06:24
  • This isn't how stackoverflow works, it should be one question per Q&A. You self-answered your original question with an answer *and* a new question. If you read my second comment I did go some way to answering the question raised by the error message you saw. You can find out more by googling the error message. As to whether the internal IP will change when node is restarted, that really depends on what you mean by that, which internal IP? Why would restarting the node process change the IP of a computer? You need to ask more specific technical questions to get adequate answers. – Nick May 11 '16 at 16:52
  • I'm asking about Node.js + MongoDB on Google AppEngine, and you keep giving long advices not relevant to the question – Isaak Osipovich Dunayevsky May 12 '16 at 04:47
  • http://stackoverflow.com/questions/30088833/strange-mongodb-and-mongoose-error-not-master-and-slaveok-false-error @IsaakOsipovichDunayevsky – Serhan Oztekin May 12 '16 at 09:17
  • I'm definitely doing my best to answer your questions in each of my comments, as any third-party reading these comments would notice. The question you linked 14 hours ago says the same that I had said: this issue comes when attempting to read from a replica, not the primary. It's a good habit to search the internet for error messages since others have usually encountered them before, as was the case here. – Nick May 12 '16 at 23:46
0

Continuing with Parse.com to Google AppEngine (GAE) migration tutorial, it turns out that GAE has file size limit.

Error: Request Entity Too Large

Your client issued a request that was too large.

A Note to prevent anyone from repeating same mistakes, it isn't explicitly said on GAE website.

Community
  • 1
  • 1
  • Could you give details on exactly how you observed this error? As it is, you just say that continuing, you encountered it. What did you do to trigger the error? How was it displayed? – Nick May 12 '16 at 23:47
  • It's also worth mentioning that this question has now come to encompass three distinct issues, which is not the way Stack Overflow should be used. The site's format encourages clear, distinct questions which can be answered in a finite space. You should post new questions when you encounter new problems, since both of the answers on this question aren't actually answers to the original question. At best you should use comments or editing to follow an expanding issue, but even still, properly speaking, the original issue has already been resolved. – Nick May 12 '16 at 23:53
0

This could be due to many problems, Here are a couple of solutions:-

  1. You have not mentioned a database to connect to. If this is the problem, your connection URI will look like this: mongodb://127.0.0.1:27017You should change it to this: mongodb://127.0.0.1:27017/foobar

  2. You have mentioned localhost in your connection URI. If this is the problem, your connection URI will look like this: mongodb://localhost:27017/foobar You should change it to this: mongodb://127.0.0.1:27017/foobar

  3. You have not mentioned a port. If this is the problem, your connection URI will look like this: mongodb://127.0.0.1/foobar It should change to look like this mongodb://127.0.0.1:27017/foobar

If there is a problem that I have missed, please do feel free to point it out.