Preparations
Service Mesh decouples the software development kit (SDK) and runs it in a separate process. This allows your business process to focus on business logic. Service communication and administration components are organized into a mesh of sidecars to provide unified administration for heterogeneous networks. To use Service Mesh, you must publish a service. Before you publish a service, you must complete the required preparations.
Service Mesh supports SOFA, Dubbo, and Spring Cloud microservices. This topic uses a SOFABoot project as an example to help you get started with Service Mesh. The build, publishing, and management processes differ for each publishing method. The following sections describe the preparations for classic virtual machine publishing and container service publishing.
Demonstration video
Watch the following video to quickly learn how to make the required preparations:
The following table describes the time segments in the video.
Procedure |
Time segment |
1. Install the basic environment |
Start–7:47 |
2. Create a project |
7:48–14:26 |
3. Import SOFA middleware |
14:27–18:24 |
4. Create the deployment package |
18:25–19:24 |
5. Create an image |
19:25–26:19 |
6. Upload the image |
26:19–End |
Classic virtual machine publishing
Classic virtual machine publishing requires you to deploy a JAR package. You can obtain the required JAR package in one of the following two ways:
Download a sample JAR package
Download the web project JAR package.
Download the core project JAR package.
Obtain a JAR package from a local project
Set up the local environment.
For more information, see Set up the environment.
Generate a sample project.
You can generate a demo project in one of the following two ways.
Create a project
You can use Maven commands to create a web project and a core project. For more information, see Create a project.
Download a sample project
You can download sample projects from the following links:
Download the sample web project.
Download the sample core project.
Import SOFA middleware.
For more information, see Import SOFA middleware.
Open the command line and navigate to the project's root directory.
For example, if the project root directory is
D:\SOFABoot\web-app, run the following command:Run the following command to package the project.
mvn clean packageYou can find the packaged project JAR file in the
targetfolder of the root directory.
Container service publishing
Container service publishing requires you to deploy an image. You can prepare the required image in one of the following two ways:
Download a sample image
Ant Financial Technology provides a series of sample images. You can select an image based on the region where your application service is located. For a list of images, see Sample image list.
Use a local image
Alternatively, you can build a custom image locally and upload it to an Alibaba Cloud ACR image repository. The procedure is as follows:
Create a local project.
For more information, see Create a project.
Create a custom image.
Install Docker.
The Docker version must be 1.6.0 or later. For installation steps, see the official Docker installation guide.
Create the image.
For more information, see Create a Docker image for a SOFABoot application.
Upload the image.
Upload the image to a Finance region (Gold Zone)
For more information, see Upload an image to a Gold Zone.
Upload the image to a non-Finance region
For more information, see Image repository.
For more information about Finance (Gold) and non-Finance regions, see Finance regions (Gold Zones).
You can obtain the image.
Log on to the SOFAStack console.
Choose Operations Management > Container Application Service > Image Center > Image Repository.
Click the name of the image repository that you created when you uploaded the image.
On the Image Repository Details page, click the copy icon
next to the image version to copy the registry address. The registry address consists of the repository address and the version. The following is an example:registry-vpc.cn-hangzhou-finance.aliyuncs.com/sofaboot-public/h****oot:1.0.0