-
Notifications
You must be signed in to change notification settings - Fork 218
Owls83995 - Sample scripts to shutdown and start a specific managed server/cluster/domain #2002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 32 commits
4d6de23
e20b630
7a2b1e3
cf096af
302a597
a134689
97b7fcd
fde5cb8
2927762
01e6307
4eba072
eadad48
5845883
1fda64a
71922eb
d66c1a8
05c5a3f
0ba9537
0ab8bd0
3950815
2859f08
81e0486
c6c287b
3456c68
df3c33f
3e028fb
10feb99
15c725a
e5b1044
b17410a
38d442d
e4bf493
b775210
c1f109d
2c5ae36
899073a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: "Domain lifecycle operations" | ||
date: 2019-02-23T17:32:31-05:00 | ||
weight: 8 | ||
description: "Start and stop Managed Servers, clusters, and domains." | ||
--- | ||
|
||
#### Domain lifecycle sample scripts | ||
|
||
Beginning in version 3.1.0, the operator provides sample scripts to start up or shut down a specific Managed Server or cluster in a deployed domain, or the entire deployed domain. | ||
|
||
**Note**: Prior to running these scripts, you must have previously created and deployed the domain. | ||
|
||
The scripts are located in the `kubernetes/samples/scripts/domain-lifecycle` directory. They are helpful when scripting the life cycle of a WebLogic Server domain. For more information, see the [README](https://github.com/oracle/weblogic-kubernetes-operator/tree/master/kubernetes/samples/scripts/domain-lifecycle/README.md). |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
### Domain lifecycle sample scripts | ||
|
||
The operator provides sample scripts to start up or shut down a specific Managed Server or cluster in a deployed domain, or the entire deployed domain. | ||
|
||
**Note**: Prior to running these scripts, you must have previously created and deployed the domain. | ||
|
||
These scripts can be helpful when scripting the life cycle of a WebLogic Server domain. For information on how to start, stop, restart, and scale WebLogic Server instances in your domain, see [Domain Life Cycle](https://oracle.github.io/weblogic-kubernetes-operator/userguide/managing-domains/domain-lifecycle). | ||
|
||
#### Scripts to start and stop a Managed Server | ||
The `startServer.sh` script starts a Managed Server either by increasing the `spec.clusters[<cluster-name>].replicas` value for the Managed Server's cluster by `1` or by updating the `spec.managedServers[<server-name>].serverStartPolicy` attribute of the domain resource or both as necessary. The script provides an option to keep the `spec.clusters[<cluster-name>].replicas` value constant for clustered servers. See the script `usage` information by using the `-h` option. | ||
|
||
Use the following command to start the server along with increased replica count: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. start the server along with increased replica count -> start the server along with an increased replica count OR start the server with an increased replica count There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, I have reworded it to say "start the server either by increasing the replica count or by updating the server start policy". |
||
``` | ||
$ startServer.sh -d domain1 -n weblogic-domain-1 -s managed-server1 | ||
[INFO] Updating replica count for cluster 'cluster-1' to 1. | ||
domain.weblogic.oracle/domain1 patched | ||
[INFO] Successfully updated replica count for cluster 'cluster-1' to 1. | ||
``` | ||
|
||
Use the following command to start the server without increasing replica count: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. without increasing replica count -> without increasing the replica count There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
``` | ||
$ startServer.sh -d domain1 -n weblogic-domain-1 -s managed-server2 -k | ||
[INFO] Patching start policy for 'managed-server2' to 'ALWAYS'. | ||
domain.weblogic.oracle/domain1 patched | ||
[INFO] Successfully patched server 'managed-server2' with 'ALWAYS' start policy. | ||
``` | ||
|
||
The `stopServer.sh` script shuts down a running Managed Server either by decreasing the `spec.clusters[<cluster-name>].replicas` value for the Managed Server's cluster by `1` or by patching the `spec.managedServers[<server-name>].serverStartPolicy` attribute of the domain resource or both as necessary. The script provides an option to keep the `spec.clusters[<cluster-name>].replicas` value constant for clustered servers. See the script `usage` information by using the `-h` option. | ||
|
||
Use the following command to stop the server along with decreased replica count: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. stop the server along with decreased replica count -> this does not make sense to me; do you mean stop the server along with decreasing the replica count OR stop the server with a decreased replica count? Please clarify. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed to say "stop the server either by decreasing the replica count or by updating the server start policy" |
||
``` | ||
$ stopServer.sh -d domain1 -n weblogic-domain-1 -s managed-server1 | ||
[INFO] Updating replica count for cluster cluster-1 to 0. | ||
domain.weblogic.oracle/domain1 patched | ||
[INFO] Successfully updated replica count for cluster 'cluster-1' to 0. | ||
``` | ||
|
||
Use the following command to stop the server without decreasing replica count: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. stop the server without decreasing replica count -> stop the server without decreasing the replica count There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. |
||
``` | ||
$ stopServer.sh -d domain1 -n weblogic-domain-1 -s managed-server2 -k | ||
[INFO] Unsetting the current start policy 'ALWAYS' for 'managed-server2'. | ||
domain.weblogic.oracle/domain1 patched | ||
[INFO] Successfully unset policy 'ALWAYS'. | ||
``` | ||
tbarnes-us marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Scripts to start and stop a cluster | ||
|
||
The `startCluster.sh` script starts a cluster by patching the `spec.clusters[<cluster-name>].serverStartPolicy` attribute of the domain resource to `IF_NEEDED`. The operator will start the WebLogic Server instance Pods that are part of the cluster after the `serverStartPolicy` attribute is updated to `IF_NEEDED`. See the script `usage` information by using the `-h` option. | ||
``` | ||
$ startCluster.sh -d domain1 -n weblogic-domain-1 -c cluster-1 | ||
[INFO]Patching start policy of cluster 'cluster-1' from 'NEVER' to 'IF_NEEDED'. | ||
domain.weblogic.oracle/domain1 patched | ||
[INFO] Successfully patched cluster 'cluster-1' with 'IF_NEEDED' start policy!. | ||
``` | ||
The `stopCluster.sh` script shuts down a cluster by patching the `spec.clusters[<cluster-name>].serverStartPolicy` attribute of the domain resource to `NEVER`. The operator will shut down the WebLogic Server instance Pods that are part of the cluster after the `serverStartPolicy` attribute is updated to `NEVER`. See the script `usage` information by using the `-h` option. | ||
``` | ||
$ stopCluster.sh -d domain1 -n weblogic-domain-1 -c cluster-1 | ||
[INFO] Patching start policy of cluster 'cluster-1' from 'IF_NEEDED' to 'NEVER'. | ||
domain.weblogic.oracle/domain1 patched | ||
[INFO] Successfully patched cluster 'cluster-1' with 'NEVER' start policy! | ||
``` | ||
### Scripts to start and stop a domain | ||
The `startDomain.sh` script starts a deployed domain by patching the `spec.serverStartPolicy` attribute of the domain resource to `IF_NEEDED`. The operator will start the WebLogic Server instance Pods that are part of the domain after the `spec.serverStartPolicy` attribute of the domain resource is updated to `IF_NEEDED`. See the script `usage` information by using the `-h` option. | ||
``` | ||
$ startDomain.sh -d domain1 -n weblogic-domain-1 | ||
[INFO] Patching domain 'domain1' from serverStartPolicy='NEVER' to 'IF_NEEDED'. | ||
domain.weblogic.oracle/domain1 patched | ||
[INFO] Successfully patched domain 'domain1' in namespace 'weblogic-domain-1' with 'IF_NEEDED' start policy! | ||
``` | ||
|
||
The `stopDomain.sh` script shuts down a domain by patching the `spec.serverStartPolicy` attribute of the domain resource to `NEVER`. The operator will shut down the WebLogic Server instance Pods that are part of the domain after the `spec.serverStartPolicy` attribute is updated to `NEVER`. See the script `usage` information by using the `-h` option. | ||
``` | ||
$ stopDomain.sh -d domain1 -n weblogic-domain-1 | ||
[INFO] Patching domain 'domain1' in namespace 'weblogic-domain-1' from serverStartPolicy='IF_NEEDED' to 'NEVER'. | ||
domain.weblogic.oracle/domain1 patched | ||
[INFO] Successfully patched domain 'domain1' in namespace 'weblogic-domain-1' with 'NEVER' start policy! |
Uh oh!
There was an error while loading. Please reload this page.