Setting up Azure Service Fabric - artisticcheese/artisticcheesecontainer GitHub Wiki
Installing and configuration Azure Service Fabric
To install Service Fabric prepare 3 Windows Servers running Windows 2016. They can be standalone servers or Domain Joined. All examples below performed based no domain joined machines.
- Download and install Service Fabric standalone package Link to detailed instructions is here. Download is here. Once downloaded ZIP package extract to c:\sf. There will be series of JSON files in that folder named with 2 different naming patterns. One is Dev and another one is MultiMachine. Another one is by authentication which will be used for cluster administration which is of 3 different types ("Unsecure", "Windows", "X509") which respectively allow to administer your SF cluster with no authentication, with Windows authentication or X509 certificates.
- Edit your cluster config
For testing/demo purposes we are going to use
Unsecure
cluster andMultiMachine
. Open file calledClusterConfig.Unsecure.MultiMachine.json
in c:\sf folder. Edit entries innodes
array to replaceiPAddress
values with names of your 3 SF hosts like below.
"nodes": [
{
"nodeName": "host1",
"iPAddress": "containerhost1",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc1/r0",
"upgradeDomain": "UD0"
},
{
"nodeName": "host2",
"iPAddress": "containerhost2",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc2/r0",
"upgradeDomain": "UD1"
},
{
"nodeName": "host3",
"iPAddress": "containerhost3",
"nodeTypeRef": "NodeType0",
"faultDomain": "fd:/dc3/r0",
"upgradeDomain": "UD2"
}
]
There is multitude of other parameters which can be changed in cluster config as well with details available on SF docs page SF docs
- Test and Create your cluster
Test if all prerequisites are met by running
TestConfiguration.ps1
script in C:\sf folder and pointing to your modifiedClusterConfig.Unsecure.MultiMachine.json
.
PS C:\sf> .\TestConfiguration.ps1 -ClusterConfigFilePath .\ClusterConfig.Unsecure.MultiMachine.json
Trace folder already exists. Traces will be written to existing trace folder: C:\sf\DeploymentTraces
Running Best Practices Analyzer...
Best Practices Analyzer completed successfully.
LocalAdminPrivilege : True
IsJsonValid : True
IsCabValid : True
RequiredPortsOpen : True
RemoteRegistryAvailable : True
FirewallAvailable : True
RpcCheckPassed : True
NoConflictingInstallations : True
FabricInstallable : True
DataDrivesAvailable : True
Passed : True
- Create your cluster based on your template
Execute
CreateServiceFabricCluster.ps1
pointing to your JSON config file.
PS C:\sf> .\CreateServiceFabricCluster.ps1 -ClusterConfigFilePath .\ClusterConfig.Unsecure.MultiMachine.json -AcceptEUL
Creating Service Fabric Cluster...
If it's taking too long, please check in Task Manager details and see if Fabric.exe for each node is running. If not, p
ease look at: 1. traces in DeploymentTraces directory and 2. traces in FabricLogRoot configured in ClusterConfig.json.
Trace folder already exists. Traces will be written to existing trace folder: C:\sf\DeploymentTraces
Running Best Practices Analyzer...
Best Practices Analyzer completed successfully.
Creating Service Fabric Cluster...
Processing and validating cluster config.
Configuring nodes.
Default installation directory chosen based on system drive of machine 'containerhost1'.
Copying installer to all machines.
Configuring machine 'containerhost1'.
Configuring machine 'containerhost2'.
Configuring machine 'containerhost3'.
Machine containerhost2 configured.
Machine containerhost1 configured.
Machine containerhost3 configured.
Running Fabric service installation.
Successfully started FabricInstallerSvc on machine containerhost1
Successfully started FabricInstallerSvc on machine containerhost2
Successfully started FabricInstallerSvc on machine containerhost3
Successfully started FabricHostSvc on machine containerhost1
Successfully started FabricHostSvc on machine containerhost3
Successfully started FabricHostSvc on machine containerhost2
Your cluster is successfully created! You can connect and manage your cluster using Microsoft Azure Service Fabric Explorer or Powershell. To connect through Powershell, run 'Connect-ServiceFabricCluster [ClusterConnectionEndpoint]'.
- Check your cluster operation Service Fabric provides 2 ways of managing it.
- REST API against default 1900 endpoint
- Web UI (by default running on 19080 port) Open browser on any of you cluster hosts and navigate to http://localhost:19080 or you can do it from any machine external to cluster as well. Your UI will look similar to below. If you expand Nodes node you will 3 hosts you setup.
- Modify default location for docker images
By default docker daemon will put images on your C drive which might not what you want to have in production environment since this will fill up pretty quickly. If you want to move this location to different drive create file called
daemon.json
with following content to redirect images to be stored on E: drive.
{ "graph": "e:\\images"}