Skip to content

Instantly share code, notes, and snippets.

@yokawasa
Created October 21, 2018 17:14
Show Gist options
  • Save yokawasa/329a24ae30c855a475f4e58c9f654140 to your computer and use it in GitHub Desktop.
Save yokawasa/329a24ae30c855a475f4e58c9f654140 to your computer and use it in GitHub Desktop.
Service Fabric: Quickstart Service Fabric Linux Cluster

Quickstart - Service Fabric Linux Container App

Service Fabric CLI (sfctl)

MacOS

# Install in Python3.7 Environment
$ brew install python3
$ pip3 install sfctl
$ sfctl -h

Group
    sfctl : Commands for managing Service Fabric clusters and entities. This version is compatible
    with Service Fabric 6.3 runtime.
        Commands follow the noun-verb pattern. See subgroups for more information.

Subgroups:
    application: Create, delete, and manage applications and application types.
    chaos      : Start, stop, and report on the chaos test service.
    cluster    : Select, manage, and operate Service Fabric clusters.
    compose    : Create, delete, and manage Docker Compose applications.
    container  : Run container related commands on a cluster node.
    is         : Query and send commands to the infrastructure service.
    node       : Manage the nodes that form a cluster.
    partition  : Query and manage partitions for any service.
    property   : Store and query properties under Service Fabric names.
    replica    : Manage the replicas that belong to service partitions.
    rpm        : Query and send commands to the repair manager service.
    sa-cluster : Manage stand-alone Service Fabric clusters.
    service    : Create, delete and manage service, service types and service packages.
    store      : Perform basic file level operations on the cluster image store.

If you want to install on venv environemtn, do like this

$ python3 -m venv venv3.7
$ source venv3.7/bin/activate
$ Python -V
Python 3.7.0

Ubuntu and WSL

$ sudo apt-get install python3
$ sudo apt-get install python3-pip
$ pip3 install sfctl

Create cluster certificate (X.509 certificate)

FIXME

Create Linux Cluster

Prerequisites

  • Azre CLI
  • Service Fabric CLI

Key Concepts

  • A Service Fabric cluster is a network-connected set of virtual or physical machines
  • A node type (Virtual Machine Scale Set) defines the size, number, and properties for a set of virtual machines in the cluster
  • Each node type can be scaled up or down independently. Node types are used to define roles for a set of cluster nodes, such as "front end" or "back end".
  • the primary node type must have at least five VMs for production clusters (or at least three VMs for test clusters). Service Fabric system services are placed on the nodes of the primary node type.
  • The cluster is secured with a cluster certificate (X.509 certificate): node-to-node comm, SSL for HTTPS management API, etc

Download the template

Download the cluster template that deploys a secure cluster of five virtual machines and a single node type into a virtual network

$ curl https://raw.githubusercontent.com/Azure-Samples/service-fabric-cluster-templates/master/5-VM-Ubuntu-1-NodeTypes-Secure/AzureDeploy.json -o AzureDeploy.json
$ curl https://raw.githubusercontent.com/Azure-Samples/service-fabric-cluster-templates/master/5-VM-Ubuntu-1-NodeTypes-Secure/AzureDeploy.Parameters.json -o AzureDeploy.Parameters.json

For details on the cluster configs in this template, see this page

Other sample templates on GitHub:

Deploy VNET and SF cluster

FIXME

Get the app package

git clone https://github.com/Azure-Samples/service-fabric-containers.git
cd service-fabric-containers/Linux/container-tutorial/Voting

Create a Service Fabric cluster

LINKS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment