Deploying the application

Once the cluster is created, PowerShell cmdlets can be used to deploy and manage applications on the standalone cluster. The first step would be connecting to the cluster. The following command can be used to connect to an existing Service Fabric cluster:

Connect-ServiceFabricCluster -ConnectionEndpoint <*IPAddressofaMachine*>:<Client connection end point port> 

Once connected, we should be able to launch the Service Fabric explorer remotely by browsing to the following URL: http://<IPAddressofaMachine>:19080/Explorer/index.html.

The next step will be to upload the application package. The cmdlet for uploading the package is part of the Service Fabric SDK PowerShell module which should be imported before performing the upload.

The connection string for the local image store where the package has to be uploaded can be retrieved using the Get- ImageStoreConnectionStringFromClusterManifest cmdlet. Copy-ServiceFabricApplicationPackage cmdlet can then be used to copy the application package to the image store. Following is an example for the same:

PS C:> Copy-ServiceFabricApplicationPackage -ApplicationPackagePath <path> -ApplicationPackagePathInImageStore <application name> -ImageStoreConnectionString (Get-ImageStoreConnectionStringFromClusterManifest(Get-ServiceFabricClusterManifest)) -TimeoutSec <timeout>

Once the package is copied to the image store the application can be registered using the following PowerShell cmdlet:

PS C:> Register-ServiceFabricApplicationType <Application name>

Registry of an application can be verified using the Get-ServiceFabricApplicationType cmdlet:

PS C:> Get-ServiceFabricApplicationType

After the application is registered, the next step is to create an instance of this application on the Service Fabric cluster. This can be achieved using the following cmdlet:

PS C:> New-ServiceFabricApplication fabric:/<application name> <application type> <version>

A deployed application can be verified using the Get-ServiceFabricApplication and the Get-ServiceFabricService cmdlets:

PS C:> Get-ServiceFabricApplication
PS C:> Get-ServiceFabricApplication | Get-ServiceFabricService

A Service Fabric cluster can also be deployed on Linux machines.

Details about setting up a Linux cluster can be found at the following link: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-linux-overview.

 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.146.176.68