What will happen if a guest executable on Service Fabric node dies? - azure-service-fabric

I'm planning to host my guest executable in Service Fabric cluster but have this doubt that what will happen if my guest executable on Service Fabric node dies?
Will Service Fabric automatically restarts my executable again

Yes it will be restarted when it crashes. Service Fabric detects when a process crashes. It will restart the process that crashed. It will be restarted on a different (healthy) cluster node.
It doesn't matter if you're running a Stateful / Stateless service or a guest executable in this situation. The behavior is the same.
More info here

Related

How to repair bad IP addresses in standalone Service Fabric cluster

We've just shipped a standalone service fabric cluster to a customer site with a misconfiguration. Our setup:
Service Fabric 6.4
2 Windows servers, each running 3 Hyper-V virtual machines that host the cluster
We configured the cluster locally using static IP addresses for the nodes. When the servers arrived, the IP addresses of the Hyper-V machines were changed to conform to the customer's available IP addresses. Now we can't connect to the cluster, since every IP in the clusterConfig is wrong. Is there any way we can recover from this without re-installing the cluster? We'd prefer to keep the new IP's assigned to the VM's if possible.
I've tested this only on my test environment (I've never done this on production before so do it on your own risk), but since you can't connect to the cluster anyway I think it is worth to try.
Connect to each virtual machine which is a part of the cluster and do following steps:
Locate Service Fabric Cluster files (usually C:\ProgramData\SF\{nodeName}\Fabric)
Take ClusterManifest.current.xml file and copy it to temp folder (for example C:\temp)
Go to Fabric.Data subfolder, take InfrastructureManifest.xml file and copy it to the same temp folder
Inside each file you have copied change IP addresses for nodes to correct values
Stop FabricHostSvc process by running net stop FabricHostSvc command in powershell
After successful stop run this powershell (admin mode) command to update node cluster configuration:
New-ServiceFabricNodeConfiguration -ClusterManifestPath C:\temp\ClusterManifest.current.xml -InfrastructureManifestPath C:\temp\InfrastructureManifest.xml
Once the config is updated start FabricHostSvc net start FabricHostSvc
Do this for each node and pray for the best.

Service Fabric Cluster Upgrade Failing

I've an on-premise, secure, development cluster that I wish to upgrade. The current version is 5.7.198.9494. I've followed the steps listed here.
At the time of writing, the latest version of SF is 6.2.283.9494. However, running Get-ServiceFabricRuntimeUpgradeVersion -BaseVersion 5.7.198.9494 shows that I first must update to 6.0.232.9494, before upgrade to 6.2.283.9494.
I run the following in Powershell, and the upgrade does start:
Copy-ServiceFabricClusterPackage -Code -CodePackagePath .\MicrosoftAzureServiceFabric.6.0.232.9494.cab -ImageStoreConnectionString "fabric:ImageStore"
Register-ServiceFabricClusterPackage -Code -CodePackagePath MicrosoftAzureServiceFabric.6.0.232.9494.cab
Start-ServiceFabricClusterUpgrade -Code -CodePackageVersion 6.0.232.9494 -Monitored -FailureAction Rollback
However, after a few minutes the following happens:
Powershell IDE crashes
The Service Fabric Cluster becomes unreachable
Service Fabric Local Cluster Manager disappears from the task bar
Event Viewer will log the events, see below.
Quite some time later, the vm will reboot. Service Fabric Local Cluster Manager will only give options to Setup or Restart the local cluster.
Event viewer has logs in the under Applications and Services Logs -> Microsoft-Service Fabric -> Operational. Most are information about opening, closing, and aborting one of the upgrade domains. There are some warnings about a vm failing to open an upgrade domain stating error: Lease Failed.
This behavior happens consistently, and I've not yet been able to update the cluster. My guess is that we are not able to upgrade a development cluster, but I've not found an article that states that.
Am I doing something incorrectly here, or is it impossible to upgrade a development cluster?
I will assume you have a development cluster with a single node or multiple nodes in a single VM.
As described in the first section of the documentation from the same link your provided:
service-fabric-cluster-upgrade-windows-server
You can upgrade your cluster to the new version only if you're using a
production-style node configuration, where each Service Fabric node is
allocated on a separate physical or virtual machine. If you have a
development cluster, where more than one Service Fabric node is on a
single physical or virtual machine, you must re-create the cluster
with the new version.

Can't deploy nodes on slaves with daemon set installed

Soo to resume the situation, i created a kubernetes cluster with one master and on slaves.
I installed everything to need it to work (Pod Network Calico here and dashbord for better management)
I tried to install a virtual IP service to just create a virtual IP for the service i deploy in my cluster but when i installed the daemonset (kube-keepalived-vip here), everytime i deploy a service it never get shedule on the slave. But the virtual IP is working properly because i can access my service thougth this IP.
To clarify the situation, my master is untained soo i can deploy pods on it.
Soo here i try to have HighAvailability services with the same virtual IP. Without the Daemonset, the LoadBalancing is working properly when i deploy a service in my cluster and the pods are sheduled on the slaves.
If you know what's wrong or what to do, let me know

Is there a Service Fabric notification BEFORE it takes down a service?

I have setup a service that uses RegisterServiceNotificationFilterAsync to get notified of service change events. It works as intended. When a service goes down, this event gets called.
But it happens AFTER the service has gone offline. Which means that several requests could have failed against that now offline service before I get it pulled out of my loadbalancer pool.
Sometimes Service Fabric can only react to a service going offline. For example, if someone pulls the plug on a server node, Service Fabric clearly can't tell me in advance that the service is going offline.
But many times, a threshold is reached and it is Service Fabric itself that kills the service (and starts a new one).
Is there a way to know BEFORE Service Fabric kills a service? (So I have time to update my loadblancer.)
(In case it matters, I am running Service Fabric on premises.)
You can only be notified on shutdown inside the service. RegisterServiceNotificationFilterAsync is based on endpoint changes from the naming service.
If it's a reliable service, you get events for these scenarios: https://learn.microsoft.com/en-us/azure/service-fabric/service-fabric-reliable-services-lifecycle
For guest executeables the signal Service Fabric send is Ctrl+C. For containers it's "docker stop".

how can I start the kubernetes container when I reboot my server computer

firstly,I success to deploy my kubernetes master node via docker,
then reboot the server,the container is down,is there any idea to auto-run it.
You need the kubelet to start when your computer reboots. Once it starts up, it will run all of the containers stored in manifest files (on your master node, this should include the master components like the apiserver) and will then register itself with the apiserver and be available to run any assigned pods.