.NET Framework Bookmark and Share   
 index > .NET StockTrader Sample Application > Node toggles on SOA Map Refresh
 

Node toggles on SOA Map Refresh

Hi Greg,

I have connected two nodes to my Load Balancer service but when i see SOA Map for Connected Nodes it shows only one.
And on continous refresh it toggles the Node .i.e. Sometimes it shows Rank51 node and Sometimes Rank52 node but not both as it should show both instances connected.

While in connections tab it correctly shows both connected nodes.

I Don't what is the problem, Please help.

Thanks and Regards
Narayan Sahu
Narayan Sahu
This is most likely becuase one node cannot communicate to the other node over whatever port you are using; sometimes a firewall issue; sometimes a DNS/name resolution issue.
The clients can see the services, as you indicate, so noissue there. However, the way the SOA map works is, if logging into config service of a client (and not directly to config service of the backendclustered service itself); is that the client config service issues multiple async threads send out a quick ping to all known nodes of the backend service(s) it connects to. The first node to respond is then immediately sent the actual config service op to get the SOA map for that cluster; the node getting this request is then responsible for gathering up info on all its peer nodes (as well as its entire subtree if it also connect to backend services). Hence, you sometimes see one node, sometimes see one node, sometimes the other, depending on which is first to respond to the cross network ping, if you will. however, the two nodes do not know about eachother.

So, forget about the client for a awhile, and close out of all running nodes (stop IIS if you need to by issuing "IISReset" command from a cmd prompt). Make sure in the respository for the backend service, the three tables ActiveHosts; ActiveConfigHosts; and ActiveNodeHosts are now empty. If not, you can safely delete all rows from these tables, although this should not be necessary, and really never should be necessary---with no running hosts, these tables will be empty.

First, on both nodes delete all old messages in the app event log to clear them out.

Start up a single node. Login to config service for that node directly (not the client, the service config service endpoint itself). Bring up SOA map, all should look fine. If you are self-hosted in the windows self host console (provided as base class); you can switch to the config tab of the app. Next, startup the second node. This node will then know about the first node, since on startup it will get this info from the repository. However, it will attempt an online notifification to the first node started to tell it this new node has started; this is likely what is failing. Could be firewall issue blocking the port, for example; a misconfig of the http proxy; or a DNS name-resolution issue on the network. Other issue might be your node service is configured to use net.tcp in IIS7, but you have not enabled net.tcp in your IIS 7 app web site.

At any rate, you should look in the app event log for both nodes (assuming you have properly created event sources per tutorial, they only get auto-created from non-IIS hosted services, you must use the provided utility in \stocktrader\setup\util to create the event source initially-- very important because all exceptions/warnings are logged there for troubleshooting). So look in the app event log on both nodes, and look for any errors or warning icons; and let me know. Again, this is some sort of mis-config preventing communicationbetween nodes, I believe.

-Greg
Greg Leake, Microsoft
Gregory Leake
Thanks Greg,

There is no firewall or port Issue,i am sure of that.What i suspect is the scenario which is like this.

I have a RG service using service contract ISubmitReportRequest connected to MCS database(RGServiceRepository).
Two instances of this service is running on two machines and the individual SOA map looks fine and no error in Event log.
The port numbers used for these two services are 9030,9031 for config and node.

I also have another LoadBalancer Service Which load balance these above two RG Services(using msmq) and uses (MCSProxyRGServiceRepository) as MCS database.

Actually the Load Balancer service also uses the same contract ISubmitReportRequest as RG Service but listens on port no 9040(config),9041(node).

In a sense Loadbalancer services is the copy of RG service with the difference of Port number and some change in functionality othersise service wise everything is the replica of RG service.

SO i think may be because of the same contract at Load balancer and Rg service its creating the issue.


Also i have noticed that when Load balancer services picks up the message from input Queue and loadbalance the messages between RG instances it sends double of the messages that is if you are sending 5 messages to input queue load balancer services sends 10 messages ie double one message with around size of 207 bytes and other the actual one.So in total you get 5 messages of size 207 and 5 of actual size.I don't know why it is happening.Functionally its working fine for each request it picks up two messages thus 5 actual reports get generated and queue becomes empty.But why its sending 10 messages instead of 5.I don't know.


If you have any idea please help me.

Thanks and regards
Narayan sahu

Narayan Sahu
for first part I am not sure of your setup. In general, load balanced nodes are strict replicas of eachother, sharing the same config repository/db. Once they share this same config db, they are treated as peers, part of same cluster. It would be fine to have another service use the same contract; as long as this service is given a unique Host Name Identifier (in the repository create tool); and has its own separate config db. When you say load balancer service; I assume you mean one service is a client to the other; and generated using the repository create tool (client generation tab). This should be aware of and see both nodes of the backend MSMQ-based service you are using...just like StockTrader when set to Async_MSMQ mode for Order Processing Mode.

As for two messages; this is the way it works in MSMQ mode; one simple ping message (isOnline) is sent just prior to handing the channel off to your code for the actual message...this ensure the node being directed to is actually online. With msmq; its a bit different in that the host service process does not actually need to be online to receive a message, just the Windows MSMQ messaging service needs to be running. Then messages are received; but do not get processed (by WCF design) unless your service process is also running.

So you are seeing a small "ping" message for every actual message you send. There is some overhead in this; but allows per-request load balacning to a node known to be receiving messages at the time of that specific request; and immediate failover to another node if not online.

-Greg
Greg Leake, Microsoft
Gregory Leake

You can use google to search for other answers

Custom Search

More Threads

• Detailed Performance Report Available?
• Config Services in the Cloud
• .NET StockTrader 2.02 installation error
• Install StockTrader on VPC 2007 - Error
• Does anyone have this working on a website somewhere?
• Object reference - accessing service from a Web Client
• Is there any intent to add the utilization of the velocity project for distributed cache.
• Can I run Stock trader application on Window XP- Home edition??
• Config Setup in DB
• Error when install on windows 7