Configuring your environment for the cluster scenarios

You can set up your environment so that you can test cluster scenarios 1 and 2. Use these scenarios to help you to understand clustering and message flow, and to get up and running quickly.

Setting up your cluster

You can configure your IBM® IoT MessageSight cluster by using REST Administration APIs. Substitute your IP addresses for the server IP address. The sample IP addresses are used as examples only. The DiscoveryServerList configuration parameter has the following format: <control address>:<control port>[,<control address>:<control port>]+

IBM IoT MessageSight SERVER1CONTROLADDRESS=10.10.33.10 
IBM IoT MessageSight SERVER1CONTROLPORT=9104 
IBM IoT MessageSight SERVER2CONTROLADDRESS=10.10.33.11 
IBM IoT MessageSight SERVER2CONTROLPORT=9104 
IBM IoT MessageSight SERVER3CONTROLADDRESS=10.10.33.12 
IBM IoT MessageSight SERVER3CONTROLPORT=9104
  1. For Server 1 of your cluster, provide ClusterMembership object configuration data in the payload of the POST method by using the following command:
    
    curl -X POST \
         -d  ' {
                  "ClusterMembership": {
                      "EnableClusterMembership": true,
                      "ControlAddress": "10.10.33.10",
                      "DiscoveryServerList": "10.10.33.11:9104,10.10.33.12:9104",
                      "ClusterName": "MyCluster"
                    }
                }
             ' \
          http://127.0.0.1:9089/ima/v1/configuration
  2. For Server 2 of your cluster, provide ClusterMembership object configuration data in the payload of the POST method by using the following command:
    
    curl -X POST \
         -d  ' {
                  "ClusterMembership": {
                    "EnableClusterMembership": true,
                    "ControlAddress": "10.10.33.11",
                    "DiscoveryServerList": "10.10.33.10:9104",
                    "ClusterName": "MyCluster"
                    }
                }
             ' \
          http://127.0.0.1:9089/ima/v1/configuration
  3. For Server 3 of your cluster, provide ClusterMembership object configuration data in the payload of the POST method by using the following command:
    
    curl -X POST \
         -d  ' {
                  "ClusterMembership": {
                    "EnableClusterMembership": true,
                    "ControlAddress": "10.10.33.12",
                    "DiscoveryServerList": "10.10.33.10:9104",
                    "ClusterName": "MyCluster"
                    }
                 }
               ' \
          http://127.0.0.1:9089/ima/v1/configuration
  4. Restart each server by using cURL:

    curl -X POST \
         -d  ' {"Service" : "Server"} ' \
         http://127.0.0.1:9089/ima/v1/service/restart