azure-service-fabricservice-fabric-on-premises

Service fabric on premises add node and node type correlation


I have a 2 node on-premises windows cluster with the following node definitons in cluster manifest

 "nodes": [
  {
    "nodeName": "node1",
    "iPAddress": "192.168.1.1",
    "nodeTypeRef": "node1",
    "faultDomain": "fd:/dc1/r1",
    "upgradeDomain": "UD1"
  },
  {
    "nodeName": "node2",
    "iPAddress": "192.168.1.2",
    "nodeTypeRef": "node2",
    "faultDomain": "fd:/dc2/r2",
    "upgradeDomain": "UD2"
  }

I am trying to add a new node called "node3" using "AddNode.ps1" script:

 .\AddNode.ps1 -FabricRuntimePackagePath  "G:\Downloads\ServiceFabricRuntime\MicrosoftAzureServiceFabric.6.2.274.9494.cab" -NodeName node3 -NodeType "node3" -NodeIPAddressorFQDN 192.168.1.3 -ExistingClientConnectionEndpoint node0.gbl.net:19000 -UpgradeDomain UD3 -FaultDomain fd:/dc3/r3 -AcceptEULA

I get the error "Invalid Node Type" in powershell. Per the documentation here, NodeType must be an "existing" nodetype in the cluster. I am wondering why is this? What does the "NodeTypeRef" signify in the clustermanifest.json? If I run AddNode.ps1 with nodetype param as "node1" or "node2" [which are existing nodetypes], it works.


Solution

  • In general you can think of NodeType as of some abstract definition of hardware of executing environment where your services are going to be executed.

    Consider an example:

    Imagine you have two services A and B. Service A does lots of Disk I/O bound operations while Service B requires a lot of memory to work.

    According to this information you can define two NodeType's then: FastSDD and HugeMemory. When adding Nodes to a cluster you specify appropriate NodeType based on the hardware (i.e. machines with SSD as FastSSD and machines with huge RAM as HugeMemory).

    Now you can define the following placement constraints for your services:

    Using this configuration ClusterManager would organize your services in a way to ensure that replicas of Service A are placed on Node's of type FastSSD and Service B are placed only on Node's of type HugeMemory.