在Google Cloud platform上的Kubernetes集群部署HANA Express
生活随笔
收集整理的這篇文章主要介紹了
在Google Cloud platform上的Kubernetes集群部署HANA Express
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
在Google Cloud platform的Kubernetes cluster上,新建一個hxe.yaml文件:
將如下內容拷貝進yaml文件:
kind: ConfigMap apiVersion: v1 metadata:creationTimestamp: 2018-01-18T19:14:38Zname: hxe-pass data:password.json: |+{"master_password" : "HXEHana1"} --- kind: PersistentVolume apiVersion: v1 metadata:name: persistent-vol-hxelabels:type: local spec:storageClassName: manualcapacity:storage: 150GiaccessModes:- ReadWriteOncehostPath:path: "/data/hxe_pv" --- kind: PersistentVolumeClaim apiVersion: v1 metadata:name: hxe-pvc spec:storageClassName: manualaccessModes:- ReadWriteOnceresources:requests:storage: 50Gi --- apiVersion: apps/v1 kind: Deployment metadata:name: hxelabels:name: hxe spec:selector:matchLabels:run: hxeapp: hxerole: mastertier: backendreplicas: 1template:metadata:labels:run: hxeapp: hxerole: mastertier: backendspec:initContainers:- name: installimage: busyboxcommand: [ 'sh', '-c', 'chown 12000:79 /hana/mounts' ]volumeMounts:- name: hxe-datamountPath: /hana/mountsvolumes:- name: hxe-datapersistentVolumeClaim:claimName: hxe-pvc- name: hxe-configconfigMap:name: hxe-passimagePullSecrets:- name: docker-secretcontainers:- name: hxe-containerimage: "store/saplabs/hanaexpress:2.00.033.00.20180925.2"ports:- containerPort: 39013name: port1- containerPort: 39015name: port2- containerPort: 39017name: port3- containerPort: 8090name: port4- containerPort: 39041name: port5- containerPort: 59013name: port6args: [ "--agree-to-sap-license", "--dont-check-system", "--passwords-url", "file:///hana/hxeconfig/password.json" ]volumeMounts:- name: hxe-datamountPath: /hana/mounts- name: hxe-configmountPath: /hana/hxeconfig- name: sqlpad-containerimage: "sqlpad/sqlpad"ports:- containerPort: 3000--- apiVersion: v1 kind: Service metadata:name: hxe-connectlabels:app: hxe spec:type: LoadBalancerports:- port: 39013targetPort: 39013name: port1- port: 39015targetPort: 39015name: port2- port: 39017targetPort: 39017name: port3- port: 39041targetPort: 39041name: port5selector:app: hxe --- apiVersion: v1 kind: Service metadata:name: sqlpadlabels:app: hxe spec:type: LoadBalancerports:- port: 3000targetPort: 3000protocol: TCPname: sqlpadselector:app: hxe第77行指定了HANA express對應的容器鏡像文件:
“store/saplabs/hanaexpress:2.00.033.00.20180925.2”
使用命令行創建資源:
kubectl create -f hxe.yaml:
創建成功,使用命令行kubectl describe pods查看成功創建的資源:
使用命令行查看數據庫是否成功啟動:
kubectl logs deployment/hxe -c hxe-container
看到startup finished的消息,說明啟動成功:
使用命令行進入pod內部,得到shell:
kubectl exec -it <> bash
打開SQL console:
hdbsql -i 90 -d systemdb -u SYSTEM -p HXEHana1
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
總結
以上是生活随笔為你收集整理的在Google Cloud platform上的Kubernetes集群部署HANA Express的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在Google Cloud platfo
- 下一篇: 一步步学习如何安装并使用SAP HANA