Add cache managed server to Oracle WebLogic Server Coherence cluster

This page documents how to configure an existing deployment of Oracle WebLogic Server to add new managed cache server using Azure CLI.

Prerequisites

Environment for Setup

WebLogic Server Instance

The addnode-coherence.json template will be applied to an existing Oracle WebLogic Server Coherence cluster. If you don’t have one, please create a new instance from the Azure portal, by following the link to the offer in the index.

Coherence cluster

You can configure Coherence cluster from Azure portal or running Coherence sub template.

Prepare the Parameters JSON file

You must construct a parameters JSON file containing the parameters to addnode-coherence.json template. See Create Resource Manager parameter file for background information about parameter files. You must specify the information of the existing Oracle WebLogic Server and nodes that to be added. This section shows how to obtain the values for the following required properties.

</tr>
Parameter Name Explanation
_artifactsLocation See below for details.
elkSettings Optional. JSON object type. You can specify this parameters for Elasticsearch and Kibana(ELK) connection. If enable is true, must specify other properties. See the page WebLogic with Elastic on Azure for further information.
enable If enable is true, must specify all properties of the elkSettings.
elasticsearchEndpoint Endpoint of the Elasticsearch instance.
elasticsearchPassword Password for Elasticsearch account.
elasticsearchUserName User name for Elasticsearch account.
logIndex Must be the same value output at ELK deployment time.
logsToIntegrate Array with string value. Specify the expeted logs to integrate, you must input at least one log.
adminPasswordOrKey Password of administration account for the new Virtual Machine that host new nodes.
adminVMName Virtual machine name of which hosts the Oracle WebLogic Server admin server, for example: adminVM.
enableCoherenceWebLocalStorage Specifies whether Local Storage is enabled for the Coherence*Web cluster tier.
location Must be the same region into which the server was initially deployed.
managedServerPrefix Must be the same prefix with which the cluster was initially deployed.
numberOfExistingCacheNodes Number of existing Coherence cache servers, used to name new virtual machines and new managed server.
numberOfNewCacheNodes Number of new Coherence cahce servers, used to create Virtual Machines and Managed Server.
skuUrnVersion Must be the same urn with which the cluster was initially deployed.
storageAccountName The name of an existing storage account.
vmSize Select appropriate VM Size for Coherence cache servers.
wlsDomainName Must be the same value provided at deployment time.
wlsPassword Must be the same value provided at deployment time.
wlsUserName Must be the same value provided at deployment time.

_artifactsLocation

This value must be the following.

https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/

Existing cache nodes

To differentiate functionality of managed cache servers, we use managed application server to represent managed servers that host Java EE application, and use managed cache server to represent managed servers that used for cache.

You can get the existing managed cache servers with the following command:

$ resourceGroup=<your-resource-group>
$ managedServerPrefix=<managed-server-prefix>
$ numberOfExistingCacheNodes=$(az resource list -g ${resourceGroup} --resource-type Microsoft.Compute/virtualMachines --query [*].name | grep "${managedServerPrefix}StorageVM[0-9]" | sed -e 's/[^0-9]/ /g' -e 's/^ *//g' -e 's/ *$//g' | tr -s ' ' | sed 's/ /\n/g' | sort  -nr | head -n1)
$ echo ${numberOfExistingCacheNodes}

Log index

If you configured ELK in your cluster to export WebLogic Server logs to ELK, please input the value of Kibana log index, this template will set up ELK connection and export logs to specified index.

You can get the value from Azure portal with the following steps:

Alternatively, use Azure CLI command to list log index inside the resource group deployments:

$ az deployment group list -g 'yourResourceGroup' --query [*].properties.outputs.logIndex.value
[
  "azure-weblogic-cluster-f984df74-ab4d-4c17-a532-7f248659fb28"
]

Storage account

Each Storage Account handles up to 20,000 IOPS, and 500TB of data. If you use a storage account for Standard Virtual Machines, you can store until 40 virtual disks.

We have two disks for one Virtual Machine, it’s suggested no more than 20 Virtual Machines share the same storage account. Number of virtual machines that hosting managed servers should be less than or equal to 20.

You can get the name of storage account from Azure portal with steps:

Alternatively, use Azure CLI command to list storage account inside a resource group:

$ az resource list -g 'yourResourceGroup' --resource-type Microsoft.Storage/storageAccounts --query [*].name
[
  "219846olvm"
]

Example Parameters JSON

Here is a fully filled out parameters file. We will leave values of adminUsername, authenticationType, dnsLabelPrefix, usePreviewImage and vmSize as default value.

Some things to note:

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "_artifactsLocation": {
            "value": "https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/"
        },
        "adminPasswordOrKey": {
            "value": "jyfRat@nht2019"
        },
        "adminVMName": {
           "value": "adminVM"
        },
        "elkSettings": {
            "value": {
                "enable": true,
                "elasticsearchEndpoint":"https://example.eastus2.azure.elastic-cloud.com:9243",
                "elasticsearchPassword": "Secret123!",
                "elasticsearchUserName":"elastic",
                "logIndex": "azure-weblogic-dynamic-cluster-11122020",
                "logsToIntegrate": ["HTTPAccessLog", "ServerLog", "DomainLog", "DataSourceLog", "StandardErrorAndOutput", "NodeManagerLog"]
            }
        },
        "enableCoherenceWebLocalStorage": {
           "value": true
        },
        "location": {
            "value": "eastus"
        },
        "managedServerPrefix": {
           "value": "msp"
        },
        "numberOfExistingCacheNodes": {
            "value": 1
        },
        "numberOfNewCacheNodes": {
            "value": 1
        },
        "skuUrnVersion": {
          "value": "owls-122140-8u251-ol76;Oracle:weblogic-122140-jdk8u251-ol76:owls-122140-8u251-ol7;latest"
        },
        "storageAccountName": {
            "value": "d40140olvm"
        },
        "wlsDomainName": {
            "value": "wlsd"
        },
        "wlsPassword": {
          "value": "welcome1"
        },
        "wlsUserName": {
          "value": "weblogic"
        }
    }
}

Invoke the ARM template

Assume your parameters file is available in the current directory and is named parameters.json. This section shows the commands to configure your Oracle WebLogic Server deployment to add new nodes. Replace yourResourceGroup with the Azure resource group in which the Oracle WebLogic Server is deployed.

First, validate your parameters file

The az deployment group validate command is very useful to validate your parameters file is syntactically correct.

az deployment group validate --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/arm/mainTemplate.json

If the command returns with an exit status other than 0, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad echo $? immediately after the az command.

Next, execute the template

After successfully validating the template invocation, change validate to create to invoke the template.

az deployment group create --verbose --resource-group `yourResourceGroup` --parameters @parameters.json --template-uri https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/arm/mainTemplate.json

As with the validate command, if the command returns with an exit status other than 0, inspect the output and resolve the problem.

This is an example output of successful deployment. Look for "provisioningState": "Succeeded" in your output.

{
  "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/mainTemplate",
  "location": null,
  "name": "mainTemplate",
  "properties": {
    "correlationId": "19040fc8-2b74-4e64-9dd9-59a5a3ce401a",
    "debugSetting": null,
    "dependencies": [
      {
        "dependsOn": [
          {
            "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript",
            "resourceGroup": "haiche-cluster-1106",
            "resourceName": "mspStorageVM2/newuserscript",
            "resourceType": "Microsoft.Compute/virtualMachines/extensions"
          }
        ],
        "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Resources/deployments/pid-157ea8ac-12ae-11eb-adc1-0242ac120002",
        "resourceGroup": "haiche-cluster-1106",
        "resourceName": "pid-157ea8ac-12ae-11eb-adc1-0242ac120002",
        "resourceType": "Microsoft.Resources/deployments"
      },
      {
        "dependsOn": [
          {
            "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM2_PublicIP",
            "resourceGroup": "haiche-cluster-1106",
            "resourceName": "mspStorageVM2_PublicIP",
            "resourceType": "Microsoft.Network/publicIPAddresses"
          }
        ],
        "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC",
        "resourceGroup": "haiche-cluster-1106",
        "resourceName": "mspStorageVM2_NIC",
        "resourceType": "Microsoft.Network/networkInterfaces"
      },
      {
        "dependsOn": [
          {
            "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC",
            "resourceGroup": "haiche-cluster-1106",
            "resourceName": "mspStorageVM2_NIC",
            "resourceType": "Microsoft.Network/networkInterfaces"
          },
          {
            "apiVersion": "2019-06-01",
            "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm",
            "resourceGroup": "haiche-cluster-1106",
            "resourceName": "33f2e3olvm",
            "resourceType": "Microsoft.Storage/storageAccounts"
          }
        ],
        "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2",
        "resourceGroup": "haiche-cluster-1106",
        "resourceName": "mspStorageVM2",
        "resourceType": "Microsoft.Compute/virtualMachines"
      },
      {
        "dependsOn": [
          {
            "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2",
            "resourceGroup": "haiche-cluster-1106",
            "resourceName": "mspStorageVM2",
            "resourceType": "Microsoft.Compute/virtualMachines"
          },
          {
            "actionName": "listKeys",
            "apiVersion": "2019-04-01",
            "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Storage/storageAccounts/33f2e3olvm",
            "resourceGroup": "haiche-cluster-1106",
            "resourceName": "33f2e3olvm",
            "resourceType": "Microsoft.Storage/storageAccounts"
          }
        ],
        "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript",
        "resourceGroup": "haiche-cluster-1106",
        "resourceName": "mspStorageVM2/newuserscript",
        "resourceType": "Microsoft.Compute/virtualMachines/extensions"
      }
    ],
    "duration": "PT10M24.4018847S",
    "mode": "Incremental",
    "onErrorDeployment": null,
    "outputResources": [
      {
        "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2",
        "resourceGroup": "haiche-cluster-1106"
      },
      {
        "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Compute/virtualMachines/mspStorageVM2/extensions/newuserscript",
        "resourceGroup": "haiche-cluster-1106"
      },
      {
        "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/networkInterfaces/mspStorageVM2_NIC",
        "resourceGroup": "haiche-cluster-1106"
      },
      {
        "id": "/subscriptions/685ba005-af8d-4b04-8f16-a7bf38b2eb5a/resourceGroups/haiche-cluster-1106/providers/Microsoft.Network/publicIPAddresses/mspStorageVM2_PublicIP",
        "resourceGroup": "haiche-cluster-1106"
      }
    ],
    "outputs": {
      "artifactsLocationPassedIn": {
        "type": "String",
        "value": "https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/"
      }
    },
    "parameters": {
      "_artifactsLocation": {
        "type": "String",
        "value": "https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-vm/arm-oraclelinux-wls-cluster/addnode-coherence/src/main/"
      },
      "_artifactsLocationSasToken": {
        "type": "SecureString"
      },
      "adminPasswordOrKey": {
        "type": "SecureString"
      },
      "adminUsername": {
        "type": "String",
        "value": "weblogic"
      },
      "adminVMName": {
        "type": "String",
        "value": "adminVM"
      },
      "authenticationType": {
        "type": "String",
        "value": "password"
      },
      "dnsLabelPrefix": {
        "type": "String",
        "value": "wls"
      },
      "enableCoherenceWebLocalStorage": {
        "type": "Bool",
        "value": true
      },
      "guidValue": {
        "type": "String",
        "value": "d5dde421-44b0-48df-9d12-db02374654d3"
      },
      "location": {
        "type": "String",
        "value": "eastus"
      },
      "managedServerPrefix": {
        "type": "String",
        "value": "msp"
      },
      "numberOfExistingCacheNodes": {
        "type": "Int",
        "value": 1
      },
      "numberOfNewCacheNodes": {
        "type": "Int",
        "value": 1
      },
      "skuUrnVersion": {
        "type": "String",
        "value": "owls-122130-8u131-ol74;Oracle:weblogic-122130-jdk8u131-ol74:owls-122130-8u131-ol7;latest"
      },
      "storageAccountName": {
        "type": "String",
        "value": "33f2e3olvm"
      },
      "usePreviewImage": {
        "type": "Bool",
        "value": false
      },
      "vmSize": {
        "type": "String",
        "value": "Standard_A1"
      },
      "wlsDomainName": {
        "type": "String",
        "value": "wlsd"
      },
      "wlsPassword": {
        "type": "SecureString"
      },
      "wlsUserName": {
        "type": "String",
        "value": "weblogic"
      }
    },
    "parametersLink": null,
    "providers": [
      {
        "id": null,
        "namespace": "Microsoft.Resources",
        "registrationPolicy": null,
        "registrationState": null,
        "resourceTypes": [
          {
            "aliases": null,
            "apiVersions": null,
            "capabilities": null,
            "locations": [
              null
            ],
            "properties": null,
            "resourceType": "deployments"
          }
        ]
      },
      {
        "id": null,
        "namespace": "Microsoft.Network",
        "registrationPolicy": null,
        "registrationState": null,
        "resourceTypes": [
          {
            "aliases": null,
            "apiVersions": null,
            "capabilities": null,
            "locations": [
              "eastus"
            ],
            "properties": null,
            "resourceType": "publicIPAddresses"
          },
          {
            "aliases": null,
            "apiVersions": null,
            "capabilities": null,
            "locations": [
              "eastus"
            ],
            "properties": null,
            "resourceType": "networkInterfaces"
          }
        ]
      },
      {
        "id": null,
        "namespace": "Microsoft.Compute",
        "registrationPolicy": null,
        "registrationState": null,
        "resourceTypes": [
          {
            "aliases": null,
            "apiVersions": null,
            "capabilities": null,
            "locations": [
              "eastus"
            ],
            "properties": null,
            "resourceType": "virtualMachines"
          },
          {
            "aliases": null,
            "apiVersions": null,
            "capabilities": null,
            "locations": [
              "eastus"
            ],
            "properties": null,
            "resourceType": "virtualMachines/extensions"
          }
        ]
      }
    ],
    "provisioningState": "Succeeded",
    "template": null,
    "templateHash": "16596437850900945013",
    "templateLink": null,
    "timestamp": "2020-11-09T06:28:40.936524+00:00"
  },
  "resourceGroup": "haiche-cluster-1106",
  "type": "Microsoft.Resources/deployments"
}

Verify

Verify if new cache nodes are added to the WebLogic Server instance.

Verify if Azure resources are added