立即将Java和node.js项目上载到Google AppEngine [英] Upload a Java and node.js project to Google AppEngine at once

查看:125
本文介绍了立即将Java和node.js项目上载到Google AppEngine的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

起初,我在AndroidStudio中设置了一个Java-Module,并将其上传到我的GoogleAppEngine服务器,该服务器运行良好。 (Android Studio - 为Google App Engine构建-Deploy模块)



现在我还想将additioanl node.js服务器上载到同一个App Engine实例。代码还应该访问在Java模块中创建的firebase数据库。为了上传node.js代码,我使用 gcloud app deploy 来跟踪Googles QuickStart教程。



据我所知,这会创建这是后端flex环境中的一个新版本,禁用了我现有的Java代码。

所以我的问题是:如何将node.js服务器添加到现有实例?我想我必须在Android Studio项目中执行此操作,但不能在 gcloud app deploy 内执行此操作。如何创建一个新的模块,以便node.js服务器可用于子文件夹然后举例?

无法上传额外的node.js服务器到同一个App Engine实例,因为它是一种不同的语言(和环境),因此它们不能在同一个服务/模块中(一个实例只能执行代码一个模块)。

您需要以不同的方式命名服务/模块,以便在部署时不会相互覆盖。在这之后,他们可以独立部署。



检查您的服务: node.js模块的 app.yaml code> 文件。从
常规设置


service:service_name

创建服务时需要。可选的默认服务。每个
服务和每个版本都必须有一个名称。名称可以包含数字,
字母和连字符。它不能超过63个字符,
不能以连字符开始或结束。为每个
服务和每个版本选择一个唯一的名称。请勿在服务和
版本之间重复使用名称。



注意:以前称为模块。


而您的 module 和/或 service 在您的java模块的 appengine-web.xml 文件。



另请参阅 Google App Engine上的微服务体系结构


At first I have a Java-Module set up in AndroidStudio that I upload to my GoogleAppEngine server which works pretty good. (Android Studio - Build -Deploy Module to Google App Engine)

Now I also want to upload an additioanl node.js server to the same App Engine instance. The code shall also access the firebase databases, that were created in the Java module. To uplaod the node.js code I followed Googles QuickStart tutorial using gcloud app deploy.

As I know this creates a new version in the backends flex environment disabling my existing Java Code.

So my questions is: How can I add a node.js server to my existing Instance? I guess I have to do this within the Android Studio project then but not within gcloud app deploy. How can I create a new module such that the node.js server is available on a subfolder then for instance?

解决方案

You won't be able to "upload an additional node.js server to the same App Engine instance" because it's a different language (and environment), thus they can't be in the same service/module (an instance can only execute code from one module).

You need to name the services/modules differently so that they don't overwrite each-other at deployment time. After that they can be deployed independently.

Check your service: configuration in the node.js modules's app.yaml file. From General settings:

service: service_name

Required if creating a service. Optional for the default service. Each service and each version must have a name. A name can contain numbers, letters, and hyphens. It cannot be longer than 63 characters and cannot start or end with a hyphen. Choose a unique name for each service and each version. Don't reuse names between services and versions.

Note: Services were previously called "modules."

And your module and/or service configs in your java module's appengine-web.xml file.

See also Microservices Architecture on Google App Engine

这篇关于立即将Java和node.js项目上载到Google AppEngine的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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