通过脚本在Microsoft群集中创建私有MSMQ队列 [英] Creating a private MSMQ queue in a Microsoft Cluster via a script

查看:119
本文介绍了通过脚本在Microsoft群集中创建私有MSMQ队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在迁移到Windows 2008 R2 Standard,并将使用Microsoft群集(主动-被动)配置.我们的应用程序严重依赖于MSMQ专用队列,我们​​的安装使用以下C#代码创建了100多个专用队列.

MessageQueue.Create(.\ private $ \ myqueue",false);

由于安装未在集群上下文中运行,因此队列是在本地节点上创建的,而不是在集群中创建的.

然后我们尝试将代码更改为:

MessageQueue.Create("MYCLUSTERNAME \ private $ \ myqueue",false);

但是,您不能在其他服务器(在本例中为群集服务器上下文)上创建专用队列,并且会收到错误消息无效的队列路径名".

我的两个问题是: 1)有没有一种方法可以在群集的上下文中运行安装,以便在创建专用队列时,它实际上是在群集中创建队列?

2)如果不是,那么通过.NET在集群中创建队列的最佳方法是什么?我读过一些博客,人们在其中创建了一个驻留在群集内的中间人Windows服务,然后他们的安装使用进程间通信来告知该服务要创建的队列.这似乎是一种hack,但是如果事实证明这是唯一的方法,那是可行的.

解决方案

以下是如何在群集实例上手动进行操作. (不是通过代码)

仅在活动节点上,创建必要的MSMQ队列.

a.单击开始",右键单击命令提示符",然后单击以管理员身份运行".

b.在命令提示符下,输入以下命令(其中{virtualname}是实例的名称.)

    i.  SET _CLUSTER_NETWORK_HOSTNAME_={virtualname}

   ii.  SET _CLUSTER_NETWORK_NAME_={virtualname}

  iii.  Compmgmt.msc

c.现在,已经从与变量相同的命令提示符处启动了计算机管理,看起来您正在本地进行更改,但实际上是在集群实例中进行了更改.

d.展开服务和应用程序.

e.展开消息队列.

f.右键单击专用队列",然后单击新建专用队列".

g确认创建位置:"是虚拟名称.

h.在队列名称:private $ \字段中,放入队列名称,然后单击确定按钮.

i.关闭计算机管理.

这适用于Windows 2008 R2

We are migrating to Windows 2008 R2 Standard and will be using a Microsoft Clustering (active-passive) configuration. Our application is heavily dependent on MSMQ private queues and our install creates well over 100 private queues using the following C# code.

MessageQueue.Create(".\private$\myqueue", false);

Since the install is not running inside the context of the cluster, the queues are created on the local node and not in the cluster.

We then tried changing the code to:

MessageQueue.Create("MYCLUSTERNAME\private$\myqueue", false);

However, you can't create private queues on a different server (in this case the cluster server context) and you receive the error "Invalid queue path name".

My two questions are: 1) Is there a way I can run the install in the cluster's context so that when creating a private queue, it would actually be creating the queue in the cluster?

2) If not, what's the best approach on creating queues in the cluster via .NET? I've read some blogs where people create a middle-man Windows service that resides inside the cluster and then their install uses interprocess communication to tell the service which queues to create. That seems like a hack, but is doable if that turns out to be the only approach.

解决方案

Here is how to do it manually on the clustered instance. (Not via code)

ON THE ACTIVE NODE ONLY, Create the necessary MSMQ Queues.

a. Click Start, right click on Command prompt and click Run as administrator.

b. In the command prompt enter the following commands (Where {virtualname} is the name of the instance.)

    i.  SET _CLUSTER_NETWORK_HOSTNAME_={virtualname}

   ii.  SET _CLUSTER_NETWORK_NAME_={virtualname}

  iii.  Compmgmt.msc

c. Now that computer management has been started from the same command prompt as the variables, it will look like you are making changes locally, but you are actually changing them in the clustered instance.

d. Expand Services and Applications.

e. Expand Message Queuing.

f. Right Click on Private Queues and click New, Private Queue.

g. Verify that the Create in: is the virtual name.

h. In the Queue name: private$\ field put in the queue name and click the OK button.

i. Close Computer Management.

This worked on Windows 2008 R2

这篇关于通过脚本在Microsoft群集中创建私有MSMQ队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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