{"id":205516,"date":"2020-11-27T10:40:41","date_gmt":"2020-11-27T02:40:41","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=205516"},"modified":"2020-11-16T10:41:31","modified_gmt":"2020-11-16T02:41:31","slug":"kubernetes-oracle","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/kubernetes-oracle.html","title":{"rendered":"kubernetes-\u90e8\u7f72Oracle\u6570\u636e\u5e93\u6b65\u9aa4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nOracle Database\uff0c\u53c8\u540dOracle RDBMS\uff0c\u6216\u7b80\u79f0Oracle\u3002\u662f\u7532\u9aa8\u6587\u516c\u53f8\u7684\u4e00\u6b3e\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u3002\u5b83\u662f\u5728\u6570\u636e\u5e93\u9886\u57df\u4e00\u76f4\u5904\u4e8e\u9886\u5148\u5730\u4f4d\u7684\u4ea7\u54c1\u3002\u53ef\u4ee5\u8bf4Oracle\u6570\u636e\u5e93\u7cfb\u7edf\u662f\u76ee\u524d\u4e16\u754c\u4e0a\u6d41\u884c\u7684\u5173\u7cfb\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\uff0c\u7cfb\u7edf\u53ef\u79fb\u690d\u6027\u597d\u3001\u4f7f\u7528\u65b9\u4fbf\u3001\u529f\u80fd\u5f3a\uff0c\u9002\u7528\u4e8e\u5404\u7c7b\u5927\u3001\u4e2d\u3001\u5c0f\u3001\u5fae\u673a\u73af\u5883\u3002\u5b83\u662f\u4e00\u79cd\u9ad8\u6548\u7387\u3001\u53ef\u9760\u6027\u597d\u7684\u3001\u9002\u5e94\u9ad8\u541e\u5410\u91cf\u7684\u6570\u636e\u5e93\u65b9\u6848\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
Oracle\u90e8\u7f72<\/strong><\/span><\/div>\n

\u4e0b\u9762\u662fOracle\u90e8\u7f72\u7684\u5b9a\u4e49\u4ee3\u7801\uff0c\u6b64\u4ee3\u7801\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff0c\u5373Oracle\u90e8\u7f72\u7684\u90e8\u7f72\u4ee5\u53ca\u5176\u4ee3\u7406\u670d\u52a1\u3002\u6b64\u5904\u90e8\u7f72\u7684Oracle\u6570\u636e\u5e93\u4e3a11g r2\uff0c\u955c\u50cf\u4f7f\u7528\u7684\u662fmybook2019\/oracle-ee-11g:v1.0\u3002\u901a\u8fc7NodePort\u6a21\u5f0f\u5bf9\u5916\u66b4\u9732\u4e861521\u548c1158\u8fd9\u4e24\u4e2a\u7aef\u53e3\uff0c\u5e76\u901a\u8fc7nfs\u6587\u4ef6\u7cfb\u7edf\u5bf9Oracle\u7684\u6570\u636e\u8fdb\u884c\u6301\u4e45\u5316\u3002<\/p>\n

\r\n#-------------\u5b9a\u4e49oralce\u4ee3\u7406\u670d\u52a1--------------------\r\napiVersion: v1\r\nkind: Service\r\nmetadata:\r\n  name: oralce-svc\r\n  labels:\r\n    app: oralce\r\nspec:\r\n  type: NodePort\r\n  ports:\r\n  - port: 1521\r\n    targetPort: 1521\r\n    name: oracle1521\r\n  - port: 8080\r\n    targetPort: 8080\r\n    name: oralce8080\r\n  selector:\r\n    app: oralce\r\n---\r\n\r\n#-------------\u5b9a\u4e49oralce\u90e8\u7f72--------------------\r\napiVersion: apps\/v1\r\nkind: Deployment\r\nmetadata:\r\n  name: oralce\r\nspec:\r\n  replicas: 1\r\n  selector:\r\n    matchLabels:\r\n      app: oralce\r\n  strategy:\r\n    type: Recreate\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: oralce\r\n    spec:\r\n      containers:\r\n      - image: mybook2019\/oracle-ee-11g:v1.0\r\n        name: oralce\r\n        - containerPort: 1521\r\n          name: oralce1521\r\n        - containerPort: 8080\r\n          name: oralce8080\r\n        volumeMounts:\r\n        - name: oralce-data\r\n          mountPath: \/u01\/app\/oracle\r\n      volumes:\r\n      - name: oralce-data\r\n        nfs:\r\n          path: \/home\/sharenfs\/oracle\r\n          server: 192.168.8.132\r\n<\/pre>\n

\u901a\u8fc7kubectl\uff0c\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u5728Kubernetes\u96c6\u7fa4\u4e2d\u90e8\u7f72Oracle\u6570\u636e\u5e93\u3002<\/p>\n

\r\n$ kubectl create -f oracle11g-en.yaml --namespace=kube-public\r\n<\/pre>\n

\u5728\u90e8\u7f72\u5b8c\u6210\u540e\uff0c\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u53ef\u4ee5\u67e5\u770boracle\u66b4\u9732\u7684\u7aef\u53e3\uff08\u6b64\u5904\u7684\u7aef\u53e3\u4e3a1521\u548c32175\uff09\uff1a<\/p>\n

\r\n$ kubectl get svc --namespace=kube-public\r\n<\/pre>\n

\"\"<\/p>\n

\u90e8\u7f72\u9a8c\u8bc1<\/strong><\/span><\/div>\n

1\uff09\u5728Kubernetes\u96c6\u7fa4\u5185\u7684\u5e94\u7528\uff0c\u8fde\u63a5\u6570\u636e\u5e93\u7684\u76f8\u5173\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n

\r\nhostname: oracle-svc.kube-public\r\nport: 1521\r\nsid: EE\r\nservice name: EE.oracle.docker\r\nusername: system\r\npassword: oracle\r\n<\/pre>\n

\u5bf9\u4e8e\u5728oracle\u5ba2\u6237\u7aef\u6240\u5728\u673a\u5668\u4e0a\uff0c\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002<\/p>\n

\r\n$ sqlplus system\/oracle@\/\/oracle-svc.kube-public:1521\/EE.oracle.docker\r\n<\/pre>\n

2\uff09\u5728Kubernetes\u96c6\u7fa4\u5916\u7684\u5e94\u7528\uff0c\u8fde\u63a5\u6570\u636e\u5e93\u7684\u6240\u4f7f\u7528\u7684\u76f8\u5173\u4fe1\u606f\u5982\u4e0b\uff1a<\/p>\n

\r\nhostname: 10.0.32.165\r\nport: 32175\r\nsid: EE\r\nservice name: EE.oracle.docker\r\nusername: system\r\npassword: oracle\r\n<\/pre>\n

\u5bf9\u4e8e\u5728oracle\u5ba2\u6237\u7aef\u6240\u5728\u673a\u5668\u4e0a\uff0c\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u8fde\u63a5\u5230\u6570\u636e\u5e93\u3002<\/p>\n

\r\n$ sqlplus system\/oracle@\/\/10.0.32.165:32175\/EE.oracle.docker\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u4e0b\u9762\u662fOracle\u90e8\u7f72\u7684\u5b9a\u4e49\u4ee3\u7801\uff0c\u6b64\u4ee3\u7801\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff0c\u5373Oracle\u90e8\u7f72\u7684\u90e8\u7f72\u4ee5\u53ca\u5176\u4ee3\u7406\u670d\u52a1\u3002\u6b64\u5904\u90e8\u7f72\u7684Ora […]<\/p>\n","protected":false},"author":1479,"featured_media":38731,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-205516","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/205516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1479"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=205516"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/205516\/revisions"}],"predecessor-version":[{"id":205526,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/205516\/revisions\/205526"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/38731"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=205516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=205516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=205516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}