MSMQ Clustered and application access
-
2012年4月29日 0:33
I have got a clustered MSMQ (IP, disk and name).
I did this by installing the same feature set for MSMQ on both NodeA and NodeB Then clustered it on NodeA.
IP: 192.168.1.10
Name: ClusteredMSMQ
My question now is this:
if ClientA has an application that sends messages to the clustered MSMQ, then how does ClientB recieve this message from the clustered MSMQ?
What things are needing to be done here to ensure that the message gets passed to the correct Node in the clustered environment and then forwarded on to the right Client computer?
Or am I thinking about this incorrectly? Does the application in question which receives the messages have to be running on the clustered node? or can it run on a seperate computer (but still joined to the same domain and network)?
Maybe this will make it clearer: I'm trying to create an environment which uses clustering to have high availability for MSMQ. So when a message comes into the clustered MSMQ, it will be picked up by one of the available computers.
how do I make this happen? Does the receiving application need to be run within the clustered nodes? What about the sending application? That must be external to the system so I need a way for it to send messages to the clustered MSMQ - how is this done?
Thanks again!
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
すべての返信
-
2012年4月30日 7:15
Hiya,
Failover clustering in theory is not overly complicated.
Basically it respond on a name, and under that name you have your x amount of nodes. When you setup your client application, you will use the clustername rather than a node name.
From the client perspektive, it will be any other service name connection.
The cluster service, will keep track of which node in the cluster is actively providing the service. An oversimplified flow as follows.
Client request -> Cluster Name -> Cluster Service -> Node Name -> Service.
What you obtain with standard failover clustering, is that you will have multiple servers offering their services to the cluster service, however only one will be "the chosen one". If/when the chosen one fails, another steps in to offer the service. The actualy service will suffer from the same drawbacks as if you rebooted the service, meaning that open connections will be lost, however new ones can be made within a brief period of time.
Hope that gives some sort of answer?
- 編集済み Jesper Arnecke 2012年4月30日 7:17
-
2012年4月30日 10:28
Thanks.
When you say that the service will suffer from the same drawbacks as if the service rebooted meaning that connections would be lost - how would this be when there will be a failover kicking in (i.e the other node spinning up)?
Basically there will be endless messages coming into the cluster from an external source. Transactional MSMQ.
I want these messages to not be lost in case of a failover. I believe I can see this happening.
Then I have a custom app which reads messages from that queue and processes them - again, no messages appear to be lost.
But in the case of the external client sending messages to this clustered MSMQ and "the chosen one" Node goes down, what happens to those incoming messages? to they not leave the client and are placed on the outbound queue? or do the messages still get sent and are stored somewhere in the cluster/service?
I want the ability where no messages are lost from messages which are incoming. Now I dont know (and shouldnt need to really) what kind of MSMQ system is in place externally, as there could be many but want to ensure that the message does not get lost in transit since these messages are critical (mission critical)
To answer my last paragraph in my original question - yes, as I learned, the application needs to also be clustered.
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
-
2012年4月30日 10:58
Basically the time it takes for the cluster service to detect that the operating node is down, transfer ownership and verify operation - that is your period of downtime.
You will loose messages. High Availability is not 100% uptime. Its more like fast recovery. - Its allmost impossible to insure 100% uptime, unless you create two lines of transmission, which operates at the same time.
I believe that the technically term is: All data that has been sent, but not committed will be lost. - That is by design of failover clustering.
Its simiar to say, when you load something into memory, but not yet to harddisk and you power off your server, what you have in memory is lost.
The "easiest" way to implement that, is to implement a cross check between sent messages with processed messages. That way you will also check for network errors. However its impossible to implement 100% liability.
Implementering clustering, will only improve your odds, not perfect them :)
-
2012年4月30日 11:10
hmmm.
not sure about what to do here then. outside of clustering, what can be done to ensure that messages get sent to a running server if other servers are down with less impact?
I did do a test though where I am sending messages when NodeA goes down and NodeB is coming up and NodeB did get those messages sent in that time. But I believe it probably is because the outgoing messages are being stored in the outgoing queue on the client until it is able to send again.
I need a solution where I can provide 100% uptime/high availability with no loss of actual messages.
what do you recommend here? is clustering not the way to go? (I hope I have not wasted 5 days of endless work....)
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
-
2012年4月30日 11:15
Its starting to become more and more theoretical :)
Basically what you want is:
Whenever a client is sending a message, it should keep sending the message, until it gets an acknowledgement from the end point that it has been recieved and processed. - Whatever happends in between is not important(right now)
Right?
-
2012年4月30日 11:19
pretty much. But the problem here is, and I will get clarification later, that I believe the sender is only sending to 1 point. That point would be the place where the servers reside and have MSMQ.
I dont know how or what the client looks like or how it works, all I know is that it is sending messages. :-)
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
-
2012年4月30日 11:24Then you have no way of making 100% sure that the message will arrive correctly. As you will always have only one recieve point initially, that will be your single point of failure. That is basically what your seeing in your failover clustering. The message is only sent to one node at the time, when that becomes unavailable, message sent but not committed, will be lost...
-
2012年4月30日 11:31
Thanks.
i think i need to get more clarification here from "them". they currently have a system that works apperently but its a very old system and does use MSMQ.
so would you say an NLB is worth having here? if so, how does it work with sending those MSMQ messages to a server? Would the MSMQ's be clustered also? or would there be several clusters? or would it just be individual servers which have the same MSMQ name?
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
-
2012年4月30日 11:44
Its basically the same principle. There is no garentee that the package you sent to NLB node 1 will not die along with the node if it goes down.
NLB is, as the name implies, Network Load Balancing - even tho it gives some increased reliability as there are two servers able to serve the load, no session will run on both servers at the same time, having the exact same problem as with clustering.
I will bet a good bottle of homemade mead that the system they currently have does not garantee that. There might be somesort of sent/ackknowledge between entre/endpoint built into the system, which will insure it to some extend.
-
2012年4月30日 11:56
indeed. there is an ack and nack system in place somewhere.
it is quite a large system and a very critical system. messages are being sent from remote devices into some centre which then processes these messages and places them on MSMQ and a custom app processes these messages.
yup, I need more in depth clarification from them. Thanks so much for your valuable time here and will be sure to keep you posted.
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
-
2012年4月30日 11:56
http://msdn.microsoft.com/en-us/library/ee799074(v=cs.20).aspx
There some defintions and additional links for inspiration :)
-
2012年4月30日 21:29
Hi Jesper (and everyone)
I am trying to figure out an issue here and hope you can help.
I managed to get my WCF service to run (Clustered) to read messages from the Clustered MSMQ.
Now, the only way I got it to work was to untick the "Use Network Name for computer name". This meant that it could read the MSMQ messages.
However keeping it ticked (default) cause a problem with the clustered WCF service saying that:
The version of MSMQ cannot be detected All operations that are on the queued channel will fail. Ensure that MSMQ is installed and is available.
If I run this service on any other computers and point to the ClusteredMSMQ, they also fail to read any messages. so not sure what to do or think here
Any ideas?
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
-
2012年5月1日 0:21
Also there seems to be some confusion from my end about this, so please correct me:
I have installed a custom Windows Service on both Nodes (Clustered)
Now I wish to make this clustered (for failover reasons). I made it clustered. it works.
But because of the above posted issue, I am wondering if I need to add this custom windows service as a resource in my clustered MSMQ service/application? if so - the custom windows service is NOT listed in the list.
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
-
2012年5月1日 7:13
Hiya,
Basically this will take you through all the steps required, not only for the cluster installation, but also for the application dependent on the MSMQ service.
Deploying Message Queuing (MSMQ) 3.0 in a Server Cluster
http://www.microsoft.com/en-us/download/confirmation.aspx?id=4425I think the answer your looking for is placing a dependency on your Windows service, which relates to the MSMQ service.
-
2012年5月1日 8:21
If i am reading it right, when you try to read messages from any external machine then operations fails.
Since you are using tx read/writes, have you configured DTC authentication? And also check if you have appropriate security permissions on your queue from the account you are trying to perform the operation.
Thanks
Sudhir
-
2012年5月1日 8:27
That is correct sudhirG1 - I believe I have configured DTC authentication by opening dcomconf, navigating down to "Local DTC", and then selecting the security tab. I then checked the "Network Access DTC" and selected "Transaction Manager Communication" and checked the "Allow Inbound" and "Allow Outbound" checkboxes and finally set the "No Authentication required".
I did this on both of the physical cluster nodes which has the MSMQ Clustered.
Now, just to show you, this is what the Cluster looks like.
I have a service and application for MSMQ (ClusteredMSMQ)
I also have a service and application for "MyCustomWindowsService". This is the one which reads the ClusteredMSMQ using WCF service
Both of these are running.
Have I set this up correctly?
Of course, if I stop this "MyCustomWindowsService" and run the same service/app on other computers in the network and points to the ClusteredMSMQ, then it does not receive any messages. The messages are still waiting on the queue waiting to be processed.
I also did read that paper jesper - thanks! I did discover this a while ago.
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
-
2012年5月1日 8:48
You didn't mention anything about configuring DTC authentication options on the other machine from where you are trying to access the queues.
have you tried accessing any share on clustered nodes from that other computer(lets say x).
Also check if your queue have permission for the account which is trying to read/write to the queue. For start you can give access to everyone.
Thanks
Sudhir
- 回答としてマーク ahmedilyas 2012年5月1日 9:11
-
2012年5月1日 8:57
Thanks.
yes, I can access a clustered share I made from any computer (computer x) no problem.
As for DTC authentication options on other machines (computer x) - would this be the same settings as I have posted above, which are on each of the cluster nodes?
As for the permission for the user account, yes, they have all permissions enabled.
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
-
2012年5月1日 9:11
SudhirG1 - I Just changes the local DTC settings on computer x and ran the service app - it works! I can get the message no problem. it works! :-)
Same with Computer y - same DTC settings, run the app on that machine also and yes I can receive messages (no duplicates which is exactly what I wanted... thanks to the WCF ExactlyOnce setting)
Thanks all!
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator
- 回答としてマーク ahmedilyas 2012年5月1日 9:11
-
2012年5月1日 14:23
Hi All
I got the clustering thing working the way I want to but hit a final snag (I hope its final!)
Thanks to SudhirG1 - I have been able to get 3 WCF servers "connected" to the ClusteredMSMQ and all receive messages (single messages, not duplicates - just what I want).
Now, if one of the nodes in the cluster is switched off or whatever, The Clustered MSMQ does get "transferred" to the other node - failover works, great. However the WCF servers do not appear to process any messages during that transfer or even AFTER the transfer of the node. No errors or anything. In order for the WCF servers to work as before, I have to manually restart them.
Any ideas how I can "fix" this issue?
C# MVP (2007-2010) MS Vendor - MS All the way! Follower since 1995 MS Super Evangelist| MSDN Forums Moderator

