天天看點

SAP Commerce Cloud 概述

原文标題:Getting Started with SAP Commerce Cloud

英文版位址:

https://www.sap.com/cxworks/article/433893880/getting_started_with_sap_commerce_cloud

Before we begin, it is important to differentiate between the SAP Commerce Cloud in the Public Cloud, released on the 4th of June 2018, and the previous version of SAP Commerce Cloud, which we will refer to in this document as “SAP Commerce Cloud on SAP Infrastructure”.

SAP 于 2018 年 6 月 4 日 釋出了 SAP Commerce Cloud 部署在 Public Cloud(公有雲)上的版本,差別于之前部署在 SAP infrastructure 上的 Commerce Cloud 版本。

With SAP Commerce Cloud on SAP Infrastructure, it is your responsibility to build packages for deployment (following the latest Deployment Package Guidelines). Deployments and maintenance of the environments are then managed by SAP Cloud Services.

部署在 SAP infrastructure 上的 Commerce Cloud,客戶需要自行建構用來部署的包。環境部署和維護,由 SAP Cloud Services 完成。

Additionally, a VPN tunnel is required to reach backoffice nodes.

需要使用 VPN tunnel 通路 Backoffice 節點。

SAP Commerce Cloud 概述

With the SAP Commerce Cloud in the Public Cloud, the process to provision environments, build the code, and deploy to public cloud infrastructure is self-managed through the SAP Commerce Cloud Portal.

使用公有雲部署的 SAP Commerce Cloud 之後,provision 環境,建構代碼,部署到公有雲的流程均通過 SAP Cloud portal 完成。

SAP Commerce Cloud 概述

Commerce Cloud 建構

The SAP Commerce Cloud build process uses the standard commerce build process.

SAP Commerce Cloud 使用 Commerce 标準建構過程。

However, if the build process is customized (for example, using build callbacks), there is a possibility that these customizations will be incompatible with the SAP Commerce Cloud build process.

如果建構過程被定制化,比如加入了 build callback,則有可能這些定制化同 SAP Commerce Cloud build 流程不相容。

A larger degree of customization will increase the risk of build incompatibilities. Therefore any customizations, like the build callback logic, should be kept to a minimum and should be thoroughly tested on SAP Commerce Cloud.

是以盡量避免使用這些定制化 build 流程。

SAP Commerce Cloud relies on the Manifest.json file to configure the build.

SAP Commerce Cloud 使用 manifest.json 來配置 build 過程。

It does not support alternative recipes or custom recipes like those found for on-premise installations of SAP Commerce Cloud.

SAP Commerce Cloud 不支援 類似 On-Premises 平台那種自定義 recipes.

Users of recipes will need to adapt their recipe to the Manifest file (see the Code Repository section below).

You may wish to set up your manifest.json file for Configuration Reuse in order to make Developing Locally simpler.

Additionally, the SAP Commerce Cloud build process cannot be customized beyond the configuration options available in the Manifest.json file, as well as the configuration and customization options that the standard commerce build process supports.

除了 manifest.json 檔案提供的配置選項以外, SAP Commerce Cloud build 流程不支援其他的定制化。

Failures in the build process are reported in the build log which is available as part of the build details in Cloud Portal.

建構失敗的錯誤會包含在建構日志裡,建構日志也是 Cloud Portal 建構明細的一部分。

SAP Commerce Cloud 建構流程如下:

SAP Commerce Cloud 概述

Aspect Configuration

The SAP Commerce Cloud build process picks up the code designated through the Commerce Cloud Portal build options as well as all the required extensions to build the Docker images.

SAP Commerce Cloud 建構流程通過選取基于 Commerce Cloud Portal build option 指派的代碼,以及必需的 extension 來建構 Docker 鏡像。

These are then used to create the environments as per the Aspect Configuration of the Manifest.json file.

這些資源随後按照 manifest.json 裡包含的 aspect 配置資訊,建立 Commerce 環境。

You can think of an aspect as a role that a node is set up to perform.

可以将 aspect 看成一個 node setup 之後扮演的一個角色。

A fixed platform cluster layout is used. This means that the same base SAP Commerce Docker image is used with different aspects, enabling individual scaling per group of nodes, and separation of concerns.

一個固定的平台叢集布局被使用,這意味着同樣的基礎 SAP Commerce Docker 鏡像被使用,伴随以不同的 aspect,能允許節點組進行 scaling 操作和關注點分離。

The aspect types are fixed but they can be configured using the aspects section of the manifest file.

Aspect 類型本身是固定的,但能夠在 manifest.json 的 aspects 區域進行配置。

The following table demonstrates how functionalities and modules could be distributed across the cluster:

下面的表格,展示了功能和 module 如何通過配置,到達跨 cluster 分發的效果:

SAP Commerce Cloud 概述

Each subscription of SAP Commerce Cloud has its environments provisioned with its own Kubernetes cluster that orchestrates computing, networking, and other infrastructure aspects on behalf of user workloads.

每個 SAP Commerce Cloud subscription 都有自己的 environment,通過自己專屬的 Kubernetes 叢集供應,提供計算,網絡和其他基礎設施。

A key aspect of SAP Commerce Cloud is that SAP Commerce Cloud instances are always deployed with a consistent and fixed resource (cores and memory) footprint for each node of a particular aspect in each environment.

SAP Commerce Cloud 一大特點就是,對于每個環境的 aspect,其執行個體總是基于統一而固定的資源進行部署,比如固定的 CPU 核心和記憶體。

All server clusters and their allocated resources (CPU/RAM) in all environments are managed exclusively by SAP.

所有伺服器叢集和其配置設定的資源,比如 CPU/RAM,都由 SAP 統一管理。

Because resources are fixed, it also means only horizontal scaling (increasing the number of instances) is supported.

因為采取了固定資源的配置設定政策,這意味着 SAP Commerce Cloud 隻支援水準擴充,即增加執行個體個數的方式。

Vertical scaling (increasing the resources on an existing virtual machine) is not supported.

SAP Commerce Cloud 垂直擴充不支援。

The below sample configuration for go-live shows three primary nodes and at least three nodes.

下圖展示了 SAP Commerce Cloud 一個例子部署選項,至少包含三個主要節點。

SAP Commerce Cloud 概述

Each node (described in the Nodes section below) is configured with Docker and Kubelet to allow deploying the Docker images created by the SAP Commerce Cloud build process.

每個節點都配置了 Docker 和 Kubelet 軟體,允許經過 SAP Commerce Cloud build 流程建立的 Docker 鏡像,部署到節點上。

nodes

A node is a worker machine in Kubernetes, previously known as a minion.

node 是 Kubernetes 世界裡的工作機,以前被稱為 minion.

A node may be a virtual machine (VM) or a physical machine, depending on the cluster.

節點既可以是實體機,也可以是虛拟機。

Each node has the services necessary to run pods, and is managed by the primary components.

每個節點上都有需要運作 pods 所必需的服務,節點被 primary 元件管理。

容器

Containers

A container is a runtime instance of an image (what the image becomes in memory when actually executed).

容器是鏡像的運作時執行個體,當鏡像被執行時,首先被加載到記憶體裡。

Containers run apps natively on the host machine’s kernel.

容器在主控端的核心裡以原生發生運作應用。

They have better performance characteristics than virtual machines that only get virtual access to host resources through a hypervisor.

這種方式比起傳統的虛拟機采取 hypervisor 的方式獲得對主控端資源的通路相比,性能大大提高。

Environments

There are three main environment types that can be provisioned within the SAP Commerce Cloud Portal: Development, Stage and Production.

SAP Commerce Cloud Portal 能夠供應的三大環境:Development, Stage and Production.

開發環境的配置

最少包含:

Kubernetes cluster of one primary E2 and two workers F8 VMs

One S2 (Standard 2) database

SAP Commerce Cloud 概述

Stage Environment

At a minimum:

Kubernetes cluster of three primary F8 and two workers F16 VMs.

One S4 (Standard 4) database. Does not support asynchronous replication.

SAP Commerce Cloud 概述

生産環境的配置

Kubernetes cluster of three primary F8 and four workers F16 VMs.

One P2 (Premium 2) database; provides better reliability than other tiers, and the possibility of asynchronous replication to other data centers with the same code base.

SAP Commerce Cloud 概述

Ephemeral Disk Storage - 非持久化磁盤存儲

With SAP Commerce Cloud, the application servers provisioned do not have persistent hard drives attached.

在 SAP Commerce Cloud 裡,應用伺服器沒有挂接提供持久化存儲的磁盤。

Therefore, applications should not rely on files written to disk to be available long term (disk storage is ephemeral and will therefore disappear when Kubernetes replaces the Commerce node).

是以,應用程式不能指望着寫入磁盤的檔案具有長期的持久化生命周期,因為磁盤存儲在 Kubernetes 替換 Commerce 節點時,會被銷毀。

Cloud storage should be used for files that are required to exist beyond the lifetime of a SAP Commerce application instance.

如果确實存在需要檔案存活生命周期超過 Commerce 應用執行個體生命周期的應用場景,必須使用 Cloud 存儲。

SAP Commerce Cloud provides the Cloud Hot Folders feature , which is used for importing files from the Azure Blob Store.

SAP Commerce Cloud 提供 Cloud hot 檔案夾特性,用于從 Azure Blob Store 中導入檔案。

Relational Database

SAP Commerce Cloud uses the Azure SQL Database.

Any instances where projects are writing direct SQL queries should be reviewed and tested to ensure consistency with this standard.

SAP Commerce Cloud 使用 Azure SQL 資料庫,盡量避免直接的 SQL query.

There may be times where you wish to save the state of your database in case you want to roll back to it in the future. The Snapshot and Restore feature allows you to do this and we recommend to periodically save a snapshot of your database.

可以儲存資料庫的狀态,以備将來復原之用。

Web Tier

SAP Commerce Cloud uses Apache Web Server to serve web traffic and provides a standard configuration optimized for running a SAP Commerce Cloud storefront.

SAP Commerce Cloud 使用 Apache Web 伺服器來 serve 網絡請求,運作 Storefront.

Access to web servers is not permitted but the following configuration options are available in the SAP Commerce Cloud Portal for the Web Tier:

無法直接通路 web 伺服器,但可以通過 Cloud Portal 進行下列配置。

Endpoints (virtual hosts) can be mapped onto applications running on SAP Commerce Cloud.

可以将 endpoints,即虛拟主機嗎,映射到應用上。

They are automatically allocated a DNS name. 這些 endpoints 自動被配置設定一個 DNS name.

SSL Certificates can be assigned to an endpoint.

IP Filters can be defined for an endpoint, ensuring that only traffic from certain IP addresses can access an endpoint.

可以通過 IP filters,實作隻有來自指定的 IP 位址,才能通路 endpoint 的需求。