在Azure云服务工作者的角色设置的Redis [英] Setting up Redis on Azure cloud service worker role
问题描述
我创建一个云服务,我有一个工作者角色在后台运行一些繁重的处理,这也是我喜欢的Redis实例上本地工人运行。
I'm creating a cloud service where I have a worker role running some heavy processing in the background, for which i would like a Redis instance to be running locally on the worker.
我想要做的是建立在Redis的实例安装方式辅助角色的项目是什么/当工人部署配置。
What i want to do is set up the worker role project in a way that the Redis instance is installed/configured when the worker is deployed.
Redis的数据库将在每一项工作启动时被清除。
The redis database would be cleared on every job startup.
我看了看 MSOpenTech Redis的与安装的NuGet窗户,但我不能确定如何我会得到的工人角色实例这个工作。有没有办法将它设置一个聪明的办法,还是会通过命令行电话?
I've looked at the MSOpenTech redis for windows with nuget installation, but i'm unsure how i would get this working on the worker role instance. Is there a smart way to set it up, or would it be by command-line calls?
感谢。
推荐答案
要安装一个辅助角色实例的任何软件,你需要设置此发生作为启动任务。
To install any software on a worker role instance, you'd need to set this up to happen as a startup task.
您将在您的ServiceDefinition.csdef中文件中引用启动任务,在<启动>
元素,为您的命令文件的引用将安装任何你想要的软件(如Redis的)。
You'll reference startup tasks in your ServiceDefinition.csdef file, in the <Startup>
element, with a reference to your command file which installs whatever software you want (such as Redis).
我还没有尝试在辅助角色实例安装Redis的,所以我不能对是否会成功发表评论。而且你还需要担心打开右侧的端口(无论是外部 - 或面向内部)和缩放(例如,当你扩展到两个工作角色实例,对运行的Redis会发生什么?)。我的回答是具体到如何在一个角色实例安装软件。
I haven't tried installing Redis in a worker role instance, so I can't comment about whether this will succeed. And you'll also need to worry about opening the right ports (whether external- or internal-facing), and scaling (e.g. what happens when you scale to two worker role instances, both running redis?). My answer is specific to how you install software on a role instance.
更多信息是这里。
这篇关于在Azure云服务工作者的角色设置的Redis的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!