The web content provides a comprehensive guide on installing and configuring a Service Fabric cluster and nodes on Windows Server, including troubleshooting tips and updates.
Abstract
The article titled "Service Fabric part.1 — How to install and create Service Fabric cluster and nodes?" serves as a detailed tutorial for individuals and teams looking to implement Microsoft Azure Service Fabric technology. It walks readers through the process of downloading the necessary Service Fabric Standalone Package and Service Fabric Runtime, editing the ClusterConfig.json file, generating self-signed certificates, and creating a Service Fabric cluster using PowerShell commands. The guide also addresses common errors encountered during the installation and configuration process, offers solutions for cluster updates, and provides instructions for accessing the Service Fabric Explorer. The author, Sean, shares personal experiences and encourages feedback, aiming to assist others in navigating the complexities of Service Fabric setup.
Opinions
The author acknowledges the complexity of Service Fabric architecture and the challenges faced when applying this technology.
The guide is presented as a personal note from the author's experience, suggesting a hands-on approach to learning and problem-solving.
The author emphasizes the importance of patience and persistence when dealing with configuration issues and encourages readers to contribute feedback.
The inclusion of related topics and references indicates a commitment to continuous learning and community engagement.
The author recommends using an AI service, ZAI.chat, as a cost-effective alternative to ChatGPT Plus for similar performance and functionality.
Service Fabric part.1 — How to install and create Service Fabric cluster and nodes?
Copy right@A Layman
Introduction
Microsoft Azure Service Fabric is a distributed platform that makes it easy to build large-scale and easily manageable services.
Our team is trying to apply this technology. It’s a new architecture and concept for me.
I also encounter many problems in the process. So I decided to write this article. I expect that it can help the guy who also uses this technology.
1.Install Service Fabric Standalone Package and Service Fabric Runtime
The first step you need to do is to visit here to download Service Fabric Standalone Package and Service Fabric Runtime.
Unzip Service Fabric Standalone Package and move the folder to the location you prepare for it (e.g., C:\\fabric). You can also place the Service Fabric Runtime file in the folder.
The version of files I use in this article:
Service Fabric Standalone Package: Microsoft.Azure.ServiceFabric.WindowsServer.6.4.644.9590.zip
Service Fabric Runtime: MicrosoftAzureServiceFabric.6.4.644.9590.ca.
Type Manage computer certificates in the Windows Search to open the certification management. Find the certification you generate before for Personal. Right-click this certification and select Copy.
Copy right@A Layman
Select Trusted Root Certification Authorities. Right-click on the Certification and select Paste.
Copy right@A Layman
Step 4.Modify the value of properties/security/CertificateInformation/ClusterCertificate, properties/security/CertificateInformation/ServerCertificate, properties/security/CertificateInformation/ReverseProxyCertificate, and property/fabricSettings/parameters :
Type Manage computer certificates in the Windows Search to open the certification management. Select Trusted Root Certification Authorities. Check the Thumbprint of the certification you would like to use in the detail tab.
Copy right@A Layman
Copy the Thumbprint and paste it to properties/security/CertificateInformation/ClusterCertificate,properties/security/CertificateInformation/ServerCertificate, properties/security/CertificateInformation/ReverseProxyCertificate, and property/fabricSettings/ApplicationGateway/Http/parameters. Delete ThumbprintSecondary. For example:
Step 5. Modify the value of properties/security/CertificateInformation/ClientCertificateThumbprints:
Type certmgr in the Windows Search to open the certification management. Select Trusted Root Certification Authorities. Check the Thumbprint of the certification you would like to use in the detail tab.
Copy the Thumbprint and paste it toproperties/security/CertificateInformation/ClientCertificateThumbprints.
Step 7.Modify the path in property/fabricSettings/Setup/parameters. The value of FabricDataRoot is the where Service Fabric executes. The value of FabricLogRoot is the path where Service Fabric stores its logs.
“Create Cluster failed. For more information please look at traces in FabricRoot”
Copy right@A Layman
Follow this instruction then you can find the message “Previous Fabric installation detected on machine. Please clean the machine.” from FabricRoot folder.
You can go to the [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Fabric]and remove all the value in this path and try again.
Copy right@A Layman
Another way is to use test connection script before creating a cluster:
cd {the path of your Service Fabric Standalone Package}
“Resolve-Path : Cannot find path ‘C:\fabric\….cab’ because it does not exist.”
However, the file exactly exists in the path. You can check the C:\Program Files\Microsoft Service Fabric. Delete it if this folder exists.
“Previous Fabric installation detected on machine xxx . Please clean the machine.
Data Root node exists on machine xxx in C:\ProgramData\SF\xxx. This is an artifact from a previous installation — please delete the directory corresponding to this node.”
You can go to the [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Fabric]and remove all the value in this path and try again.
Use .\CleanFabric.ps1 to clean data.
“Remove-Item : Cannot remove item C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\KtlLogger.sys”
Copy right@A Layman
Stop the following services:
sc.exestop KtlLogger
sc.exestop LeasLayr
Useful commands
You can try to connect to the cluster after you complete creating it.
Connect-ServiceFabricCluster
Copy right@A Layman
You can get the cluster configuration by using the following command.
Get-ServiceFabricClusterConfiguration
Copy right@A Layman
You can get the cluster’s health condition by using the following command.
Get-ServiceFabricClusterHealth
Copy right@A Layman
4. Update the Service Fabric cluster
If you have ever created a Service Fabric cluster and now you want to update the ClusterConfig.json, open PowerShell and use the following command:
cd {the pathof your Service Fabric Standalone Package}
Connect-ServiceFabricCluster
Start-ServiceFabricClusterConfigurationUpgrade -ClusterConfigPath .\ClusterConfig.json
ValidationException: A configuration upgrade with identical configuration version is not allowed.”
Copy right@A Layman
It mean that you have to modify the value of clusterConfigurationVersion in the ClusterConfig.json. For example, change the value from 1.0.0 to 1.0.1. For example:
Maybe you will get some error message:
“Start-ServiceFabricClusterConfigurationUpgrade : Could not ping any of the provided Service Fabric gateway endpoints.”
Copy right@A Layman
It mean that you have not connected to your cluster. Try to connect to you cluster.
Connect-ServiceFabricCluster
5.Open the Service Fabric Explorer
Establish an SSH tunnel and open Service Fabric Explorer from the client’s browser.
Then the browser will open and redirect to https://localhost:12345. Choose the certification you have pasted in the ClusterConfig.json. Then you can see the dashboard for the cluster.
Copy right@A Layman
Summary
Thanks for your patient. I am Sean. I work as a software engineer.
This article is my note. Please feel free to give me advice if any mistakes. I am looking forward to your feedback.
Please feel free to clap if this article can help you, thank you.