2016-06-17 26 views
5

ho una configurazione cluster con due tipi di nodo specificati nel ServiceManifest.xmlCome configurare cluster locale per tipi di nodo 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> 

Il mio problema che questo provoca la distribuzione per il cluster locale a fallire come questo NodeType non esiste nel cluster locale.

Ho visto menzionare il file cluster.xml e l'ho trovato ma apportare modifiche non sembra avere alcun effetto. Ho provato un reset, start e stop ma il reset sovrascrive le modifiche.

Ecco spera che la risposta non sta iniziando i servizi in modo dinamico :-)

risposta

6

Non so come funziona mentre il cluster è in esecuzione, ma sono stato in grado di farlo da reinstallare il locale grappolo. Questi sono stati i miei passi:

  • Vai a C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\
  • Disinstallare il cluster esistente chiamando .\CleanCluster.ps1
  • creare un backup del file C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure\ClusterManifestTemplate.xml
  • Ora è possibile regolare questo file e aggiungere proprietà dei posizionamenti per ogni nodo :
<NodeType ...> 
    <Endpoints>...</Endpoints> 
    <PlacementProperties> 
    <Property Name="NodeType" Value="Internal" /> 
    </PlacementProperties> 
</NodeType> 
  • Ricreare il cluster chiamando .\DevClusterSetup.ps1
+0

Questo ha funzionato a meraviglia! –

+0

Se si sta eseguendo su Win7, assicurarsi di modificare il modello ClusterManifestTemplate_Win7.xml. – Creamstout10

+0

C'è un modo per aggiungere voci di menu aggiuntive a "Service Fabric Local Cluster Manager" per le mie configurazioni? –

Problemi correlati