在端口8761上的appengine上部署应用程序 [英] deploy app on appengine on port 8761

查看:137
本文介绍了在端口8761上的appengine上部署应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在部署在端口8761上运行的Java应用程序,并且在本地主机上运行良好。

尽管当我推送到App Engine灵活环境时,出现HTTP 502服务器错误。



这是我的 app.yaml

 运行时:java 
env:flex

服务:eureka

runtime_config:
jdk:openjdk8

处理程序:
- url:/.*
脚本:忽略
安全:总是

manual_scaling:
实例:1

资源:
cpu:1
memory_gb:2

日志从gcloud很好,服务器正在运行,但我的请求似乎并没有击中应用程序。

我注意到,如果我在端口8080上运行,它可以工作。现在,这不是一个问题,将默认端口更改为8080,但我想了解为什么我无法在8761上运行它。

解决方案

我认为您需要使用 app.yaml 配置文件中的网络设置部分

  network:
forwarded_ports:
- 8761 / tcp

您可能还需要在Cloud Platform Console中设置防火墙规则


I'm deploying a Java app that runs on port 8761, and works fine on localhost.
Although when I push to App Engine flexible environment, I get a HTTP 502 server error.

Here is my app.yaml:

runtime: java
env: flex

service: eureka

runtime_config:
  jdk: openjdk8

handlers:
- url: /.*
  script: ignore
  secure: always

manual_scaling:
  instances: 1

resources:
  cpu: 1
  memory_gb: 2

The log from gcloud is fine, server is running, but my request doesn't seems to hit the app at all.

I noticed that if I run on port 8080, it works. For now, it is not a problem change the default port to 8080, but I would like to understand why I'm not able to run it on 8761

解决方案

I think you need to use the network settings section in the app.yaml config file:

network:
  forwarded_ports:
    - 8761/tcp

You might also need to set firewall rules in the Cloud Platform Console.

这篇关于在端口8761上的appengine上部署应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆