简体   繁体   English

在Google App Engine上部署Node.js,运行两次

[英]Deploy Node.js on Google app engine, running twice issue

I wrote a small app server that I want it to keep listening on the change of the firebase database. 我编写了一个小型应用程序服务器,希望它继续监听Firebase数据库的更改。 So I tried to deploy the app on Google app engine, but the code in server ran twice. 因此,我尝试在Google App Engine上部署该应用程序,但是服务器中的代码运行了两次。 Then I checked the log of that particular app engine instance. 然后,我检查了该特定应用引擎实例的日志。 Seems like it ran the app server twice. 好像它两次运行了应用服务器。

App engine's log image: App引擎的日志图片:

1

I couldn't find a way to fix this, help! 我找不到解决此问题的方法,帮助! Thanks in advance! 提前致谢!

The repeated messages typically indicate multiple instances being started. 重复的消息通常指示多个实例正在启动。 Which can be checked on the Instances page on the Developer Console, where you can also manually stop running instances. 可以在开发人员控制台的“实例”页面上进行检查,也可以在此处手动停止运行实例。

But you also need to check the service scaling settings in your app.yaml file as that's what controls the automatic starting of instances. 但是,您还需要检查app.yaml文件中的服务扩展设置 ,因为这是控制实例自动启动的因素。

如果您想聆听Firebase的更改,则有两个选择:1)使用Firebase队列以确保当时只有一个实例执行操作2)使用云功能

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法将Node.js应用程序部署到Google Cloud App Engine - Unable to deploy node.js app to google cloud app engine 尝试将Node.js项目部署到Google App Engine时出错 - Error trying to deploy Node.js project to Google app engine Node.js “node-cron”未在 Google 应用引擎上运行 - Node.js “node-cron” not running on Google app engine 如何在用户访问应用URL时在Google App Engine上部署node.js应用以便加载? - How to deploy node.js app on Google App Engine so it loads when user goes to app URL? 如何将 Node.js 应用程序从 GitHub 部署到 Google App Engine? - How do you deploy a Node.js app from GitHub to Google App Engine? Google App Engine gcloud app deploy error [5] using Node.js - Google App Engine gcloud app deploy error [5] using Node.js 我需要在Google App Engine上运行的node.js应用程序上进行任何设置吗? - Do i need to do any settings on node.js app running on Google app engine? Google App Engine上的node.js:运行版本与package.json中指定的版本不同 - node.js on google app engine: different version running vs specified in package.json 使用Node.js在App Engine上长时间运行的流程 - Long running processes on App Engine with Node.js 部署具有Apache移植问题的Node.js应用 - Deploy Node.js app with Apache porting issue
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM