As OIG domains use the WebLogic Kubernetes Operator, domain lifecyle operations are managed using the WebLogic Kubernetes Operator itself.
This document shows the basic operations for starting, stopping and scaling servers in the OIG domain.
For more detailed information refer to Domain Life Cycle in the WebLogic Kubernetes Operator documentation.
Do not use the WebLogic Server Administration Console or Oracle Enterprise Manager Console to start or stop servers.
The default OIG deployment starts the Administration Server (AdminServer
), one OIG Managed Server (oim_server1
) and one SOA Managed Server (soa_server1
).
The deployment also creates, but doesn’t start, four extra OIG Managed Servers (oim-server2
to oim-server5
) and four more SOA Managed Servers (soa_server2
to soa_server5
).
All these servers are visible in the WebLogic Server Administration Console https://${MASTERNODE-HOSTNAME}:${MASTERNODE-PORT}/console
by navigating to Domain Structure > governancedomain > Environment > Servers.
To view the running servers using kubectl, run the following command:
$ kubectl get pods -n <domain_namespace>
For example:
$ kubectl get pods -n oigns
The output should look similar to the following:
NAME READY STATUS RESTARTS AGE
governancedomain-adminserver 1/1 Running 0 23h
governancedomain-create-fmw-infra-sample-domain-job-8cww8 0/1 Completed 0 24h
governancedomain-oim-server1 1/1 Running 0 23h
governancedomain-soa-server1 1/1 Running 0 23h
The number of OIG Managed Servers running is dependent on the replicas
parameter configured for the cluster. To start more OIG Managed Servers perform the following steps:
Run the following kubectl command to edit the domain:
$ kubectl edit domain <domain_uid> -n <domain_namespace>
For example:
$ kubectl edit domain governancedomain -n oigns
Note: This opens an edit session for the domain where parameters can be changed using standard vi
commands.
In the edit session search for clusterName: oim_cluster
and look for the replicas
parameter. By default the replicas parameter is set to “1” hence a single OIG Managed Server is started (oim_server1
):
- clusterName: oim_cluster
replicas: 1
serverPod:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: weblogic.clusterName
operator: In
values:
- $(CLUSTER_NAME)
To start more OIG Managed Servers, increase the replicas
value as desired. In the example below, one more Managed Server will be started by setting replicas
to “2”:
- clusterName: oim_cluster
replicas: 2
serverPod:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: weblogic.clusterName
operator: In
values:
- $(CLUSTER_NAME)
Save the file and exit (:wq)
The output will look similar to the following:
domain.weblogic.oracle/governancedomain edited
Run the following kubectl command to view the pods:
$ kubectl get pods -n <domain_namespace>
For example:
$ kubectl get pods -n oigns
The output will look similar to the following:
NAME READY STATUS RESTARTS AGE
governancedomain-adminserver 1/1 Running 0 23h
governancedomain-create-fmw-infra-sample-domain-job-8cww8 0/1 Completed 0 24h
governancedomain-oim-server1 1/1 Running 0 23h
governancedomain-oim-server2 0/1 Running 0 7s
governancedomain-soa-server1 1/1 Running 0 23h
One new pod (governancedomain-oim-server2
) is started, but currently has a READY
status of 0/1
. This means oim_server2
is not currently running but is in the process of starting. The server will take several minutes to start so keep executing the command until READY
shows 1/1
:
NAME READY STATUS RESTARTS AGE
governancedomain-adminserver 1/1 Running 0 23h
governancedomain-create-fmw-infra-sample-domain-job-8cww8 0/1 Completed 0 24h
governancedomain-oim-server1 1/1 Running 0 23h
governancedomain-oim-server2 1/1 Running 0 5m27s
governancedomain-soa-server1 1/1 Running 0 23h
Note: To check what is happening during server startup when READY
is 0/1
, run the following command to view the log of the pod that is starting:
$ kubectl logs <pod> -n <domain_namespace>
For example:
$ kubectl logs governancedomain-oim-server2 -n oigns
As mentioned in the previous section, the number of OIG Managed Servers running is dependent on the replicas
parameter configured for the cluster. To stop one or more OIG Managed Servers, perform the following:
Run the following kubectl command to edit the domain:
$ kubectl edit domain <domain_uid> -n <domain_namespace>
For example:
$ kubectl edit domain governancedomain -n oigns
In the edit session search for clusterName: oim_cluster
and look for the replicas
parameter. In the example below replicas
is set to “2” hence two OIG Managed Servers are started (oim_server1
and oim_server2
):
- clusterName: oim_cluster
replicas: 2
serverPod:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: weblogic.clusterName
operator: In
values:
- $(CLUSTER_NAME)
To stop OIG Managed Servers, decrease the replicas
value as desired. In the example below, we will stop one Managed Server by setting replicas to “1”:
- clusterName: oim_cluster
replicas: 1
serverPod:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchExpressions:
- key: weblogic.clusterName
operator: In
values:
- $(CLUSTER_NAME)
Save the file and exit (:wq)
Run the following kubectl command to view the pods:
$ kubectl get pods -n <domain_namespace>
For example:
$ kubectl get pods -n oigns
The output will look similar to the following:
NAME READY STATUS RESTARTS AGE
governancedomain-adminserver 1/1 Running 0 23h
governancedomain-create-fmw-infra-sample-domain-job-8cww8 0/1 Completed 0 24h
governancedomain-oim-server1 1/1 Running 0 23h
governancedomain-oim-server2 1/1 Terminating 0 7m30s
governancedomain-soa-server1 1/1 Running 0 23h
The exiting pod shows a STATUS
of Terminating
(governancedomain-oim-server2
). The server may take a minute or two to stop, so keep executing the command until the pod has disappeared:
NAME READY STATUS RESTARTS AGE
governancedomain-adminserver 1/1 Running 0 23h
governancedomain-create-fmw-infra-sample-domain-job-8cww8 0/1 Completed 0 24h
governancedomain-oim-server1 1/1 Running 0 23h
governancedomain-soa-server1 1/1 Running 0 23h
To stop all the OIG Managed Servers and the Administration Server in one operation:
Run the following kubectl command to edit the domain:
$ kubectl edit domain <domain_uid> -n <domain_namespace>
For example:
$ kubectl edit domain governancedomain -n oigns
In the edit session search for serverStartPolicy: IF_NEEDED
:
volumeMounts:
- mountPath: /u01/oracle/user_projects/domains
name: weblogic-domain-storage-volume
volumes:
- name: weblogic-domain-storage-volume
persistentVolumeClaim:
claimName: governancedomain-domain-pvc
serverStartPolicy: IF_NEEDED
Change serverStartPolicy: IF_NEEDED
to NEVER
as follows:
volumeMounts:
- mountPath: /u01/oracle/user_projects/domains
name: weblogic-domain-storage-volume
volumes:
- name: weblogic-domain-storage-volume
persistentVolumeClaim:
claimName: governancedomain-domain-pvc
serverStartPolicy: NEVER
Save the file and exit (:wq).
Run the following kubectl command to view the pods:
$ kubectl get pods -n <domain_namespace>
For example:
$ kubectl get pods -n oigns
The output will look similar to the following:
NAME READY STATUS RESTARTS AGE
governancedomain-adminserver 1/1 Terminating 0 23h
governancedomain-create-fmw-infra-sample-domain-job-8cww8 0/1 Completed 0 24h
governancedomain-oim-server1 1/1 Terminating 0 23h
governancedomain-soa-server1 1/1 Terminating 0 23h
The AdminServer pod and Managed Server pods will move to a STATUS
of Terminating
. After a few minutes, run the command again and the pods should have disappeared:
NAME READY STATUS RESTARTS AGE
governancedomain-create-fmw-infra-sample-domain-job-8cww8 0/1 Completed 0 24h
To start the Administration Server and Managed Servers up again, repeat the previous steps but change serverStartPolicy: NEVER
to IF_NEEDED
as follows:
volumeMounts:
- mountPath: /u01/oracle/user_projects/domains
name: weblogic-domain-storage-volume
volumes:
- name: weblogic-domain-storage-volume
persistentVolumeClaim:
claimName: governancedomain-domain-pvc
serverStartPolicy: IF_NEEDED
Run the following kubectl command to view the pods:
$ kubectl get pods -n <domain_namespace>
For example:
$ kubectl get pods -n oigns
The output will look similar to the following:
NAME READY STATUS RESTARTS AGE
governancedomain-adminserver 0/1 Running 0 4s
governancedomain-create-fmw-infra-sample-domain-job-8cww8 0/1 Completed 0 24h
The Administration Server pod will start followed by the OIG Managed Servers pods. This process will take several minutes, so keep executing the command until all the pods are running with READY
status 1/1
:
NAME READY STATUS RESTARTS AGE
governancedomain-adminserver 1/1 Running 0 6m57s
governancedomain-create-fmw-infra-sample-domain-job-8cww8 0/1 Completed 0 24h
governancedomain-oim-server1 1/1 Running 0 4m33s
governancedomain-soa-server1 1/1 Running 0 4m33s
The WebLogic Kubernetes 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 $WORKDIR/kubernetes/domain-lifecycle
directory. For more information, see the README.