-
Notifications
You must be signed in to change notification settings - Fork 217
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
Merged
Merged
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
4d6de23
owls-83995 - Scripts to start/stop a managed server/cluster/domain
ankedia e20b630
fix method comments
ankedia 7a2b1e3
Minor changes
ankedia cf096af
Address review comments and fix script comments/usages.
ankedia 302a597
Added integration tests, made few doc changes based on review comment…
ankedia a134689
Clarify script usage, updated README file and minor changes.
ankedia 97b7fcd
Changes to add script usage details
ankedia fde5cb8
Address PR review comments
ankedia 2927762
Review comment and cleanup.
ankedia 01e6307
Documentation changes based on PR review comments.
ankedia 4eba072
Fully qualified replica value as per review comments
ankedia eadad48
edit docs
rosemarymarano 5845883
edit README
rosemarymarano 1fda64a
Address PR review comments
ankedia 71922eb
Changes to address PR review comments and removed ItLifecycleSampleSc…
ankedia d66c1a8
fix indentation
ankedia 05c5a3f
fix comment and typo
ankedia 0ba9537
Added validation as per review comment.
ankedia 0ab8bd0
changes to address review comment and minor cleanup
ankedia 3950815
PR review comment - changes to assume default policy is IF_NEEDED if …
ankedia 2859f08
changes for new algorithm as documented on http://aseng-wiki.us.oracl…
ankedia 81e0486
More changes for new algorithm.
ankedia c6c287b
code refactoring and minor doc update.
ankedia 3456c68
Minor change for dynamic server name validation
ankedia df3c33f
Changes to address review comments.
ankedia 3e028fb
More review comment changes and cleanup.
ankedia 10feb99
Unset policy to start independent (stadalone) maanged server instead …
ankedia 15c725a
Latest review comment changes.
ankedia e5b1044
More changes based on review comments.
ankedia b17410a
Chnages for latest review comments.
ankedia 38d442d
Remove unused action variable and assignments.
ankedia e4bf493
Fix the logic to display error when config map not found and return p…
ankedia b775210
Changes for latest review comments.
ankedia c1f109d
Changes for latest round of review comments.
ankedia 2c5ae36
use printError instead of echo
ankedia 899073a
Changes to remove integration tests and doc review comments.
ankedia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
docs-source/content/samples/simple/domains/lifecycle/_index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
415 changes: 415 additions & 0 deletions
415
integration-tests/src/test/java/oracle/weblogic/kubernetes/ItSamples.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 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 the replica count: | ||
``` | ||
$ 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 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 the replica count: | ||
``` | ||
$ 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! |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.