wcf - Update individual instance of Azure Cloud Service -
i have cloud service hosted out in azure. due amount of data uses, have hourly process tells service cache data memory. update cache, use exposed method called "refreshdata" invoke on scheduled task on local server.
recently updated cloud service run on 2 instances (meaning running on 1 vm, running on 2).
what im noticing our data no longer automatically refreshing current data. seems happening here is:
- a scheduled task run command executable triggered @ top of hour on local server
- the exe calls out http://mycloudservice.cloudapp.net/service.svc, gets response, , kicks off refreshdata method
- the instance received refresh request "random", meaning 1 of 2 instances told refresh data. therefore, user using our service gets current data, can few hours stale.
so if have cloud service responds ip, there 2 instances running "behind it" individual ip's, how can invoke request , ensure both getting updated needed?
ps - i'm aware azure has "load balancer" tool available, if needed im comfortable using 1 instance primary , have second instance work failover, if thats plausable option here?
you have few options:
- why cloud services not responsible refreshing own data on schedule? why have told external? using scheduled task or timer inside role instances easiest , reliable method.
- use instanceinputendpoint each instance gets unique port number. scheduled task make 2 calls, 1 http://mycloudservice.cloudapp.net:81/service.svc , 1 http://mycloudservice.cloudapp.net:82/service.svc.
- setup instance level public ip address (http://azure.microsoft.com/blog/2014/10/22/instance-level-public-ip-address/). scheduled task make 2 calls, 1 http://{instanceip1}/service.svc, , 1 http://{instanceip2}/service.svc.
- use same configuration using now, random instance behind load balancer gets refresh command, , internally instance communicate other instance(s) using internalendpoints.
Comments
Post a Comment