"Self healing " that what i trying to do.
i have deployed a worker Role[Single instance ,Small Size] with server 2012. mostly the worker role is assigned to work with service bus.
At a recurring period around 14 to 15 Hours .Worker Role goes in unhealthy state and wont Restart again.
The Exception which are reported in intelliTrace are only.
System.ServiceModel.FaultException<Service.ServiceModel.ExceptionDetails>
System.TimeoutException
Event logs are not reported any thing on these exceptions.
Can i put RoleEnvironment.RequestRecycle() at Catch to Recycle if exception occurs. Will this do a Work around.
i haven't able to crash my role on Emulator . so i don't know will this work or not.
Related
On production, noticing below error messages quite frequently on Azure service bus processor. What would be the reason? can't able to replicate it on lower environment
MessageReceiver error (Action=Complete, ClientId=MessageReceiver1topicname/Subscriptions/subscriptionname, EntityPath=topicname/Subscriptions/subscriptionname, Endpoint=ex.servicebus.windows.net)
Message processing error (Action=Complete, ClientId=MessageReceiver1topicname/Subscriptions/subscriptionname, EntityPath=topicname/Subscriptions/subscriptionname, Endpoint=ex.servicebus.windows.net)
Where the processor is AKS hosted, servicetrigger based Azure function based processor
SDK vesrion: "Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="4.1.2"
I'd like to get a notification whenever a VM is stopped. Currently I've done it (for one VM only) using a hearbeat log alert to check every 10 min but that I want it to implemented for the whole subscription (100+ vms) I cannot do it sincgle alert for each vm due to cost.
After google it I found that there is a signal alert called Power Off Virtual Machine (Microsoft.Compute/virtualMachines) that should fulfill the requirement but after set the alert and stopping a VM nothing is being received. Is there any missing step maybe ?
PS. I'm using VM Insights + new Azure Monitor Agent.
I tried to reproduce the same in my environment and dint get the email notification when the VM was stopped for Power Off Virtual Machine operation:
To receive an alert to notify when the VM is stopped, please try the below:
Make sure to select the scope for the whole subscription:
Please note that, to receive an alert when the VM is stopped, make sure to select Deallocate Virtual Machine operation:
While creating the Action Group, select the Email option:
When I VM stopped, I got the email notification successfully like below:
The Alert rule is successfully fired in the Monitor like below:
I has written a simple Azure deployment to test Azure Auto-scaling block, which contained two role: one work role , one monitor role hosting auto-scaling block.
I wrote those code followed http://www.windowsazure.com/en-us/develop/net/how-to-guides/autoscaling/ step by step,
In the onStart() method of monitor role, there is:
{
.....
scaler = EnterpriseLibraryContainer.Current.GetInstance<Autoscaler>();
scaler.Start();
return base.OnStart();
}
then i deploy them, but only the work role instance can boost successfully, the monitor role instance show it was always busy,
The azure portal show that error message:
Starting role... Unhandled Exception: System.Reflection.TargetInvocationException [2013-04-27T09:54:57Z])
can someone teach me how to get detailed error stack?
or somebody experienced with Azure can figure out what wrong i happened?
Any advice will be appreciated!
The scenario I have in mind is this: Service Bus is used for instance-to-instance communication, so a Subscription is unique per service instance. The end result is that if an instance does not shut down gracefully, its subscription does not get deleted.
When a service instance "dies" and restarts, previous contents of the subscription are irrelevant and can be discarded.
So, is there a way to set a "time to live" for Service Bus Subscription or simulate something similar, without having to resort to some custom orphan detection mechanism?
Starting with Azure SDK 2.0 this works as expected.
Also, contrary to other reports, in my testing, subscription does not get deleted as long as there is a pending receiver listening to that subscription.
var description = new SubscriptionDescription(topicPath, subscriptionId);
description.AutoDeleteOnIdle = TimeSpan.FromSeconds(600);
namespaceManager.CreateSubscription(description);
that exact feature is on the backlog for one of the next releases. that said, in azure you could use the instance-id fro the role environment to create the name of your subscription and thus have a restarting instance reuse a subscription. the instance-id names are stable.
Edit: The feature is AutoDeleteOnIdle https://learn.microsoft.com/en-us/dotnet/api/microsoft.servicebus.messaging.subscriptiondescription
I had the exact same problem, preview solving it was released beginning of 2013: http://msdn.microsoft.com/en-us/library/microsoft.servicebus.messaging.subscriptiondescription.autodeleteonidle.aspx
It's very easy to use (see example below). Unfortunately it seems that the subscription times out if there is no message published for the AutoDeleteOnIdle period, even if you have some process awaiting for messages (according to Azure Servicebus AutoDeleteOnIdle).
NamespaceManager manager=NamespaceManager.CreateFromConnectionString(serviceBusConnectionString);
if(!manager.SubscriptionExists(topic,subscriptionName))
{
manager.CreateSubscription(new SubscriptionDescription(topic,subscriptionName) {
AutoDeleteOnIdle=TimeSpan.FromDays(2)
});
}
I'm doing my first project but large one on developing Azure Application with Intergration Component.
Currently most of the integration are done using SSIS Packages and would like to transform them on to Worker Role in Azure.
Could someone please help me to understand the following queries regarding Worker Role please?
Is there way to start or stop the Worker role (just like SSIS or Windows Schedulers) via GUI? If not how to achieve this?
How do I know my worker role has been running or not running (including why it's not running ie. logs)
How do I spin multiple worker role based on time (i.e. (9:00AM to 11:00AM spin 4 roles and scale down on quiet period)
Does the following code creates any poison message or dead lock (if multiple there are 10,000 messages to process and every 5 seconds the new thread (Processsing.run) is started?
while(true)
{
var thread = new Thread(Run);
thread.start();
Thread.Sleep(5000);
Trace.WriteLine("Working", "Information");
}
public class PhotoProcessing
{
public static void Run()
{
// Read from queue
CloudQueueMessage msg =
Storage.Queue.GetNextMessage();
while(msg != null)
{
string[] message = msg.AsString.Split('$');
if(message.Length == 2)
{
AddWatermark(message[0], message[1]);
}
// Message has been read so remove it
Storage.Queue.DeleteMessage(msg);
// Get next message if any
msg = Storage.Queue.GetNextMessage();
}
}
Is there way to start or stop the Worker role (just like SSIS or Windows Schedulers) via GUI? If not how to achieve this?
There are actually many ways to achieve this. You can use Windows Azure Portal to do or you could use 3rd party tools (like our Cloud Storage Studio) or you could write your own application using Windows Azure Service Management API (http://msdn.microsoft.com/en-us/library/ee460799.aspx)
How do I know my worker role has been running or not running (including why it's not running ie. logs)
Again you could use one of the GUI based tools to see the status of your roles. As far as why the roles are not running, you would need to enable Windows Azure Diagnostics in your worker role (http://msdn.microsoft.com/en-us/library/gg433048.aspx)
How do I spin multiple worker role based on time (i.e. (9:00AM to 11:00AM spin 4 roles and scale down on quiet period)
You can write your own application using Windows Azure Service Management API to do so or you could make use of 3rd party tools like AzureWatch from Paraleap or Azure Management Cmdlets (both from Microsoft and our company). While the cmdlets will get the job done, I believe Azure Watch is much more sophisticated solution. We wrote a blog post for autoscaling some days back which you can find here: http://www.cerebrata.com/Blog/post/Scale-your-Windows-Azure-instances-with-Azure-Management-Cmdlets.aspx.