Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I configure local cluster for addtional node types

I have a cluster configuration with two Node Types specified in the ServiceManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<ServiceManifest Name="MKopa.M2M.ConfigurationPkg"
                 Version="1.0.0"
                 xmlns="http://schemas.microsoft.com/2011/01/fabric"
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ServiceTypes>
    <!-- This is the name of your ServiceType. 
         This name must match the string used in RegisterServiceType call in Program.cs. -->
    <StatelessServiceType ServiceTypeName="ConfigurationType">
      <PlacementConstraints>(NodeType == Internal)</PlacementConstraints>
    </StatelessServiceType> 
  </ServiceTypes>

  <!-- Code package is your service executable. -->
  <CodePackage Name="Code" Version="1.0.0">
    <EntryPoint>
      <ExeHost>
        <Program>MKopa.M2M.Configuration.Service.exe</Program>
      </ExeHost>
    </EntryPoint>
  </CodePackage>

  <!-- Config package is the contents of the Config directoy under PackageRoot that contains an 
       independently-updateable and versioned set of custom configuration settings for your service. -->
  <ConfigPackage Name="Config" Version="1.0.0" />

  <Resources>
    <Endpoints>
      <!-- This endpoint is used by the communication listener to obtain the port on which to 
           listen. Please note that if your service is partitioned, this port is shared with 
           replicas of different partitions that are placed in your code. -->
      <Endpoint Name="ServiceEndpoint" />
      <Endpoint Name="HttpEndpoint" Protocol="http" Port="8081"/>
    </Endpoints>
  </Resources>
</ServiceManifest>

My issue that this causes the deployment to the local cluster to fail as this NodeType doesn't exist in the Local Cluster.

I've seen mention of the cluster.xml file and I've found it but making changes to it doesn't seem to have any effect. I've tried a reset, start and stop but the reset overrides the changes.

Here's is hoping that the answer is not starting the services dynamically :-)

like image 673
John Kattenhorn Avatar asked Jun 17 '16 12:06

John Kattenhorn


People also ask

How many nodes can be added to a cluster?

No more than 5000 nodes. No more than 150000 total pods. No more than 300000 total containers.

How do you add a node to a service fabric cluster?

In order to add a new node type, modify your configuration to include the new node type in "NodeTypes" section under "Properties" and begin a configuration upgrade using Start-ServiceFabricClusterConfigurationUpgrade. Once the upgrade completes, you can add new nodes to your cluster with this node type.

What is a 3 node cluster?

Basic 3-nodes Cluster Configuration This example describes a Cluster with three nodes where each node has a direct connection to a database. Figure 214. Configuration of 3-nodes Cluster, each node has access to a database. Configuration of Node 1 on 192.168.1.131.


1 Answers

I don't know how it works while the cluster is running, but I was able to do it by re-installing the local cluster. These were my steps:

  • Go to C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\
  • Uninstall the existing cluster by calling .\CleanCluster.ps1
  • Create a backup of the file C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure\ClusterManifestTemplate.xml
  • Now you can adjust this file and add placement properties to every node:
<NodeType ...>
  <Endpoints>...</Endpoints>
  <PlacementProperties>
    <Property Name="NodeType" Value="Internal" />
  </PlacementProperties>
</NodeType>
  • Re-create the cluster by calling .\DevClusterSetup.ps1
like image 94
Christian Weiss Avatar answered Sep 28 '22 02:09

Christian Weiss