I am trying to deploy a nodejs application in the google cloud, I posted some questions about the problems I was getting and how to fix them. Let me illustrate my efforts ...
problem 1) I tried to run a tutorial application hello world deployment. When I entered the deployment command,
$ gcloud preview app deploy app.yaml --set-default
This gave me a message stating that managed vms are not available for your application region. I contacted someone from Google, a representative of Google technical support, said that his name was Ling, and he said that he “did not know that managed vms are not supported in India,” and he wanted me to indicate where I found this information. So I sent him, pay attention to one of the answers. OK .....
problem 2) So, I'm stuck, did not know what to do. I searched “how to deploy the nodejs application in the Google Cloud” and found a video in which the Google developer told me that there are “two main ways to run the application in the cloud, infrastructure as a service and platform as a service”. Running it on an application platform was a platform as a service, and it was not on the list, so I went with my only remaining option. There is a textbook, a textbook on the bookshelf , as well as google, and the last part describes how to run the application on a computing engine. I tried to go through the tutorial, but when I entered the command
git push cloud 7-gce:master
in order to push my code to the repository, he asks me about my username and password. He never mentioned that in the textbook I do not know what to introduce. I found this question , but I'm not sure if this applies to my situation. So, I got acquainted with some tutorials suggested by Zachary Newman, and I couldn’t follow the tutorial where they use ubuntu, because when they tell you the hello.js file, this is really strange, because I had to ssh into the ubuntu vm image, which I created and everything was very slow, I am not familiar with the commands on linux, so I had to look for “save and exit” after creating the hello.js file. I got a “web server” to run, this is a reverse proxy nginx server, but since I don’t know what APP_PRIVATE_IP_ADDRESS is, when I accessed the page, I could see the nginx page, but not the message “hello world” should be displayed. Please see the Prerequisites heading to find out what my tutorial taught. OK ....
problem 3) In the Google developer console after logging in there is a navigation section on the left, there is a link to "Cloud Launcher", There I found a link for creating a virtual machine with installed nodejs created by Bitnami. I clicked it and my vm was running, I went to the external IP address provided, and saw the “Congratulations” page (ugh ...) in Bits. I did not know what to do next, so I posted another question. The bitnami developer told me that I need to copy the files to a remote repository, create the configuration files, and then you must include this configuration in the Apache configuration to serve the application. "How?!?! He just posted a link to the bitnami wiki page . I used filezilla to connect to my vm, and I tried to load the application files into vm. I managed to load everything except the node modules (they took too long to load, and for some reason the ftp client continued to lose connection with the server after 10 minutes or so). So I thought th I will simply ssh in the instance and try to install npm my addiction. But it gave me more errors ...
problem 4) I do not know why this post was suspended, but I found this . I cannot find the exact page right now, but I read somewhere in google docs that we cannot use ssh in the instance as root / administrator by design, and that we have to do some advanced configuration in order to be able to do this. The PROBLEM is that I can’t install the dependencies if I don’t go down as an administrator ...: '(So I just downloaded my node modules with filezilla. Everything looks fine, I ssh in my instance and I cd in application directory and enter the command
node app.js
and almost as if mocking me, he turns off the logs "connected to mongo ...." and "Listening on port 3000 .....". I'm so excited, I think it works .....
problem 4) The server never started, I think it could not connect to the mongodb database (another instance) in which I was working, it was a command to connect to the mongodb instance in the app.js file
mongoose.connect('mongodb://****/myappdatabase');
where **** indicates the external IP address of my mongodb instances. After about 5 minutes, I get an error message in the ssh browser
Error: connect ETIMEDOUT ****:27017
BUT WHO TIME TO READ ALL THIS RIGHT?
I am not a developer, I do not have much programming experience (close to zero). I am a lover. I took a book on programming in stephen g. kochan about 5 or 6 months ago, and since then I just read textbooks on the Internet, programming in a java book and some reference materials. I wanted to create a website.
I learned some html, css, javascript and jquery outside of w3schools and went through several tutorials on creating a basic node server and serving some html pages, which is literally my whole application. That is all I want.
I used the express framework for node and mongoose to connect to my mongodb working locally. Socket.io for a small number of networks. I created a website for fun, and I would really like to post it and share it with friends, I did it this far, it would be really awkward to quit now because I can not host the site. By the way, I went a lot more than what I wrote on this subject.
Now I would really appreciate some help, even for what I need to know, maybe the books I should read, or the documentation I have to go through to get a better understanding of website hosting, would be great. I am going to offer this question for generosity in 2 days, but until then, if someone who has gone through this and would like to help without personal gain will save my life. I'm going for about 4 days with no luck. Thank you and let me know if there is anything you would like to know about my application. I mean seriously how much this can be, I'm doing something (or all) terribly wrong.