2016-06-17 18 views
5

Tôi có một cấu hình cluster với hai loại Node quy định tại các ServiceManifest.xmlLàm thế nào để cấu hình cụm địa phương với nhiều loại nút 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> 

Vấn đề của tôi rằng điều này gây ra việc triển khai đến các cụm địa phương để thất bại như thế này NodeType không tồn tại trong Local Cluster.

Tôi đã thấy đề cập đến tệp cluster.xml và tôi đã tìm thấy nó nhưng thực hiện thay đổi đối với nó dường như không có bất kỳ ảnh hưởng nào. Tôi đã thử đặt lại, bắt đầu và dừng nhưng việc đặt lại sẽ ghi đè các thay đổi.

Dưới đây là hy vọng rằng câu trả lời là không bắt đầu các dịch vụ tự động :-)

Trả lời

6

Tôi không biết làm thế nào nó hoạt động trong khi cụm đang chạy, nhưng tôi đã có thể làm điều đó bằng cách cài đặt lại các địa phương cụm. Đây là những bước của tôi:

  • Đến C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\
  • Gỡ bỏ các cụm hiện bằng cách gọi .\CleanCluster.ps1
  • Tạo một bản sao lưu của tập tin C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure\ClusterManifestTemplate.xml
  • Bây giờ bạn có thể điều chỉnh tập tin này và thêm các thuộc tính vị trí để mỗi nút :
<NodeType ...> 
    <Endpoints>...</Endpoints> 
    <PlacementProperties> 
    <Property Name="NodeType" Value="Internal" /> 
    </PlacementProperties> 
</NodeType> 
  • Tạo lại cụm bằng cách gọi .\DevClusterSetup.ps1
+0

Điều này đã hiệu quả! –

+0

Nếu bạn đang chạy trên Win7 chắc chắn rằng bạn sửa đổi mẫu ClusterManifestTemplate_Win7.xml. – Creamstout10

+0

Có cách nào để thêm mục menu phụ vào "Service Fabric Local Cluster Manager" cho cấu hình của riêng tôi không? –

Các vấn đề liên quan