【发布时间】:2019-02-26 02:46:27
【问题描述】:
我正在尝试按照本教程部署到 GCP Compute Engine https://cloud.google.com/community/tutorials/elixir-phoenix-on-google-compute-engine
创建防火墙规则后无法连接到提供的外部 IP
遵循本教程没有错误。但创建防火墙规则后无法连接到http://${external_ip}:8080
构建版本已在 Google Cloud Storage 中
我复制hello
gsutil cp _build/prod/rel/hello/bin/hello\
gs://${BUCKET_NAME}/hello-release
而不是hello.run
gsutil cp _build/prod/rel/hello/bin/hello.run \
gs://${BUCKET_NAME}/hello-release
我的instance-startup.sh
#!/bin/sh
set -ex
export HOME=/app
mkdir -p ${HOME}
cd ${HOME}
RELEASE_URL=$(curl \
-s "http://metadata.google.internal/computeMetadata/v1/instance/attributes/release-url" \
-H "Metadata-Flavor: Google")
gsutil cp ${RELEASE_URL} hello-release
chmod 755 hello-release
wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 \
-O cloud_sql_proxy
chmod +x cloud_sql_proxy
mkdir /tmp/cloudsql
PROJECT_ID=$(curl \
-s "http://metadata.google.internal/computeMetadata/v1/project/project-id" \
-H "Metadata-Flavor: Google")
./cloud_sql_proxy -projects=${PROJECT_ID} -dir=/tmp/cloudsql &
PORT=8080 ./hello-release start
gcloud compute instances get-serial-port-output 显示
...
Feb 23 18:02:35 hello-instance startup-script: INFO startup-script: + PORT=8080 ./hello-release start
Feb 23 18:02:35 hello-instance startup-script: INFO startup-script: + ./cloud_sql_proxy -projects= hello -dir=/tmp/cloudsql
Feb 23 18:02:35 hello-instance startup-script: INFO startup-script: 2019/02/23 18:02:35 Rlimits for file descriptors set to {&{8500 8500}}
Feb 23 18:02:35 hello-instance startup-script: INFO startup-script: ./hello-release: 31: exec: /app/hello_rc_exec.sh: not found
Feb 23 18:02:39 hello-instance startup-script: INFO startup-script: 2019/02/23 18:02:39 Listening on /tmp/cloudsql/hello:asia-east1:hello-db/.s.PGSQL.5432 for hello:asia-east1: hello-db
Feb 23 18:02:39 hello-instance startup-script: INFO startup-script: 2019/02/23 18:02:39 Ready for new connections
Feb 23 18:08:08 hello-instance ntpd[656]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
hello_rc_exec.sh 在 Distillery 初始化后生成。它存储在_build/prod/rel/hello/bin/hello_rc_exec.sh
firewall rules
NAME NETWORK DIRECTION PRIORITY ALLOW DENY DISABLED
default-allow-http-8080 default INGRESS 1000 tcp:8080 False
...
我也在ps aux | grep erl的实例中运行
hello_team@hello-instance:~$ ps aux | grep erl
hello_t+ 23166 0.0 0.0 12784 1032 pts/0 S+ 08:04 0:00 grep erl
我不确定需要什么信息来解决这个问题
请务必询问信息,我会提供。 谢谢
【问题讨论】:
-
Enable billing for your project.-- 不,谢谢。 -
@7stud 哈哈哈。他们免费为您提供 1 年 300 美元。因此,您可以使用它进行开发或尝试一下
-
您必须提供信用卡或银行详细信息才能设置帐单帐户以验证您的身份... -- 免费试用,为什么他们需要知道谁我是? :(
-
@7stud 我不知道。 AWS 也是如此。以前 AWS 没有要求提供信用卡详细信息。但是现在,在注册时,您需要包含信用卡详细信息。我猜是因为人们在收到账单并创建新帐户后停止付款?哈哈哈
-
我不太清楚你想解决哪个问题,你能清楚地说明你的问题吗?
标签: google-cloud-platform elixir google-compute-engine phoenix-framework