I said on title "migrating", so this is full working production Node.js app on other VM.
I'm trying to deploy my app to Google Cloud with the same working bundle and the same server spec and configuration on other VM. When I start my app, I've got following error:
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EADDRNOTAVAIL
at errnoException (net.js:905:11)
at Server._listen2 (net.js:1024:19)
at listen (net.js:1065:10)
at net.js:1147:9
at dns.js:72:18
at process._tickCallback (node.js:448:13)
This is environment variable on current VM:
export MONGO_URL="mongodb://db-user:db-password@db-ip-address:27017/db-name"
export ROOT_URL="https://myapp.com"
export BIND_IP="server-ip-address"
export PORT="80"
This is environment variable on Google Cloud:
export MONGO_URL="mongodb://db-user:db-password@db-ip-address:27017/db-name"
export ROOT_URL="https://myapp.com"
export BIND_IP="external-ip-address"
export PORT="80"
Any help would be appreciated
Using internal ip address get rid the error, but now the app cannot be accessed.
export BIND_IP="internal-ip-address"
ADDITIONAL NOTE
Instance configuration:
gcloud compute instances create "my-app" --machine-type "f1-micro" --image-family "centos-7" --image-project "centos-cloud" --address "assigned-static-external-ip-address" --can-ip-forward