You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/scaling.md
+14-12Lines changed: 14 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Scaling a WebLogic cluster
2
2
3
-
WebLogic Server supports two types of clustering configurations, configured and dynamic. Configured clusters are created by manually configuring each individual Managed Server instance. In dynamic clusters, the Managed Server configurations are generated from a single, shared template. With dynamic clusters, when additional server capacity is needed, new server instances can be added to the cluster without having to manually configure them individually. Also, unlike configured clusters, scaling up of dynamic clusters is not restricted to the set of servers defined in the cluster but can be increased based on runtime demands. For more information on how to create, configure, and use dynamic clusters in WebLogic Server, see [Dynamic Clusters](https://docs.oracle.com/middleware/1221/wls/CLUST/dynamic_clusters.htm#CLUST678).
3
+
WebLogic Server supports two types of clustering configurations, configured and dynamic. Configured clusters are created by manually configuring each individual Managed Server instance. In dynamic clusters, the Managed Server configurations are generated from a single, shared template. With dynamic clusters, when additional server capacity is needed, new server instances can be added to the cluster without having to manually configure them individually. Also, unlike configured clusters, scaling up of dynamic clusters is not restricted to the set of servers defined in the cluster but can be increased based on runtime demands. For more information on how to create, configure, and use dynamic clusters in WebLogic Server, see [Dynamic Clusters](https://docs.oracle.com/middleware/12213/wls/CLUST/dynamic_clusters.htm#CLUST678).
4
4
5
5
The following blogs provide more in-depth information on support for scaling WebLogic clusters in Kubernetes:
6
6
*[Automatic Scaling of WebLogic Clusters on Kubernetes](https://blogs.oracle.com/weblogicserver/automatic-scaling-of-weblogic-clusters-on-kubernetes-v2)
@@ -18,7 +18,7 @@ The easiest way to scale a WebLogic cluster in Kubernetes is to simply edit the
18
18
```
19
19
$ kubectl edit domain domain1 -n [namespace]
20
20
```
21
-
Here we are editing a domain resource named 'domain1'. The `kubectl edit` command will open the domain resource definition in an editor and allow you to modify the `replicas` value directly. Once committed, the operator will be notified of the change and will immediately attempt to scale the corresponding dynamic cluster by reconciling the number of running pods/Managed Server instances with the `replicas` value specification.
21
+
Here we are editing a domain resource named `domain1`. The `kubectl edit` command will open the domain resource definition in an editor and allow you to modify the `replicas` value directly. Once committed, the operator will be notified of the change and will immediately attempt to scale the corresponding dynamic cluster by reconciling the number of running pods/Managed Server instances with the `replicas` value specification.
22
22
```
23
23
spec:
24
24
...
@@ -71,8 +71,8 @@ The `/scale` REST endpoint accepts an HTTP POST request and the request body sup
71
71
The `managedServerCount` value designates the number of WebLogic Server instances to scale to. Note that the scale resource is implemented using the JAX-RS framework, and so a successful scaling request will return an HTTP response code of `204 (“No Content”)` because the resource method’s return type is void and does not return a message body.
72
72
73
73
When you POST to the `/scale` REST endpoint, you must send the following headers:
74
-
*`X-Requested-By` request value. The value is an arbitrary name such as 'MyClient'.
75
-
*`Authorization: Bearer` request value. The value of the 'Bearer' token is the WebLogic domain service account token.
74
+
*`X-Requested-By` request value. The value is an arbitrary name such as `MyClient`.
75
+
*`Authorization: Bearer` request value. The value of the `Bearer` token is the WebLogic domain service account token.
76
76
77
77
For example, when using `curl`:
78
78
@@ -101,8 +101,8 @@ When the operator receives a scaling request, it will:
101
101
* Validate that the WebLogic cluster, identified by `clusterName`, exists.
102
102
* Verify that the specified WebLogic cluster has a sufficient number of configured servers to satisfy the scaling request.
103
103
* Initiate scaling by setting the `replicas` property within the corresponding domain resource, which can be done in either:
104
-
* A `cluster` entry, if defined within its cluster list.
105
-
* At the domain level, if not defined in a `cluster` entry.
104
+
* A `cluster` entry, if defined within its cluster list.
105
+
* At the domain level, if not defined in a `cluster` entry.
106
106
107
107
In response to a change to either `replicas` property, in the domain resource, the operator will increase or decrease the number of pods (Managed Servers) to match the desired replica count.
108
108
@@ -117,7 +117,7 @@ for use as a Script Action, which illustrates how to issue a request to the oper
117
117
The following steps are provided as a guideline on how to configure a WLDF Policy and Script Action component for issuing scaling requests to the operator's REST endpoint:
118
118
1. Copy the [`scalingAction.sh`](/src/scripts/scaling/scalingAction.sh) script to a directory (such as `$DOMAIN_HOME/bin/scripts`) so that it's accessible within the Administration Server pod.
119
119
2. Configure a WLDF policy and action as part of a diagnostic module targeted to the Administration Server. For information about configuring the WLDF Policies and Actions component,
120
-
see [Configuring Policies and Actions](https://docs.oracle.com/middleware/1221/wls/WLDFC/config_watch_notif.htm#WLDFC188) in _Configuring and Using the Diagnostics Framework for Oracle WebLogic Server_.
120
+
see [Configuring Policies and Actions](https://docs.oracle.com/middleware/12213/wls/WLDFC/config_watch_notif.htm#WLDFC188) in _Configuring and Using the Diagnostics Framework for Oracle WebLogic Server_.
121
121
122
122
a. Configure a WLDF policy with a rule expression for monitoring WebLogic Server metrics, such as memory, idle threads, and CPU load for example.
123
123
@@ -148,7 +148,9 @@ see [Configuring Policies and Actions](https://docs.oracle.com/middleware/1221/w
148
148
149
149
* `cluster_name` - WebLogic cluster name (Required)
150
150
151
-
* `kubernetes_master` - Kubernetes master URL, default=https://kubernetes. **NOTE**: Set this to https://kubernetes.default.svc when invoking `scalingAction.sh` from the Administration Server pod.
**NOTE**: Set this to https://kubernetes.default.svc when invoking `scalingAction.sh` from the Administration Server pod.
152
154
153
155
* `access_token` - Service Account Bearer token for authentication and authorization for access to REST Resources
154
156
@@ -230,7 +232,7 @@ roleRef:
230
232
231
233
## Using a Prometheus alert action to call the operator's REST scale API
232
234
In addition to using the WebLogic Diagnostic Framework for automatic scaling of a dynamic cluster,
233
-
you can use a thirdparty monitoring application like Prometheus. Please read the following blog for
235
+
you can use a third-party monitoring application like Prometheus. Please read the following blog for
234
236
details about [Using Prometheus to Automatically Scale WebLogic Clusters on Kubernetes](https://blogs.oracle.com/weblogicserver/using-prometheus-to-automatically-scale-weblogic-clusters-on-kubernetes-v5).
235
237
236
238
## Helpful Tips
@@ -241,16 +243,16 @@ Administration Server pod because the associated diagnostic module is targed to
241
243
The easiest way to verify and debug the `scalingAction.sh` script is to open a shell on the running Administration Server pod and execute the script on the command line.
242
244
243
245
The following example illustrates how to open a bash shell on a running Administration Server pod named `domain1-admin-server` and execute the `scriptAction.sh` script. It assumes that:
244
-
*the domain home is in `/u01/oracle/user-projects/domains/domain1` (i.e. the domain home is inside a docker image).
245
-
*the Dockerfile copied [`scalingAction.sh`](/src/scripts/scaling/scalingAction.sh) to `/u01/oracle/user-projects/domains/domain1/bin/scripts/scalingAction.sh`.
246
+
*The domain home is in `/u01/oracle/user-projects/domains/domain1` (that is, the domain home is inside a Docker image).
247
+
*The Dockerfile copied [`scalingAction.sh`](/src/scripts/scaling/scalingAction.sh) to `/u01/oracle/user-projects/domains/domain1/bin/scripts/scalingAction.sh`.
246
248
247
249
```
248
250
> kubectl exec -it domain1-admin-server /bin/bash
249
251
# bash> cd /u01/oracle/user-projects/domains/domain1/bin/scripts
250
252
# bash> ./scalingAction.sh
251
253
```
252
254
253
-
A log, `scalingAction.log`, will be generated in the same directory as the script was executed in and can be examined for errors.
255
+
A log, `scalingAction.log`, will be generated in the same directory in which the script was executed and can be examined for errors.
254
256
255
257
### Example on accessing the external REST endpoint
256
258
The easiest way to test scaling using the external REST endpoint is to use a command-line tool like `curl`. Using `curl` to issue
0 commit comments