Skip to content

Commit bbcf4dd

Browse files
committed
Checkpoint work
1 parent 3e4032f commit bbcf4dd

File tree

1 file changed

+119
-0
lines changed

1 file changed

+119
-0
lines changed

site/server-lifecycle.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Starting, Stopping and Restarting Servers
2+
3+
This document describes how the user can start, stop and restart the domain's servers.
4+
5+
## Overview
6+
7+
### Starting and Stopping Servers
8+
9+
The "serverStartPolicy" property on domain resource controls which servers should be running.
10+
The operator runtime monitors this property and creates or deletes the corresponding server pods.
11+
12+
### Restarting Servers
13+
14+
The operator runtime automatically recreates (restarts) server pods when properties on the domain resource that affect server pods change (such as "image", "volumes" and "env").
15+
The "restartVersion" property on the domain resource lets the user force the operator to restart a set of server pods.
16+
17+
The operator runtime does rolling restarts of clustered servers so that that service is maintained.
18+
The "maxUnavailable" property determines how many of the cluster's servers may be taken out of service at a time when doing a rolling restart.
19+
By default, the servers are restarted one at a time.
20+
21+
## Starting and Stopping Servers
22+
23+
### serverStartPolicy rules
24+
25+
The "serverStartPolicy" property determine which servers should be running.
26+
27+
It can be specified at the domain, cluster and server levels. Each level supports a different set of values:
28+
* domain: "NEVER", "IF_NEEDED", "ADMIN_ONLY", defaults to "IF_NEEDED"
29+
* cluster: "NEVER", "IF_NEEDED", defaults to "IF_NEEDED"
30+
* server: "NEVER", "IF_NEEDED", "ALWAYS", defaults to "IF_NEEDED"
31+
32+
The admin server will be started if:
33+
* the domain is "ADMIN_ONLY" or "IF_NEEDED" (i.e. not "NEVER")
34+
* AND
35+
* the adminServer is "ALWAYS" or "IF_NEEDED" (i.e. not "NEVER")
36+
37+
A stand alone managed server will be started if:
38+
* the domain is "IF_NEEDED" (i.e. not "NEVER" or "ADMIN_ONLY")
39+
* AND
40+
* the server is "ALWAYS" or "IF_NEEDED" (i.e. not "NEVER")
41+
42+
A clustered managed server will be started if:
43+
* the domain is "IF_NEEDED" (i.e. not "NEVER" or "ADMIN_ONLY")
44+
* AND
45+
* the cluster is "IF_NEEDED" (I.e. not "NEVER")
46+
* AND
47+
** the server is "ALWAYS", or if the server is "IF_NEEDED" and the operator needs to start it to get to the cluster's "replicas" count
48+
49+
### Common Scenarios
50+
51+
#### Normal Running State
52+
Normally, the admin server, all of the stand alone managed servers, and enough managed servers in each cluster to satisfy its "replicas" count should be started.
53+
In this case, the domain resource does not need to specify "serverStartPolicy", or list any "clusters" or "servers", but it does need to specify a "replicas" count.
54+
55+
For example:
56+
```
57+
domain:
58+
spec:
59+
image: ...
60+
replicas: 10
61+
```
62+
63+
#### Shut Down All the Servers
64+
Sometimes the user needs to completely shut down the domain (i.e. take it out of service).
65+
The simplest was to do this is to set the domain level "serverStartPolicy" to "NEVER":
66+
```
67+
domain:
68+
spec:
69+
serverStartPolicy: "NEVER"
70+
...
71+
```
72+
73+
#### Only Start the Admin Server
74+
Sometimes the user wants to only start the admin server, that is, take the domain out of service but leave the admin server running so that the user can administer the domain.
75+
```
76+
domain:
77+
spec:
78+
serverStartPolicy: "ADMIN_ONLY"
79+
...
80+
```
81+
82+
#### Shut Down A Cluster
83+
To shut down a cluster, add it to the domain resource and set its "serverStartPolicy" to "NEVER"
84+
```
85+
domain:
86+
spec:
87+
clusters:
88+
- clusterName: "cluster1"
89+
serverStartPolicy: "NEVER"
90+
...
91+
```
92+
93+
#### Shut Down a Specific Stand Alone Server
94+
To shut down a specific stand alone server, add it to the domain resource and set its "serverStartPolicy" to "NEVER"
95+
```
96+
domain:
97+
spec:
98+
managedServers:
99+
- serverName: "server1"
100+
serverStartPolicy: "NEVER"
101+
...
102+
```
103+
104+
#### Force a Specific Clustered Managed Server To Start
105+
Normally, all of the managed servers in a cluster are identical and it doesn't matter which ones are run as long as the operator starts enough to get to the cluster's "replicas" count.
106+
However, sometimes some of the managed servers might be different (e.g support some extra services that the other servers in the cluster use) and need to always to started.
107+
108+
This is done by adding the server to the domain resource and settings its "serverStartPolicy" to "ALWAYS".
109+
```
110+
domain:
111+
spec:
112+
managedServers:
113+
- serverName: "cluster1_server1"
114+
serverStartPolicy: "ALWAYS"
115+
...
116+
```
117+
118+
Note: the server will count towards the cluster's "replicas" count. Also, if the user configures more than "replicas" servers to "ALWAYS", they will all be started, even though "replicas" will be exceeded.
119+

0 commit comments

Comments
 (0)