什么是创建一个单一的服务器上运行的应用程序meteor.js的多个实例所需的主要步骤是什么? [英] what are the major steps required to create multiple instances of a meteor.js application running on a single server?

查看:266
本文介绍了什么是创建一个单一的服务器上运行的应用程序meteor.js的多个实例所需的主要步骤是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经设计了一个meteor.js应用程序,它在本地主机上,甚至在部署到互联网的伟大工程。现在我想创建一个登录了网站,将分拆为谁在后端签约每个客户端应用程序的新实例。假定为在注册站点meteor.js应用程序和Python或JavaScript,步骤所需要的高层次采取实现这个?

I have designed a meteor.js application and it works great on localhost and even when deployed to the internet. Now I want create a sign-up site that will spin up new instances of the application for each client who signs up on the back-end. Assuming a meteor.js application and python or javascript for the sign-up site, what high level steps need to be taken to implement this?

我要寻找一个更正确和完整的答案,它利用我的想象不好这个版本的形式:

I am looking for a more correct and complete answer that takes the form of my poorly imagined version of this:


  1. 使用类似的节点或Python来调用可能会或可能不会作为须藤运行一个shell脚本

  2. 那脚本可能会创建一个新的文件夹来保存实例的具体的东西(像客户端文件,配置,和或实例数据库)。

  3. 脚本或Python code将应用程序部署到该文件夹​​和一个特定端口
  4. 在实例
  5. 的Python可能会增加配置信息,如镑一个工具一个子转发到端口

  6. 其他的事情....!?

  1. Use something like node or python to call a shell script that may or may not run as sudo
  2. That script might create a new folder to hold instance specific stuff (like client files, config, and or that instances database).
  3. The script or python code would deploy an instance of the application to that folder and on a specific port
  4. Python might add configuration information to a tool like Pound to forward a subdomain to a port
  5. Other things....!?

我真的不明白,这里需要考虑,所以如果有人能提供这些步骤,甚至做一些有用的工具和教程,所以我会非常感激的高级步骤。

I don't really understand the high level steps that need to be taken here so if someone could provide those steps and maybe even some useful tools or tutorials for doing so I'd be extremely grateful.

推荐答案

让我先此话,我认为纺纱多个实例相同的应用程序是一个糟糕的设计选择。如果它是一个权宜措施,这里是我建议:


  1. 创建一个可以很容易地部署存档。 (捆绑应用程序,如果需要重新安装光纤,重新压缩)。使用脚本创建一个新的实例时部署(解压缩)归档到一个新的文件夹。

  1. Create an archive that can be readily deployed. (Bundle the app, reinstall fibers if necessary, rezip). Deploy (unzip) the archive to a new folder when a new instance is created using a script.

创建一个初始化脚本的模板,永远使用或以进程或耶稣等,开始在重新启动该网站,并在正常运行期间保持了网站。见<一href=\"http://stackoverflow.com/questions/14867703/meteor-deploying-to-a-vm-by-installing-meteor\">Meteor通过安装流星或<一个部署到虚拟机href=\"http://stackoverflow.com/questions/4903570/how-does-one-start-a-node-js-server-as-a-daemon-process\">How只做一开始的node.js服务器作为一个守护进程?的例子。当一个新的实例被部署填充新值(即端口号,数据库名称,文件夹)的模板。在填写模板复制到init.d中并链接到运行级别。另外,在该init.d中执行其它脚本来打开该网站创建一个脚本。

Create a template of an init script and use forever or daemonize or jesus etc to start the site on reboot and keep the sites up during normal operation. See Meteor deploying to a VM by installing meteor or How does one start a node.js server as a daemon process? for examples. when a new instance is deployed populate the template with new values (i.e. port number, database name, folder). Copy the filled out template to init.d and link to the runlevel. Alternatively, create one script in init.d that executes other scripts to bring up the site.

每个实例应该听自己的端口,因此你需要一个反向代理。据我所知,Apache和Nginx的要求重新启动时更改配置,所以你可能想看看Hipache https://开头github.com/dotcloud/hipache 。 Hipache使用redis的存储的配置信息。添加新的实例,需要添加一键Redis的。有带来的功能的Nginx https://github.com/samalba/hipache- Hipache的实验端口nginx的

Each instance should be listening to its own port, so you'll need a reverse proxy. AFAIK, Apache and Nginx require restarts when you change the configuration, so you'll probably want to look at Hipache https://github.com/dotcloud/hipache. Hipache uses redis to store the configuration information. Adding the new instance requires to add a key to redis. There is an experimental port of Hipache that brings the functionality to Nginx https://github.com/samalba/hipache-nginx

有关DNS更新什么?一旦创建了新的实例,你需要一个新的记录添加到您的DNS配置?

What about DNS updates? Once you create a new instance, do you need to add a new record to your DNS configuration?

这篇关于什么是创建一个单一的服务器上运行的应用程序meteor.js的多个实例所需的主要步骤是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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