部署具有弹性青苗一个.NET工人的应用程序 [英] Deploying a .NET worker app with Elastic Beanstalk

查看:149
本文介绍了部署具有弹性青苗一个.NET工人的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用AWS基础设施更广泛的Web应用程序。它有两个工人组件从SQS读取工作,并把结果写入到一个RDS数据库。其中之一是Python和我已经有了这方面的工作在一个弹性魔豆实例。第二个使用.NET和我目前的工作如何部署它。对于生产,既将弹性处理多个实例。

I am working on a wider web application using AWS infrastructure. It has two 'worker' components which read work from SQS and write the results to an RDS database. One of these is Python and I already have this working on a single Elastic Beanstalk instance. The second uses .NET and I am currently working out how to deploy it. For production, both will be elastic with multiple instances.

由于这些处理组件不是Web应用程序(即不响应HTTP请求),我必须明确地启动它们关闭。对于Python的例子,我用的是.ebextensions文件:

As these processing components are not web applications (i.e. they do not respond to http requests), I have to explicitly start them off. For the Python example, I use the .ebextensions file:

container_commands:
  02-start-command:
    command: "nohup python scannerapp.py > foo.out 2> foo.err < /dev/null &"
    leader_only: false

我如何做同样的.NET应用程序? 正如上面的Python / Linux的例子,Windows配置文件支持命令和集装箱命令,但这些都是用于启动程序(如安装程序)。 IE浏览器。启动/安装未完成之前,该命令将退出。 nohup命令解决了Python的问题。如何做到这一点与.NET应用程序的工人?

How can I do the same with a .NET application? As with the above Python/Linux example, the Windows configuration file supports 'Commands' and 'Container Commands' but these are intended for startup programs (e.g. installers). Ie. startup/installation does not complete until the command exits. The nohup command solves the problem for Python. How do I do this with a .NET worker application?

或者是太困难了,我应该考虑移植首先要单声道和使用的Linux的选项之一? (MONO运行成本预计将更具成本效益,因此它已经待办事项列表在未来的)

Or is it too difficult, and I should consider porting to MONO first and using one of the Linux options? (MONO running costs are expected to be more cost effective, so it is already on the to-do list for the future)

推荐答案

您可以做同样的事情,与.NET的容器。你将不得不安装的工人作为Windows服务。看看这个<一href="http://blogs.aws.amazon.com/net/post/Tx1RLX98N5ERPSA/Customizing-Windows-Elastic-Beanstalk-Environments-Part-1"相对=nofollow>博客文章,这也解释得很详细。在高电平,你将有一个.ebextensions文件,它包含:

You can do the same thing with the .NET container. You would have to install your worker as a Windows service. Check out this blog post, which explains it in detail. At the high level you would have an .ebextensions file that contains:

sources:
  c:/AppSupport/MyAppJanitor: http://s3.amazonaws.com/my-app-support/MyAppJanitor.zip
commands:
  install-janitor:
    command: C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\installutil MyAppJanitor.exe
    cwd: c:/AppSupport/MyAppJanitor
    waitForCompletion:0
services:
  windows:
    MyAppJanitor:
      enabled: true
      ensureRunning: true
      commands: install-janitor

这篇关于部署具有弹性青苗一个.NET工人的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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