Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Deployment method of weblogic

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "the deployment method of weblogic". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The first is the Docker deployment of Weblogic.

Please read carefully: https://my.oschina.net/u/3867634/blog/2246865

So far, we have built an oracle/weblogic:12.2.1.3-developer image. To facilitate future use, we can build a local private image repository for Harbor and push the secondary image to the repository.

Build Harbor warehouse

See: https://github.com/goharbor/harbor/blob/release-1.6.0/docs/installation_guide.md

Chinese version: https://blog.csdn.net/aixiaoyang168/article/details/73549898

After the construction is completed, you need to modify the insecure-registry in the kubernetes node:

/ / Edit configuration docker-option configuration file vi / etc/systemd/system/docker.service.d/docker-options.conf// add-- insecure-registry=172.17.20.25 [Service] Environment= "DOCKER_OPTS=--insecure-registry=10.233.0.0/18-- insecure-registry=172.17.20.25-- graph=/var/lib/docker-- log-opt max-size=50m-- log-opt max-file=5\-- iptables=false" / / restart dockersystemctl daemon-reloadsystemctl restart docker in the file

Then, push the constructed image to the repository:

/ / tag image from docker tag oracle/weblogic:12.1.3-developer 172.17.20.25/oracle/weblogic:12.1.3-developer//push to 172.17.20.25docker push 172.17.20.25/oracle/weblogic:12.1.3-developer

You can now log in to http://172.17.20.25 to view the image

Pull the image:

Deploy Weblogic in docker pull 172.17.20.25/oracle/weblogic:12.2.1.3-developerkubernetes cluster

Pull the docker-images code:

$git clone https://github.com/oracle/docker-images.git// enters the wls-k8s-domain directory [root@localhost ~] # cd docker-images/OracleWebLogic/samples/wls-k8s-domain/ [root@localhost wls-k8s-domain] # lsbuild.sh container-scripts Dockerfile k8s README.md

Build a wls-k8s-domain image:

$docker build-t wls-k8s-domain.

Make the image tag 172.17.20.25/oracle/wls-k8s-domain:1.0 and then push it to Harbor to facilitate the pull of K8s nodes.

Then modify the k8s/wls-admin.yml to look like this:

ApiVersion: apps/v1beta1kind: Deploymentmetadata: name: admin-serverspec: selector: matchLabels: app: admin-server replicas: 1 template: metadata: labels: app: admin-serverspec: podAntiAffinity: requiredDuringSchedulingIgnoredDuringExecution:-labelSelector: matchExpressions:-key: app operator: In values: -admin-server topologyKey: "kubernetes.io/hostname" containers:-name: admin-server#image is modified to the name on harbor image: 172.17.20.25/oracle/wls-k8s-domain:1.0 imagePullPolicy: IfNotPresent command: ["sh"] args: ["/ u01/oracle/startadmin.sh"] readinessProbe: httpGet : path: / weblogic/ready port: 8001 initialDelaySeconds: 15 timeoutSeconds: 5 ports:-containerPort: 8001 env:-name: WLUSER valueFrom: secretKeyRef: name: wlsecret key: username-name: WLPASSWORD valueFrom: secretKeyRef : name: wlsecret key: password volumeMounts:-mountPath: / u01/wlsdomain name: domain-home volumes:-name: domain-home persistentVolumeClaim: claimName: wlserver-pvc-1---apiVersion: v1kind: Servicemetadata: name: admin-server labels: app: admin-serverspec: type: NodePort selector: app: admin-server ports:-name : client protocol: TCP port: 8001 targetPort: 8001 nodePort: 30007 selector: app: admin-server

Modify the k8s/wls-stateful.yml to:

ApiVersion: apps/v1beta1 # for versions before 1.6.0 use extensions/v1beta1kind: StatefulSetmetadata: name: managed-serverspec: serviceName: wls-subdomain selector: matchLabels: app: managed-server replicas: 2 template: metadata: name: ms labels: app: managed-serverspec: # deploy managed-server and admin-server on the same node affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution:- LabelSelector: matchExpressions:-key: app operator: In values:-admin-server topologyKey: "kubernetes.io/hostname" subdomain: wls-subdomain containers:-name: managed-server image: 172.17.20.25/oracle/wls-k8s-domain:1.0 imagePullPolicy: IfNotPresent Command: ["sh"] args: ["/ u01/oracle/startms.sh"] readinessProbe: httpGet: path: / weblogic/ready port: 8011 initialDelaySeconds: 15 timeoutSeconds: 5 ports:-containerPort: 8011 env:-name: JAVA_OPTIONS value: "- Dweblogic .StdoutDebugEnabled = true "- name: USER_MEM_ARGS value:"-Xms64m-Xmx256m "- name: MY_POD_IP valueFrom: fieldRef: fieldPath: status.podIP-name: MY_POD_NAME valueFrom: fieldRef: fieldPath: metadata.name-name: DNS_DOMAIN_NAME Value: "wls-subdomain"-name: WLUSER valueFrom: secretKeyRef: name: wlsecret key: username-name: WLPASSWORD valueFrom: secretKeyRef: name: wlsecret key: password volumeMounts:-mountPath: / u01/wlsdomain name: domain-home -mountPath: / u01/filestores name: filestore-data volumes:-name: domain-home persistentVolumeClaim: claimName: wlserver-pvc-1-name: filestore-data persistentVolumeClaim: claimName: wlserver-pvc-2---apiVersion: v1 # headless service required for statefulSetkind: Servicemetadata: name: wls-subdomain labels: app: managed-serverspec: ports:-name: client port: 8011 protocol: TCP TargetPort: 8011 clusterIP: None selector: app: managed-server---apiVersion: v1kind: Servicemetadata: name: wls-service labels: app: managed-serverspec: type: NodePort ports:-name: client port: 8011 protocol: TCP targetPort: 8011 nodePort: 30009 selector: app: managed-server

Modify k8s/pv.yml

Kind: PersistentVolumeapiVersion: v1metadata: name: pv1 labels: app: wls-domainspec: storageClassName: manual capacity: storage: 10Gi accessModes:-ReadWriteMany persistentVolumeReclaimPolicy: Recycle # Retain, Recycle Delete hostPath:#path fill in the local directory path: "/ home/oracle/pv/pv1" # nfs: # server: # path:-- kind: PersistentVolumeapiVersion: v1metadata: name: pv2 labels: app: wls-domainspec: storageClassName: manual capacity: storage: 10Gi accessModes:-ReadWriteMany persistentVolumeReclaimPolicy: Recycle # Retain, Recycle Delete hostPath: path: "/ home/oracle/pv/pv2" # nfs: # server: # path:-- kind: PersistentVolumeapiVersion: v1metadata: name: pv3 labels: app: wls-domainspec: storageClassName: manual capacity: storage: 10Gi accessModes:-ReadWriteOnce persistentVolumeReclaimPolicy: Recycle # Retain, Recycle, Delete hostPath: path: "/ home/oracle/pv/pv3" # nfs: # server: # path:

The directory filled in under NOTE:hostPath requires 777 permissions.

IMPORTANT: before executing the creation script, you must make sure that there is a user with a UID and GID of 1000 GID 1000.

Then, execute the following command in turn:

$kubectl create-f k8sswap secrets.yml $kubectl create-f k8sUnip pv.yml$ kubectl create-f k8sUniverspvc.yml$ kubectl create-f k8sUniverse wlslicadmin.yml$ kubectl create-f k8s/wls-stateful.yml

At this point, a domain with two managed-server is created.

$kubectl get allNAME READY STATUS RESTARTS AGEpo/admin-server-1238998015-f932w 1 Running 0 11mpo/managed-server-0 1 + 1 Running 0 11mpo/managed-server-1 1 + + 1 Running 0 8mNAME CLUSTER-IP EXTERNAL-IP PORT (S) AGEsvc/admin-server 10.102.160.123 8001:30007/TCP 11msvc/kubernetes 10.96.0.1 443/TCP 39dsvc/wls-service 10.96.37.152 8011:30009/TCP 11msvc/wls-subdomain None 8011/TCP 11mNAME DESIRED CURRENT AGEstatefulsets/managed-server 2 2 11mNAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGEdeploy/admin-server 11 11 11mNAME DESIRED CURRENT READY AGErs/admin-server-1238998015 11 1 11m

You can now log in to the http:IP:30007/console access console with the default account number: weblogic and password: weblogic1.

The application access port deployed in weblogic is 30009.

Improve

We can make chart to install with one click. The steps are as follows:

1. Create a charts named hello-world

Helm create weblogic

two。 Put the k8s/ directory under the weblogic/templates directory

Note: the helloworld program is simple, and the program does not need to introduce related dependencies or pass in parameters. Charts provides version control, introducing dependencies, passing parameters and other configuration files.

3. Package tar

Helm package weblogic

4. Create a charts folder locally and move the packaged tar file into it to generate index.yaml

Mv weblogic-0.1.0.tgz charts/

Helm serve-- repo-path. / charts

5. Install chart

Helm install weblogic

This is the end of the content of "weblogic deployment method". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report