2016-06-17 76 views
5

我有在ServiceManifest.xml指定的兩個節點類型羣集配置本地集羣我如何配置addtional節點類型

<?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> 

我的問題,這將導致部署到本地集羣失敗,因爲這本地羣集中不存在NodeType。

我見過提及的cluster.xml文件,我發現它,但對其進行更改似乎沒有任何效果。我嘗試了重置,啓動和停止,但重置覆蓋了更改。

這裏的希望,答案不是動態啓動服務:-)

回答

6

我不知道該羣集運行時它是如何工作的,但我可以通過重新安裝在本地做簇。這些是我的步驟:

  • 轉到C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\
  • 卸載通過調用.\CleanCluster.ps1
  • 創建文件的備份C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure\ClusterManifestTemplate.xml
  • 現在你可以調整這個文件,並放置屬性添加到每個節點的現有集羣:
<NodeType ...> 
    <Endpoints>...</Endpoints> 
    <PlacementProperties> 
    <Property Name="NodeType" Value="Internal" /> 
    </PlacementProperties> 
</NodeType> 
  • 重新創建通過調用.\DevClusterSetup.ps1
+0

這個工作一種享受集羣! –

+0

如果您在Win7上運行,請確保您修改了ClusterManifestTemplate_Win7.xml模板。 – Creamstout10

+0

有沒有辦法爲我自己的配置添加額外的菜單項到「Service Fabric Local Cluster Manager」? –