kubernetes- deploy Oracle Database
1, Oracle Database
Oracle Database, also known as Oracle RDBMS, or simply Oracle. Oracle is a relational database management systems. It is has been a leader in the field of database products. Oracle database system can be said is the world's popular relational database management system, a good system portability, ease of use, powerful, applicable to all types of large, medium, small, computer environment. It is a high efficiency, good reliability, high throughput adaptation program database.
2, Oracle deployment
Here is the definition of the code Oracle deployment, this code consists of two parts, namely, Oracle deployment and its proxy service deployment. Here deployed Oracle database. 11 G R2, mirroring the mybook2019 / oracle-ee-11g: v1.0. Pattern of Foreign exposed by NodePort 1521 and 1158 these two ports, and data persistence by nfs file system for Oracle.
# ------------- defined oralce agent services --------------------
apiVersion : v1
kind: Service metadata: name: oralce-svc labels: app: oralce spec: type: NodePort ports: - port: 1521 targetPort: 1521 name: oracle1521 - port: 8080 targetPort: 8080 name: oralce8080 selector: app: oralce --- #-------------定义oralce部署-------------------- apiVersion: apps/v1 kind: Deployment metadata: name: oralce spec: replicas: 1 selector: matchLabels: app: oralce strategy: type: Recreate template: metadata: labels: app: oralce spec: containers: - image: mybook2019/oracle-ee-11g:v1.0 name: oralce - containerPort: 1521 name: oralce1521 - containerPort: 8080 name: oralce8080 volumeMounts: - name: oralce-data mountPath: /u01/app/oracle volumes: - name: oralce-data nfs: path: /home/sharenfs/oracle server: 192.168.8.132
By kubectl, execute the following command to deploy Oracle database Kubernetes cluster.
$ kubectl create -f oracle11g-en.yaml --namespace=kube-public
After the deployment is complete, you can view the oracle port exposed by the following command (port here is 1521 and 32175):
$ kubectl get svc --namespace=kube-public
3, deployment validation
Here, after the deployment of good Oracle.
1) application-related information, in a database connected to the cluster Kubernetes follows:
hostname: oracle-svc.kube-public port: 1521 sid: EE service name: EE.oracle.docker username: system password: oracle
For a client machine where the oracle, the following command to connect to the database.
$ sqlplus system/oracle@//oracle-svc.kube-public:1521/EE.oracle.docker
2) Application Kubernetes outside the cluster, the connection information database used were as follows:
hostname: 10.0.32.165 port: 32175 sid: EE service name: EE.oracle.docker username: system password: oracle
For a client machine where the oracle, the following command to connect to the database.
$ sqlplus system/oracle@//10.0.32.165
:32175
/EE.oracle.docker