在Google Cloud platform上的Kubernetes集群部署HANA Express

简介:

在Google Cloud platform的Kubernetes cluster上,新建一个hxe.yaml文件:

将如下内容拷贝进yaml文件:

kind: ConfigMap
apiVersion: v1
metadata:
  creationTimestamp: 2018-01-18T19:14:38Z
  name: hxe-pass
data:
  password.json: |+
    {"master_password" : "HXEHana1"}
---
kind: PersistentVolume
apiVersion: v1
metadata:
  name: persistent-vol-hxe
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 150Gi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/data/hxe_pv"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: hxe-pvc
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 50Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hxe
  labels:
    name: hxe
spec:
  selector:
    matchLabels:
      run: hxe
      app: hxe
      role: master
      tier: backend
  replicas: 1
  template:
    metadata:
      labels:
        run: hxe
        app: hxe
        role: master
        tier: backend
    spec:
      initContainers:
        - name: install
          image: busybox
          command: [ 'sh', '-c', 'chown 12000:79 /hana/mounts' ]
          volumeMounts:
            - name: hxe-data
              mountPath: /hana/mounts
      volumes:
        - name: hxe-data
          persistentVolumeClaim:
             claimName: hxe-pvc
        - name: hxe-config
          configMap:
             name: hxe-pass
      imagePullSecrets:
      - name: docker-secret
      containers:
      - name: hxe-container
        image: "store/saplabs/hanaexpress:2.00.033.00.20180925.2"
        ports:
          - containerPort: 39013
            name: port1
          - containerPort: 39015
            name: port2
          - containerPort: 39017
            name: port3
          - containerPort: 8090
            name: port4
          - containerPort: 39041
            name: port5
          - containerPort: 59013
            name: port6
        args: [ "--agree-to-sap-license", "--dont-check-system", "--passwords-url", "file:///hana/hxeconfig/password.json" ]
        volumeMounts:
          - name: hxe-data
            mountPath: /hana/mounts
          - name: hxe-config
            mountPath: /hana/hxeconfig
      - name: sqlpad-container
        image: "sqlpad/sqlpad"
        ports:
        - containerPort: 3000

---
apiVersion: v1
kind: Service
metadata:
  name: hxe-connect
  labels:
    app: hxe
spec:
  type: LoadBalancer
  ports:
  - port: 39013
    targetPort: 39013
    name: port1
  - port: 39015
    targetPort: 39015
    name: port2
  - port: 39017
    targetPort: 39017
    name: port3
  - port: 39041
    targetPort: 39041
    name: port5
  selector:
    app: hxe
---
apiVersion: v1
kind: Service
metadata:
  name: sqlpad
  labels:
    app: hxe
spec:
  type: LoadBalancer
  ports:
  - port: 3000
    targetPort: 3000
    protocol: TCP
    name: sqlpad
  selector:
    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

本文来自云栖社区合作伙伴“汪子熙”,了解相关信息可以关注微信公众号"汪子熙"。

相关实践学习
容器服务Serverless版ACK Serverless 快速入门:在线魔方应用部署和监控
通过本实验,您将了解到容器服务Serverless版ACK Serverless 的基本产品能力,即可以实现快速部署一个在线魔方应用,并借助阿里云容器服务成熟的产品生态,实现在线应用的企业级监控,提升应用稳定性。
云原生实践公开课
课程大纲 开篇:如何学习并实践云原生技术 基础篇: 5 步上手 Kubernetes 进阶篇:生产环境下的 K8s 实践 相关的阿里云产品:容器服务&nbsp;ACK 容器服务&nbsp;Kubernetes&nbsp;版(简称&nbsp;ACK)提供高性能可伸缩的容器应用管理能力,支持企业级容器化应用的全生命周期管理。整合阿里云虚拟化、存储、网络和安全能力,打造云端最佳容器化应用运行环境。 了解产品详情:&nbsp;https://www.aliyun.com/product/kubernetes
相关文章
|
3月前
|
存储 人工智能 大数据
云计算平台:AWS、Azure和Google Cloud的比较与选择
在当今数字化时代,云计算平台成为了企业和个人的首选。本文将重点比较三大主流云计算平台:AWS、Azure和Google Cloud,从性能、功能、可用性以及定价等方面进行综合评估,帮助读者更好地选择适合自己需求的云计算平台。
|
3月前
|
机器学习/深度学习 存储 人工智能
云计算平台选择之路:AWS、Azure和Google Cloud的比较与抉择
在当今数字化时代,云计算平台扮演着企业转型和创新的关键角色。本文将对三大主流云计算平台——AWS、Azure和Google Cloud进行比较分析,为读者提供选择指南。我们将从性能、可靠性、生态系统、服务和定价等方面综合评估,以帮助读者做出最适合他们业务需求的决策。
94 0
|
7月前
|
Kubernetes 容器
在Cloud Toolkit中,如果你无法选择Kubernetes的配置文件,
在Cloud Toolkit中,如果你无法选择Kubernetes的配置文件,
66 1
|
6月前
|
Kubernetes Linux Docker
Kubernetes v1.22.1部署报错3:.com/google_containers/coredns:v1.8.4...
Kubernetes v1.22.1部署报错3:.com/google_containers/coredns:v1.8.4...
111 0
|
20天前
|
安全 编译器 C语言
MISRA C++ 、Google C++ 、AUTOSAR Adaptive Platform编码 C++ 规范总结
MISRA C++ 、Google C++ 、AUTOSAR Adaptive Platform编码 C++ 规范总结
85 1
|
2月前
|
API Go 网络架构
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
GEE Colab——如何从本地/Google云盘/Google Cloud Storage (GCS)上传和下载
72 4
|
3月前
|
存储 机器学习/深度学习 人工智能
云计算巨头之争:AWS、Azure和Google Cloud的综合对比与选择指南
本文详细比较了三大云计算平台AWS、Azure和Google Cloud在性能、可靠性、服务覆盖范围、定价策略以及生态系统等方面的优势和劣势。通过对这些关键因素的分析,读者将能够更好地理解各个平台的特点,并为自己的业务选择最合适的云计算平台。
100 0
|
3月前
|
人工智能 大数据 数据处理
云计算巨头大比拼:AWS、Azure和Google Cloud的终极对决
在云计算领域,AWS、Azure和Google Cloud三家巨头一直在竞相争夺市场份额。本文将从性能、可靠性、定价策略以及生态系统等方面对它们进行全面比较,帮助读者做出明智的选择。
|
4月前
|
Kubernetes 调度 容器
ACK(Alibaba Cloud Kubernetes Engine
ACK(Alibaba Cloud Kubernetes Engine)是阿里巴巴云推出的一款基于Kubernetes的容器编排平台。在ACK中,Capacity Scheduling是一种调度策略,用于在集群中分配资源,以确保高可用性和资源利用率。
50 2
|
4月前
|
开发工具
阿里云的镜像服务(mirrors.aliyun.com)可以同步 Google Cloud SDK 的软件包
阿里云的镜像服务(mirrors.aliyun.com)可以同步 Google Cloud SDK 的软件包
181 3