views:

253

answers:

3

Update: Ok, after getting past the fact that I did not have MSDTC set up as a cluster resource (doh!), I was able to run my program and all appeared well, but I was not able to successfully send messages to it. After digging I found that while the private queues were created on one node of the cluster, they were not on the other node (I was running NServiceBus.Host.exe from a command prompt), and thus were not visible to applications using the cluster name. I tried creating a Generic Application out of NServiceBus.Host.exe and adding it to the Cluster group, but that just brought the cluster group down. My question is still: Has anyone successfully run NServiceBus in a clustered environment?


I am trying to install NServiceBus onto a clustered win2k3 host. The configuration utility provided (runner.exe) throw some errors that I did not catch, and it now runs correctly. When running NServiceBus.Host.exe i am get this error repeatedly:

System.Transactions.TransactionAbortedException: The transaction has aborted. ---> System.Transactions.TransactionManagerCommunicationException: Communication with the underlying transaction manager has failed. ---> System.Runtime.InteropServices.COMException (0x8004D01B): The Transaction Manager is not available. (Exception from HRESULT: 0x8004D01B) at System.Transactions.Oletx.IDtcProxyShimFactory.ConnectToProxy(String nodeName, Guid resourceManagerIdentifier, IntPtr managedIdentifier, Boolean& nodeNameMatches, UInt32& whereaboutsSize, CoTaskMemHandle& whereaboutsBuffer, IResourceManagerShim& resourceManagerShim) at System.Transactions.Oletx.DtcTransactionManager.Initialize() --- End of inner exception stack trace --- at System.Transactions.Oletx.OletxTransactionManager.ProxyException(COMException comException) at System.Transactions.Oletx.DtcTransactionManager.Initialize() at System.Transactions.Oletx.DtcTransactionManager.get_ProxyShimFactory() at System.Transactions.Oletx.OletxTransactionManager.CreateTransaction(TransactionOptions properties) at System.Transactions.TransactionStatePromoted.EnterState(InternalTransaction tx) --- End of inner exception stack trace --- at System.Transactions.TransactionStateAborted.CheckForFinishedTransaction(InternalTransaction tx) at System.Transactions.EnlistableStates.Promote(InternalTransaction tx) at System.Transactions.Transaction.Promote() at System.Transactions.TransactionInterop.ConvertToOletxTransaction(Transaction transaction) at System.Transactions.TransactionInterop.GetDtcTransaction(Transaction transaction) at System.Messaging.MessageQueue.StaleSafeReceiveMessage(UInt32 timeout, Int32 action, MQPROPS properties, NativeOverlapped* overlapped, ReceiveCallback receiveCallback, CursorHandle cursorHandle, IntPtr transaction) at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType) at System.Messaging.MessageQueue.Receive(TimeSpan timeout, MessageQueueTransactionType transactionType) at NServiceBus.Unicast.Transport.Msmq.MsmqTransport.ReceiveMessageFromQueueAfterPeekWasSuccessful() in d:\BuildAgent-02\work\672d81652eaca4e1\src\impl\unicast\NServiceBus.Unicast.Msmq\MsmqTransport.cs:line 551

Has anyone successfully put NServiceBus onto a clustered server, if so, how did you get it working?

+1  A: 

Ok, It helps to actually have a MSDTC resource set up on the cluster, once you have both that and MSMQ resource then everything works, almost, see update to question.

David
Another gotcha that I found is that after you set up the Generic Application for the cluster group, you need to go in and change the properties in order to check "Use Network Name for computer name", otherwise NServiceBus will try to run locally using the name of one of the nodes.
David
+3  A: 

Ok, so I finally got it up and working as a Generic Application. The gotchas I found were:

  1. You need to add the .net Framework feature or application server role to the member servers
  2. You need to add both a MSDTC and a MSMQ resource to the cluster (MSMQ will require that you have MSDTC)
  3. After adding the Generic Application for NServiceBus.Host.exe, you will need to go in and modify the properties of the generic application to check the "Use Network Name for computer name" box so that NServiceBus points to the cluster name for using MSMQ not to the member server that is currently running it.
David
+2  A: 

For those looking for more of a guide, I wrote a blog post that details this process step by step.

Check out Deploying NServiceBus in a Windows Failover Cluster.

I'm using Windows Server 2008 but I believe most of the same rules should apply.

David