Configuring cloudSwXtch for HA

Prev Next

WHAT TO EXPECT

In this article, users will learn about the specific commands they can use to configure the cloudSwXtch for high availability. However, it is the preferred method for users to configure the cloudSwXtch for high availability via wXcked Eye.

For more information, see High Availability with wXcked Eye.

Configuring cloudSwXtch for High Availability

For High Availability to work, the cloudSwXtch must be configured. This allows for the system to know the paths through user naming and ultimately enables HA views in swXtch-top. In this section, we will review the various HA commands available to the user for a successful high availability configuration.

Users can also configure High Availability for the cloudSwXtch in wXcked Eye. That is the preferred method. For more information, see High Availability with wXcked Eye

HA Help

To get a list of the HA commands, use -h or --help as shown below.

PS C:\Users\testadmin> swx ha -h
High Availability cluster management tool (create, show, and destroy the HA cluster) 

Usage:
  swx ha [command] 

Available Commands:
  create        Create or Update the HA cluster of swxtches using a config file
  destroy       Destroy the HA cluster
  show          Show information about the HA cluster 

Flags:
  -h, --help                          help for ha
  -s, --service-host-address string   Host swxtch address in the form <host>[:port]
  -d, --show-error                    show-error - display additional information for error messages. 

Use "swx ha [command] --help" for more information about a command.

NOTE

The default port in which the cloudSwXtch listens for these swx configuration commands is port 80. You can safely omit the port in the "-s" parameter since 80 will be used. Do not use port 10802 (the one used in the config file), as it is intended for xNIC communications only. It will not work for swx commands. 

HA Create

To create or update an HA cluster, a HAconfig.json file must exist. Note that the IP is for the control plane. The following shows the format: 

{
	"name": "MY High Availability",
	"paths": [
		{
			"name": "Path 1",
			"swxtches": [
				"10.2.128.10"
			]
		},
		{
			"name": "Path 2",
			"swxtches": [
				"10.5.1.6"
			]
		}
	]
}

If there are multiple cloudSwXtches in a path then the last cloudSwXtch added will have the IP address in the configuration. The rest of the cloudSwXtches do not need to be listed. 

The -h and --help commands will show the syntax for the "swx ha create" command. 

PS C:\Users\testadmin> swx ha create -h
Create or Update the HA cluster of swxtches using a config file 

Usage:
  swx ha create [flags] 

Flags:
  -h, --help           help for create
  -i, --input string   JSON input file 

Global Flags:
  -s, --service-host-address string   Host swxtch address in the form <host>[:port]
  -d, --show-error                    show-error - display additional information for error messages.

Below is the command:

swx ha create -i <path_to_config> -s <cloudSwXtch_IP>

HA Destroy

To remove a cloudSwXtch from the High Availability flow, the "ha destroy" command can be used. The -h and --help commands will show the syntax for the "swx ha destroy" command. 

PS C:\Users\testadmin> swx ha destroy -h
Destroy the HA cluster

Usage:
  swx ha destroy [flags]

Flags:
  -h, --help   help for destroy

Global Flags:
  -s, --service-host-address string   Host swxtch address in the form <host>[:port]
  -d, --show-error                    show-error - display additional information for error messages.

Below is the command to leave: 

PS C:\Users\testadmin> swx ha destroy -s <swxtch name or control data ip of a cloudSwXtch in the HA configuration>

Example:

PS C:\Users\testadmin> swx ha destroy -s cloudswxtch101
Validating cluster deletion.
Successfully deleted the cluster.

Removing a cloudSwXtch from an HA configuration 

To remove a cloudSwXtch from a user's HA configuration, they will need to delete and recreate their HA cluster without that cloudSwXtch.

HA Show

To get a list of cloudSwXtches part of the HA flow, the "ha show" command can be used. The -h and --help commands will show the syntax for the "swx ha show" command. 

PS C:\Users\testadmin> swx ha show -h
Show information about the HA cluster

Usage:
  swx ha show [flags]

Flags:
  -h, --help   help for show

Global Flags:
  -s, --service-host-address string   Host swxtch address in the form <host>[:port]
  -d, --show-error                    show-error - display additional information for error messages.

Below is the command to list: 

swx ha show -s <swxtch name or control data IP of a cloudSwXtch in the HA configuration> 

Example below: 

PS C:\Users\testadmin> swx ha show -s  cloudswxtch101
{
    "clusterConfig": {
        "uid": "D20E820C-91DE-A571-4C7C-B60C1695973D",
        "name": "dsd-100-200-HA",
        "paths": [
            {
                "name": "Path1",
                "swxtches": [
                    "10.2.128.10"
                ]
            },
            {
                "name": "Path2",
                "swxtches": [
                    "10.5.1.6"
                ]
            }
        ]
    }
}

swxtch-top has options for High Availability. For more information, see the swxtch-top article.