Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add nodes to Service Fabric cluster

For some reason I can't find how to perform the most basic operation with the service fabric cluster: add more nodes. Please advise. The closest I found is https://msdn.microsoft.com/en-us/library/azure/mt125881.aspx, which still seems to be not what I want. All I need is a way to change a number of nodes; I currently have five A1 nodes in my cluster (simplest possible configuration) and I want six.

like image 585
Konstantin Surkov Avatar asked May 09 '16 23:05

Konstantin Surkov


2 Answers

One way of doing this would be to redeploy your template. If you don't have a template and simply created your cluster using the portal, go to create a new cluster, and at the point before creation, download the template, as recommended here.

Now obviously you don't want to have a whole new cluster, so what you want to do is redeploy the template to the existing cluster in incremental mode. Add a deployment resource to the template, making sure the mode element is Incremental. (I believe deployments actually default to incremental mode, so this may not be necessary... but just in case ;) )

{
  "apiVersion": "[variables('apiVersionRm')]",
  "name": "[variables('nestedDeploymentNameVnet')]",
  "type": "Microsoft.Resources/deployments",
  "properties": {
    "mode": "Incremental",

And finally, to change the amount of nodes in the scale set, you simply want to change the number in the capacity element of the scale set.

"sku": {
    "name": "[parameters('vmNodeType0Size')]",
    "capacity": "[parameters('node0Capacity')]",
    "tier": "Standard"

You can see I have mine as a parameter, so I can easily change the number to whatever I need it to be when I redeploy.

like image 26
Edward Rixon Avatar answered Oct 17 '22 05:10

Edward Rixon


1) The quickest way to change the number of instances in the VMSS/Node type in your cluster is to submit a change to Microsoft.Compute/virtualMachineScaleSets resource with the change to the "capacity" tag under "sku".

Adding of nodes should not result in any data loss to your stateful services. Deleting a node could, so you will need to gracefully shut down the node first and then delete that instance.

once the new nodes are added, the SF resource balancer will do the load balancing as appropriate.

2) The best way to scale in and out is to set up autoscale rules on VMSS/Nodetype. refer to https://azure.microsoft.com/en-us/documentation/articles/service-fabric-cluster-scale-up-down/ for details.

3) Once the portal experience for VMSS is enabled the experience of adding and/removing nodes will become simple, till then you have to issue manual ARM commands.

4) https://msdn.microsoft.com/en-us/library/azure/mt125881.aspx - new node configuration API - you should not be using it for clusters you deploy to Azure. this happens automatically, via the Service fabric extension that gets called once a new VMSS instance shows up.

like image 144
chacko-AMZN Avatar answered Oct 17 '22 03:10

chacko-AMZN