50
ServiceStage FAQs Issue 01 Date 2020-11-30 HUAWEI TECHNOLOGIES CO., LTD.

FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

ServiceStage

FAQs

Issue 01

Date 2020-11-30

HUAWEI TECHNOLOGIES CO., LTD.

Page 2: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Copyright © Huawei Technologies Co., Ltd. 2020. All rights reserved.

No part of this document may be reproduced or transmitted in any form or by any means without priorwritten consent of Huawei Technologies Co., Ltd. Trademarks and Permissions

and other Huawei trademarks are trademarks of Huawei Technologies Co., Ltd.All other trademarks and trade names mentioned in this document are the property of their respectiveholders. NoticeThe purchased products, services and features are stipulated by the contract made between Huawei andthe customer. All or part of the products, services and features described in this document may not bewithin the purchase scope or the usage scope. Unless otherwise specified in the contract, all statements,information, and recommendations in this document are provided "AS IS" without warranties, guaranteesor representations of any kind, either express or implied.

The information in this document is subject to change without notice. Every effort has been made in thepreparation of this document to ensure accuracy of the contents, but all statements, information, andrecommendations in this document do not constitute a warranty of any kind, express or implied.

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. i

Page 3: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Contents

1 SDK FAQs................................................................................................................................... 1

2 Environment Management................................................................................................... 32.1 What Is a Node?...................................................................................................................................................................... 32.2 What Is a Namespace?.......................................................................................................................................................... 32.3 What Is an Environment Variable?................................................................................................................................... 32.4 What Is the Difference Between Open-Source ServiceComb and CSE?...............................................................32.5 What Is the Difference Between the Microservice and the Platform Service?.................................................. 42.6 What Are the Differences Between the CSE Dashboard and Eureka?..................................................................42.7 Can the Microservice Engine Be Billed by Yearly/Monthly?..................................................................................... 42.8 Package Upgrade.....................................................................................................................................................................4

3 Application Management......................................................................................................53.1 How Do I View the Causes for Application Component Deployment Failures?................................................53.2 Failed to Install Agent........................................................................................................................................................... 53.3 Existing Load Balancer Cannot Be Selected During Application Component Deployment...........................63.4 Failed to Create an AS Group During Resource Preparation....................................................................................63.5 During the Resource Preparation Phase, an AS Group Instance Is Not Created Within 5 to 10 Minutes.............................................................................................................................................................................................................. 73.6 Error 504 Returned After Clicking the External Access Address of an Application Component..................73.7 Agent Offline............................................................................................................................................................................ 83.8 Failed to Create a VM Application Instance...................................................................................................................83.9 What Should I Do If an Instance Is Being Created for a Long Time?................................................................... 93.10 Docker Application Dependency................................................................................................................................... 103.11 How Do I Customize the Tomcat Context Path?..................................................................................................... 103.12 Can a Microservice Be Used to Create Multiple Workloads or Release Multiple Image Tags?.............. 103.13 What Are Affinity and Anti-affinity?............................................................................................................................ 113.14 How Do I Use a Fixed Application Component IP? ............................................................................................... 113.15 What Are the Scheduling Policies?............................................................................................................................... 123.16 Does the Governance Center Use Hystrix Capabilities? What Is Enhanced?.................................................12

4 Continuous Delivery............................................................................................................. 134.1 How Does ServiceStage Manage Code on Idea?....................................................................................................... 134.2 How Do I Add the Build Server Address to the GitLab Server Security Group?..............................................134.3 How Do I Add the Build Server Address to the Maven Server Security Group?............................................. 14

ServiceStageFAQs Contents

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. ii

Page 4: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

4.4 Failed to Use ServiceStage for Building........................................................................................................................ 14

5 Software Center.....................................................................................................................185.1 What Shall I Do If a Software Package Fails to Be Uploaded?.............................................................................185.2 What Shall I Do If an Image on the Docker Client Fails to Be Pushed?............................................................195.3 Failed to Download the SWR Software Package....................................................................................................... 20

6 Infrastructure......................................................................................................................... 216.1 How Do I Troubleshoot Insufficient EIPs When a Node Is Added?..................................................................... 216.2 How Do I Bind an Elastic IP Address?............................................................................................................................216.3 How Do I Move a Node from One Cluster to Another?..........................................................................................226.4 Purchased ECS Resources Are Not Displayed.............................................................................................................. 226.5 Does the Unsubscribed Server Affect Running of Existing Programs?...............................................................226.6 Can Basic Resources Be Managed on ServiceStage?................................................................................................ 236.7 Failed to Query the ConfigServer During Git Configuration..................................................................................23

7 Application O&M...................................................................................................................247.1 Why Cannot Logs Be Viewed in ServiceStage?...........................................................................................................247.2 Application Access Mode Becomes Invalid After the Elastic IP Address Is Replaced.................................... 247.3 Memory Usage of a Node Is Too High After a New Service Starts.....................................................................247.4 How Do I Uninstall a Service?.......................................................................................................................................... 257.5 Why Some Types of Logs Can Be Collected but Some Types of Logs Cannot Be Collected When IConfigure Container Logs?....................................................................................................................................................... 25

8 Application Development....................................................................................................268.1 What Is the Difference Between the Microservice and Common Application?.............................................. 268.2 How Do I Handle a Microservice Registry Failure (Java Chassis)?...................................................................... 278.3 How Do I Troubleshoot Microservices Deployed on the Cloud?.......................................................................... 298.4 Shall I Use the SDK or ServiceMesh to Build a Microservice?...............................................................................298.5 Is the Microservice Bound to the Public Cloud? How Do I Perform Local Development?.......................... 308.6 Common Problems About Switching of SpringBoot Applications to CSE Java SDK Framework.............. 308.7 How Do I Handle a Dependency Obtainment Failure?........................................................................................... 318.8 What Database Does the Service Center Use? What Are the Differences Between etcd and Eureka?............................................................................................................................................................................................................ 328.9 What Are the Differences Between the Configuration Center and Spring Cloud Config?.......................... 328.10 Why Do I Use Cloud Service Engine?.......................................................................................................................... 328.11 How Can I Obtain the CSE Service Center Address?.............................................................................................. 338.12 What Is Service Name Duplication Check?............................................................................................................... 348.13 Is a Certificate Verified When a Client Sends HTTPS Messages to CSE? Where Can I Find the RootCertificate?......................................................................................................................................................................................348.14 Why Shall I Define Service Contracts?........................................................................................................................ 34

9 Java SDK FAQs........................................................................................................................359.1 How Do I Extend AK/SK Decryption Methods?.......................................................................................................... 359.2 How Do I Perform Local Development and Test?..................................................................................................... 36

ServiceStageFAQs Contents

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. iii

Page 5: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

9.3 Message "Invalid request, header is invalid, ak sk or project is empty." Is Displayed When the ServiceCenter Is Attempted to Be Connected.................................................................................................................................. 389.4 Message "validate ak sk error" Is Displayed When the Service Center Is Attempted to Be Connected............................................................................................................................................................................................................ 399.5 Message "get project token from iam failed" Is Displayed When the Service Center Is Attempted to BeConnected....................................................................................................................................................................................... 409.6 Message "Version validate failed" Is Displayed When the Service Center Is Attempted to Be Connected............................................................................................................................................................................................................ 409.7 Message "Not enough quota" Is Displayed When the Service Center Is Attempted to Be Connected............................................................................................................................................................................................................ 41

10 Go SDK FAQs........................................................................................................................ 4210.1 Certificate Loading Failed................................................................................................................................................ 4210.2 CSE Connection Times Out............................................................................................................................................. 4210.3 invalid header name..........................................................................................................................................................43

11 Service Mesh.........................................................................................................................4411.1 What Is the Mesher Performance Loss?..................................................................................................................... 44

ServiceStageFAQs Contents

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. iv

Page 6: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

1 SDK FAQs

Key InformationTo facilitate quick fault locating, provide detailed key information when posting anissue in the community. You are advised to provide a demo that can reproduce thefault.

The following uses ServiceComb Java chassis as an example:

1. Framework logs: By default, framework logs are printed with service logs, andthe cse.log file is generated in the root directory. If the log framework such asLog4j2 or Logback is used on the service side, search for the key informationbased on the customized log policy.

a. Key information about service startup:

Table 1-1 Key information about service startup:

Keywords Description

chooseorg.apache.servicecomb

ServiceComb Java chassis supports two types ofREST communication channels. You need todetermine the communication channel to beused based on logs.The chooseorg.apache.servicecomb.transport.rest.vertx.VertxRestTransport framework uses the REST overVertx communication channel by default. That is,Vertx is used as the HTTP server.The chooseorg.apache.servicecomb.transport.rest.servlet.ServletRestTransport framework also supportsthe REST over Servlet communication channel,that is, other HTTP servers, such as Tomcat, areused.

endpoint to publish Microservice release address.

ServiceStageFAQs 1 SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 1

Page 7: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Keywords Description

Registermicroserviceinstance success

Flag indicating a successful service instanceregistration.

b. Key information about service calling:

Table 1-2 Key information about service calling

Keywords Description

find instances Before calling the server (called service), theconsumer (calling service) queries the serverinstance from the service center of themicroservice engine.

accesslog The access.log file records the request sources,such as APIs and status codes for calling theservice. By default, this function is disabled.

The access.log file printing is affected by the communication channeland log framework. If the REST over Vertx communication channel isused, the access.log file is recorded by Vertx. For details, see https://docs.servicecomb.io/java-chassis/en_US/build-provider/access-log-configuration/.The recommended format of the access.log file is as follows:servicecomb.accesslog.pattern: "%h - - %t cs-uri %s %B %D %H %SCB-traceId"

By default, the access.log file is generated in the root directory. If the logframework such as Log4j2 or Logback is used on the service side, you canswitch the log framework by referring to https://docs.servicecomb.io/java-chassis/en_US/build-provider/access-log-configuration/.If the REST over Servlet communication channel is used, the access.logfile is recorded by the HTTP server. To use the access.log file, find therelated reference.For example, you can enable the built-in Tomcat of Spring Boot asfollows:server: tomcat: accesslog: enabled: true pattern: '%h %l %u %t "%r" %s %b %D' directory: accesslogs buffered: false basedir: ./logs

2. Versions of the microservice engine and SDK. You can click the engine nameto view the microservice engine version. For the SDK version, search for thedependency whose groupId is org.apache.serivcecomb.

ServiceStageFAQs 1 SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 2

Page 8: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

2 Environment Management

2.1 What Is a Node?Each node corresponds to one VM. Container applications are running on nodes.The proxy program kubelet running on nodes is used to manage containerinstances running on the nodes.

In minimum, the CPU of a node is one core and the memory is 2048 MB. Inmaximum, the CPU of a node is 32 cores, and the memory is 128 GB.

2.2 What Is a Namespace?Multiple namespaces can exist in a single cluster. Data in a namespace is isolatedfrom data in other namespaces. In this way, namespaces can share services of thesame cluster without impacting each other.

2.3 What Is an Environment Variable?An environment variable is a variable specified in the container runningenvironment. You can define multiple environment variables when creating acontainer template and modify them after deploying an application, whichimproves application flexibility.

2.4 What Is the Difference Between Open-SourceServiceComb and CSE?

CSE Java SDK is the commercial version of ServiceComb. With most of thecomponents inherited from ServiceComb, CSE Java SDK also provides somecommercial features of the public cloud, such as interconnection capability,security, and distributed data consistency. These commercial features are notopen-source, but free of charge.

ServiceStageFAQs 2 Environment Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 3

Page 9: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

2.5 What Is the Difference Between the Microserviceand the Platform Service?

The microservice is an architecture model used to build an application system. Theplatform service is the middleware service provided by the cloud.

To use a platform service, you need to purchase it first. To use a microservice, youneed to develop it first, and release it on the cloud through the service discoverycapability provided by the cloud.

2.6 What Are the Differences Between the CSEDashboard and Eureka?

Eureka does not have a dashboard. The CSE dashboard learns from HystrixDashboard, and adds the display of other data as a decision input for servicegovernance.

2.7 Can the Microservice Engine Be Billed by Yearly/Monthly?

The professional-edition microservice engine is billed pay-per-use and does notsupport billing in yearly/monthly. The exclusive edition is recommended, whichsupports billing in yearly/monthly. The professional edition is shared by all users,and the exclusive edition is exclusive to personal. For details about how to buy anexclusive engine, see Buying an Exclusive Microservice Engine.

2.8 Package Upgrade

SymptomCan I upgrade the basic edition to the professional or platinum edition? If yes, willthe upgrade affect the existing services?

AnswerThe basic edition can be upgraded to the professional or platinum edition, and theupgrade does not affect existing services. However, only the administrator canperform the upgrade, and IAM users do not have the permission.

ServiceStageFAQs 2 Environment Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 4

Page 10: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

3 Application Management

3.1 How Do I View the Causes for ApplicationComponent Deployment Failures?

Symptom

After the application component is deployed, the status is displayed as Not Ready,indicating that the application component fails to be deployed.

Solution

Step 1 Choose Application Management > Application List. On the page that isdisplayed, click an application. The application details page is displayed.

Step 2 On the Component List tab page, click a component. The component details pageis displayed.

Step 3 Select the abnormal component and click View Details. The component detailspage is displayed.

Step 4 On the Instance List page, click next to an instance and click Event.

Step 5 View abnormal events. For example, if the event type is Alarm, you can view thealarm description and determine the causes for application creation failures.

----End

3.2 Failed to Install Agent

Symptom

The system displays message "Note: auth token valid fail:User does not have validroles to write!", indicating that the agent installation fails .

ServiceStageFAQs 3 Application Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 5

Page 11: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Troubleshooting● If the agency mode is used, check whether the IAM agency bound to the ECS

is an delegated op_svc_ecs account or ECS service and whether the TenantAdministrator policy is selected for the current region or sub-project.

● If the AK/SK mode is used, check whether AK/SK in the installation commandis correct and valid.

3.3 Existing Load Balancer Cannot Be Selected DuringApplication Component Deployment

Symptom

An existing load balancer cannot be selected during application componentdeployment.

Solution

Check whether the VPC and subnet where the load balancer is located are thesame as those of the selected ECS. They must be the same and then the existingELB can be selected.

3.4 Failed to Create an AS Group During ResourcePreparation

Symptom

After an application component is created, an AS group fails to be created duringresource preparation. The error code is AS.xxx.

Solution

Locate the fault according to the AS error codes, error information, and error codedescription, and create the application again.

ServiceStageFAQs 3 Application Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 6

Page 12: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

3.5 During the Resource Preparation Phase, an ASGroup Instance Is Not Created Within 5 to 10 Minutes

Symptom

After an application component is created, the system waits for the AS group tocreate an instance for 10 minutes during resource preparation, or the creation failsdue to timeout.

Solution

Back to the ServiceStage console, choose Infrastructure > AS Groups, select anewly created AS group. On the Auto Scaling page, click Scaling Actions, locatethe failure cause, and create the application component again.

3.6 Error 504 Returned After Clicking the ExternalAccess Address of an Application Component

Symptom

Error "504 Gateway Time-out" returned after clicking the external access addressof an application component.

Solution

Check whether the security group of the ECS host where the current applicationcomponent is located enables the TCP IPv4 protocol between 0.0.0.0:30000-32767.

ServiceStageFAQs 3 Application Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 7

Page 13: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

3.7 Agent Offline

SymptomThe installed agent is offline.

Solution● If the agency mode is used, check whether the IAM agency bound to the ECS

is a delegated op_svc_ecs account or ECS service and whether the TenantAdministrator policy is selected for the current region or sub-project.

● If the AK/SK mode is used, check whether the used AK/SK is invalid.

3.8 Failed to Create a VM Application Instance

SymptomVM deployment fails during instance creation.

Solution1. Choose Application Management > Application List. On the page that is

displayed, click an application. The application details page is displayed.2. On the Component List tab page, click a component. The component details

page is displayed.3. Select the abnormal component and click View Details. The component

details page is displayed.

4. On the Instance List tab page, click before the instance name and thenclick Event.

5. On the Event tab page, click View Details of a failure event to view its cause.6. You can view the running logs of an instance on Logs from the navigation

tree. If an instance is abnormal, you can locate the fault.Remarks:– Instance directories on the ECS host:

Directory for storing the software package: /opt/ssa/packages/${appName}/${appVersion}/${instanceId}/Instance running directory: /opt/application/${appName}/${appVersion}/${instanceId}/Instance running logs: /var/log/application/${appName}/${appVersion}/${instanceId}/Instance deployment logs: /var/log/servicestage-agent/${appName}/${appVersion}/${instanceId}/

– If the instance deployment failure event indicates that the softwarepackage fails to be downloaded from DevCloud, as shown in thefollowing figure, you may need to check whether the ECS can access theInternet.

ServiceStageFAQs 3 Application Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 8

Page 14: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

3.9 What Should I Do If an Instance Is Being Createdfor a Long Time?

After an application component is created, if the service instance is in the Notready state for a long time, you can access the service instance list to expand theinstance details. On the Event tab page, you can see that the memory isinsufficient.

This problem can be solved by adding nodes.

Step 1 Log in to ServiceStage, choose Infrastructure > K8S Clusters, and click CreateNode in the Operation column of the target cluster.

Step 2 Set node parameters. Parameters marked with an asterisk (*) are mandatory.

The following table describes parameters that need to be set. If no parameter isspecified, the default settings are used.

Table 3-1 VM node information

Parameter Description

*EIP Select Automatically Assign.Use the default values for all parameters.

*Login Mode Select a key pair.Used for identity authentication when you remotely login to the node. Select an existing key pair.

Step 3 Click Next.

ServiceStageFAQs 3 Application Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 9

Page 15: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Step 4 Click Submit.

It takes 6–10 minutes to create a node. Information indicating the progress of thecreation process will be displayed. On the node list page, if the node status isAvailable, the node is added successfully.

----End

3.10 Docker Application Dependency

SymptomRun a node program in the microservice docker. The program depends on annode-gyp. How to install the dependency before compiling the program?

AnswerYou can customize the Dockerfile and compile the node-gyp dependency in theDockerfile.

3.11 How Do I Customize the Tomcat Context Path?When creating a Tomcat application, Tomcat configurations are required.Specifically, the default server.xml configuration is used, the context path is /, andno application path is specified. The application access address is:

http://example_domain/

Click Change (for details, see "Deploying a Component" in the User Guide) andmodify the following example to customize the application path. The applicationaccess address is http://example_domain/app-path.

<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" > <Context path="app-path" docBase="ROOT.war"/></Host>

3.12 Can a Microservice Be Used to Create MultipleWorkloads or Release Multiple Image Tags?

Workload is the management unit of the deployment system. Generally, it is aprocess. The deployment system schedules workloads and the process runs withinthe workload. Microservice is defined by service, that is, a process provides aservice, such a service is a microservice. Therefore, a microservice can havemultiple workloads (one process has multiple copies). Each workload can bereleased to an image tag. These workloads provide the same service. HUAWEICLOUD uses Kubernetes for deployment. To reduce resource consumption, you cancreate only one workload for a service and create multiple instances.

ServiceStageFAQs 3 Application Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 10

Page 16: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

3.13 What Are Affinity and Anti-affinity?Before an application is containerized, multiple components are installed on a VMand processes communicate with each other.

During container splitting, containers are split by process. For example, serviceprocesses are stored in a container, and monitoring logs or local data is saved inanother container. The two containers have an independent lifecycle. If the twocontainers are distributed far away from each other on the network, the request isforwarded at multiple times and the performance may deteriorate.

● Affinity means proximity deployment, which strengthens nearest routing fornetwork communication and reduces network loss.

● Anti-affinity indicates that instances are scattered as possible for the sake ofhigh reliability. When a node is faulty, only 1/n applications or one instance isaffected.

3.14 How Do I Use a Fixed Application Component IP?

Problem DescriptionIf TCP/UDP Route Configuration is not set during application componentcreation, the access IP address of the application changes when the containerrestarts. This may bring difficulties in your configuration.

SolutionSet TCP/UDP Route Configuration when creating or deploying an applicationcomponent. in any of the following ways:

● Intra-cluster access: An application can be accessed by other applications inthe same cluster using an internal domain name.

● Intra-VPC access: An application can be accessed by other applications in thesame VPC using the IP address of a cluster node or the IP address of anElastic Load Balance (ELB) service in a private network.

● External access: An EIP is used to access applications from a public network.This access mode is applicable to services that need to be exposed to a publicnetwork in the system. In this access mode, EIP must be bound to any node inthe cluster and a port mapped to the node must be configured.

ServiceStageFAQs 3 Application Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 11

Page 17: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

3.15 What Are the Scheduling Policies?Based on the deployment features of application components, ServiceStage dividesapplication components into minimum deployment instances. The applicationscheduler monitors instance information of applications in real time. Whendetecting that a new pod needs to be scheduled, the application schedulercalculates all remaining resources (compute, storage, and network resources) inthe cluster to get the most suitable target nodes for scheduling.

ServiceStage supports multiple scheduling algorithms, including affinity schedulingbetween applications and nodes and affinity/anti-affinity scheduling betweenapplications.

3.16 Does the Governance Center Use HystrixCapabilities? What Is Enhanced?

The circuit breaker and service degrade capabilities of the governance center usepart of Hystrix capabilities, and the service discovery capability uses part of Ribboncapabilities. Based on those capabilities, the governance center uses the CSEservice schema to support microservice governance with more specificgranularities (such as service and operation), and to provide governancecapabilities, such as instance access error retry and isolation, and priority of servicediscovery between multiple data centers. In addition, original governance methodsprovided by open source libraries are encapsulated properly and can be directlyconfigured in the governance center without further coding.

ServiceStageFAQs 3 Application Management

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 12

Page 18: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

4 Continuous Delivery

4.1 How Does ServiceStage Manage Code on Idea?Idea is a local IDE. You can encode on the IDE, upload the code to a code library,and select the source code repository deployment.

If applications are developed based on the ServiceComb framework, select sourcecode repository for deployment, and specify an engine to govern the applications.

4.2 How Do I Add the Build Server Address to theGitLab Server Security Group?

Background

If your GitLab service is built on the intranet of a public cloud, and the publicnetwork cannot be accessed directly, add the address of the build service to yourGitLab server's security group to ensure build task running.

Procedure

Step 1 Check the running node of the build image.

1. Check the job definition to obtain the build cluster name and labelinformation, as shown in the following figure.

2. Choose Infrastructure > K8S Cluster . On the page that is displayed, obtainthe elastic IP address of the node in the cluster, as shown in the followingfigure.

ServiceStageFAQs 4 Continuous Delivery

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 13

Page 19: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Step 2 Add the network segment 43.254.0.0/24 where ServiceStage is located to thesecurity group of the node where the GitLab private repository resides. The buildservice uses this IP address segment to access the GitLab service API. For detailsabout how to set a security group, see Adding a Security Group Rule.

Step 3 Add the running node of the build image obtained in Step 1 to the security groupof the node where the GitLab private repository resides. During the build, the buildservice accesses the GitLab service to pull the code. For details, see Step 2.

----End

4.3 How Do I Add the Build Server Address to theMaven Server Security Group?

BackgroundAdd the elastic IP address obtained in Step 1 to the security group of the nodewhere the private Maven service resides to enable the build service to access theMaven server to download the dependency package.

ProcedureFor details about how to set a security group, see Adding a Security Group Rule.

4.4 Failed to Use ServiceStage for BuildingThere are many causes for software engineering build failures. You can locate thefault based on the following scenarios:

Code Cannot Be PulledSee the following figure.

ServiceStageFAQs 4 Continuous Delivery

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 14

Page 20: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

The possible causes are as follows:

● If an application is built on your own node, the node may not be bound to anelastic IP address. For example, in the preceding figure, node 192.168.x.x isnot bound to an elastic IP address. Solution: Bind an elastic IP address to thenode. For details, see Assigning an EIP and Binding It to an ECS.

● The authorization information has expired, the private token of the codesource has low permission, or the authorization information has beenremoved. For example, the code source of DevCloud cannot obtain code. Thismay be because the user password is incorrect during authorization creation.Solution: Create authorization. For details, see Authorizing a Repository.

● The network between the self-built code source repository and the node to bebuilt is disconnected. For example, a private Bitbucket is set up on a node incluster A and built in cluster B. However, cluster B and cluster A are indifferent VPCs. As a result, their network is disconnected, and code cannot bepulled up in building. Solution: Connect the network.

Built Code Depends On the Private Maven Repository

There are two solutions:

● Add the settings.xml file to the root directory of your project, and specify theprivate Maven repository address in the settings.xml file. If your privateMaven repository needs to be authenticated, configure your authenticationinformation, username, and password in the settings.xml file.

● Specify a private Maven repository in the pom.xml file of your project.

The following is an example of the paths of the settings.xml and pom.xml files:

Dockerfile for Source Code Job Building Is Incorrectly Set

For details about how to write a Dockerfile, see the official website or demogenerated based on ServiceStage templates.

ServiceStageFAQs 4 Continuous Delivery

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 15

Page 21: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Project Code Depends On the CSE SDK and the DevCloud Private MavenRepository

Perform the following steps:

Step 1 Add the settings.xml file to the root directory of your project.

Step 2 Log in to the DevCloud private dependency repository and select the specifiedMaven private dependency library from the repository list on the left.

Step 3 Choose More > Set Up.

Step 4 Click Download Configuration File to download the settings.xml file.

Step 5 Modify the downloaded settings.xml file as follows:

1. Add !HuaweiCloudSDK to <mirrorOf>.<mirror> <id>z_mirrors</id> <mirrorOf>*,!releases,!snapshots,!HuaweiCloudSDK</mirrorOf> <url>https://repo.hauweicloud.com/repository/maven</url></mirror>

2. Add a Maven repository under <repositories> in <profiles>.<repository> <id>HuaweiCloudSDK</id> <url>https://repo.huaweicloud.com/repository/maven/huaweicloudsdk/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots></repository>

Step 6 Place the modified settings.xml file in the root directory of your project and buildthe job.

----End

Customizing Dockerfile When Software Package Building Job Is Created

After you select a software package, the system automatically uploads thesoftware package to the current working directory of the image. A Dockerfileexample is shown as follows.

ServiceStageFAQs 4 Continuous Delivery

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 16

Page 22: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

ServiceStageFAQs 4 Continuous Delivery

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 17

Page 23: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

5 Software Center

5.1 What Shall I Do If a Software Package Fails to BeUploaded?

Problem DescriptionWhen I upload a software package that meets the system requirements, thefollowing error message is displayed:

After the software package is uploaded, message "No access permission. Contactthe administrator" is displayed.

Solution

Step 1 In Google Chrome, choose More tools > Clear browsing data.

ServiceStageFAQs 5 Software Center

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 18

Page 24: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Figure 5-1 Clear browsing data

Step 2 On the displayed Clear browsing data page, retain the default selection and clickCLEAR BROWSING DATA.

----End

5.2 What Shall I Do If an Image on the Docker ClientFails to Be Pushed?

Problem DescriptionAfter logging in to the Docker, I run the following command to upload an imageon the Docker client:

docker push 10.125.54.133:20202/test1/busybox:latest

NO TE

10.125.54.133:20202 indicates the IP address and port number of the repository created bya tenant or user.test1 indicates the organization.

If the image fails to be uploaded, the following error message is displayed on theDocker client:

unauthorized: authentication required

ServiceStageFAQs 5 Software Center

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 19

Page 25: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Solution

Step 1 Log in to the Docker client using the correct AK/SK as a tenant or user.

Step 2 Upload the image to the organization with operation permissions of a logintenant or user or change a new organization.● Run the following command to upload the image to the organization with

operation permissions of a login tenant or user:docker push 10.125.54.133:20202/test2/busybox:latest

NO TE

10.125.54.133:20202 indicates the IP address and port number of the repository created bya tenant or user.test2 indicates the organization with operation permissions of the tenant or user.

● Run the following command to change a new organization:docker push 10.125.54.133:20202/test3/busybox:latest

NO TE

10.125.54.133:20202 indicates the IP address and port number of the repository created bya tenant or user.test3 indicates the new organization.

Step 3 After the image is uploaded successfully, the following information is displayed:The push refers to a repository [10.125.54.133:20202/test2/busybox] 6a749002dd6a: Pushedlatest: digest: sha256:ecb3f3e96e003af6e02f0f47ac4d25a3b0585db54de0a82bb070f8cb78a79bc7 size: 527

If upload errors occur, contact Huawei technical support.

----End

5.3 Failed to Download the SWR Software Package

SymptomWhen a Tomcat application is created, a message is displayed indicating that thecreation fails. The Tomcat log shows that the authentication fails when the SWRsoftware package is downloaded. Then, error 401 is displayed when the SWRsoftware package is downloaded manually.

AnswerSet the image to public. Private packages cannot be obtained due to permissionissues.

ServiceStageFAQs 5 Software Center

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 20

Page 26: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

6 Infrastructure

6.1 How Do I Troubleshoot Insufficient EIPs When aNode Is Added?

Problem Description

When Use Existing IP is selected for EIP during node creation, the node fails to becreated and the system displays a message indicating that the elastic IP address isinsufficient.

Solution

Two methods are available to resolve this problem:

● Method 1. Unbind the VMs bound to EIPs and add a node again.

a. Log in to the public cloud.

b. Choose Network > Virtual Private Cloud.

c. On the navigation tree, choose Elastic IP.

d. Click Unbind for the ECS to be unbound, unbind the elastic IP addressfrom the ECS, and click OK.

● Method 2. To increase the quota of an elastic IP address, you need to submitan application through the work order system.

The public cloud limits resource quotas to users. If the existing resourcequotas cannot meet your service requirements, you can submit a service ticketto increase your quota. Once your application is approved, your quota will beupdated and a notification will be sent to you.

6.2 How Do I Bind an Elastic IP Address?You can apply for elastic IP addresses and bind the IP addresses to the ElasticCloud Server (ECS) to enable the ECS to access the public network.

ServiceStageFAQs 6 Infrastructure

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 21

Page 27: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Procedure

Step 1 Log in to the public cloud.

Step 2 On the homepage, choose Network > Virtual Private Cloud.

Step 3 On the navigation tree, choose Elastic IP.

Step 4 Click Apply for EIP.

Step 5 For details, see Assigning an EIP and Binding It to an ECS.

NO TE

You can access the applications running on the cloud service bound with an IP address onan external network.

----End

6.3 How Do I Move a Node from One Cluster toAnother?

SymptomHow do I move a node from one cluster to another?

AnswerCurrently, nodes in a cluster cannot be moved to another one. You can releaseexisting nodes and create nodes in a new cluster.

6.4 Purchased ECS Resources Are Not Displayed

SymptomExisting ECS resources cannot be viewed on ServiceStage.

AnswerServiceStage obtains and displays the ECS resource list of an account through anAPI. However, resources in different regions are isolated. Therefore, check whetherresources are in the same region.

6.5 Does the Unsubscribed Server Affect Running ofExisting Programs?

SymptomThere are five servers, three running applications, and each application has twoinstances. Are the instances randomly released to two of the servers?

ServiceStageFAQs 6 Infrastructure

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 22

Page 28: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

If I want to unsubscribe three servers, will the applications be automaticallydeployed on the remaining two servers?

AnswerShut down the server to be deleted and then delete the node.

6.6 Can Basic Resources Be Managed on ServiceStage?

SymptomCan ServiceStage manage existing resources, such as ECS and RDS resources? Orcan manage and control resources only created on itself?

AnswerServiceStage obtains the resource list of an account through an API, such as ECSand RDS resource list, and supports basic management operations. However,resources in different regions are isolated and can be managed only after beingswitched to the same region.

6.7 Failed to Query the ConfigServer During GitConfiguration

SymptomThe system displays a message indicating that the ConfigServer query fails forglobal configurations of the Spring Cloud engine regardless of Git configurations.

AnswerRestart dvr-compute-agent.

ServiceStageFAQs 6 Infrastructure

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 23

Page 29: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

7 Application O&M

7.1 Why Cannot Logs Be Viewed in ServiceStage?Logs of ServiceStage are provided by the AOM service. Before using the AOMservice, you must install the ICAgent. Otherwise, the AOM service cannot be used.

ICAgent is the collector of AOM. It runs on each host to collect metrics, logs, andapplication performance data in real time. For details, see Installing the ICAgent.

7.2 Application Access Mode Becomes Invalid After theElastic IP Address Is Replaced

SymptomIf the EIP of a load balancer is replaced when the load balancer is bound to anapplication, the application access mode cannot be automatically updated.

AnswerYou need to manually delete the original EIP and add the new EIP, and then usethis new EIP for ELB access.

7.3 Memory Usage of a Node Is Too High After a NewService Starts

SymptomWhat should I do if the memory usage of a node is too high after a new service isstarted?

ServiceStageFAQs 7 Application O&M

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 24

Page 30: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

AnswerSet affinity by referring to Configuring Application Scheduling Policies so thatservice instances to be deployed based on affinity nodes.

7.4 How Do I Uninstall a Service?Log in to the ServiceStage console, choose Application Management >Application List, and select an application. On the application details page that isdisplayed, click the Component List, select and delete all components, and thendelete the application.

Choose Infrastructure > Cloud Service Engines > Console > Service Catalog >Microservice List. On the displayed page, delete the microservice to uninstall theservice.

If a microservice is deleted only on the CSE console, the running applicationcomponent still registers the microservice on the CSE console.

NO TE

To delete a resource, you need to obtain the corresponding permission. If a message isdisplayed indicating that you do not have the permission, apply for the permission byreferring to ServiceStage Permissions.

7.5 Why Some Types of Logs Can Be Collected butSome Types of Logs Cannot Be Collected When IConfigure Container Logs?

Currently, ICAgent collects only .log, .trace, and .out log files. If logs cannot becollected, you are advised to change the log format to the supported format.

ServiceStageFAQs 7 Application O&M

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 25

Page 31: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

8 Application Development

8.1 What Is the Difference Between the Microserviceand Common Application?

The microservice is an architectural model. Its general idea is to break anapplication into multiple parts. Therefore, an application using the microservicearchitecture is actually a distributed application.

This enables services to change faster, and the system to be more reliable.

Type Microservice Common Application

Development

The workload of a microserviceis light. A Two Pizza team canrewrite all the code of amicroservice in two weeks. Thiscan be used as a symbol ofmicroservices. Whendeveloping a microservice, itsAPIs need to be available forinterconnection with othermicroservices. Therefore, theAPI definition-baseddevelopment mode is highlyrecommended.

Complex logic, coupled modules,bloated code, difficult modification,and low version iteration efficiency.

Deployment

An application consisting ofmultiple microservices iscomplex. Deploymentorchestration is required whenthe application is deployed.

Possible large, and long build anddeployment time, which is notconducive to frequent deploymentand hinders continuous delivery. Thisproblem is especially serious inmobile application development.

ServiceStageFAQs 8 Application Development

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 26

Page 32: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Type Microservice Common Application

O&M Governance takes the notice inaddition to metrics monitoringand log collection. The coreconcept of microservicegovernance is to maintain thesystem performance throughmodifications while the systemis running.

It takes a long time to rectifycommon online problems. To rectifyany online problem, the entireapplication system must beupgraded.

8.2 How Do I Handle a Microservice Registry Failure(Java Chassis)?

After a microservice is successfully deployed, you need to register the microservicewith the service center and the configuration center to enable the microservicediscovery and governance capabilities. The microservice registry fails when any ofthe following conditions is met:

● The AK/SK information is not configured or is incorrectly configured.● The address of the service center or configuration center is incorrect.● The network connection is faulty.● The domain name resolution fails.● The monitoring port is already occupied.

Troubleshooting Procedure● If the following error message is displayed, the AK/SK information is

incorrectly configured or carried in the request header.{"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Invalid request, header is invalid, ak sk or project is empty."}

Checking method:

a. Check whether the project depends on the following authenticationmodules (indirect dependency is permitted, for example, the projectdepends on the cse-solution-service-engine):<groupId>com.huawei.paas.cse</groupId><artifactId>foundation-auth</artifactId>

b. Check whether AK/SK in the microservice.yaml file is correct. To obtaincorrect AK/SK, see Access Keys.cse: credentials: accessKey: your access key secretKey: your serect key akskCustomCipher: default

● If the following error message is displayed, the AK/SK information isincorrectly configured.{"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Get service token from iam proxy failed,{\"error\":\"validate ak sk error\"}"}

Checking method:

ServiceStageFAQs 8 Application Development

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 27

Page 33: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Check whether AK/SK in the microservice.yaml file is correct. To obtaincorrect AK/SK, see Access Keys.cse: credentials: accessKey: your access key secretKey: your serect key akskCustomCipher: default

● If the following error message is displayed, the project information isincorrectly configured.{"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Get service token from iam proxy failed,{\"error\":\"get project token from iam failed. error:http post failed, statuscode: 400\"}"}

Checking method:Check whether the project information in the microservice.yaml file iscorrect. To obtain correct project information, see API Credentials.cse: credentials: accessKey: your access key secretKey: your serect key akskCustomCipher: default project: cn-north-1

● If the following error message is displayed, there is no sufficient quota to adda service instance.{"errorCode":"400100","errorMessage":"Not enough quota","detail":"no quota to create instance, ..."}

Checking method:Log in to the public cloud and view the instance quota on the Cloud ServiceEngine (CSE) page. If remaining quotas are displayed, check the service centeraddress and region information configured in the code. Note that you need tocheck quotas of the region where the instance locates.

● If the microservice fails to access the service center or configuration center,the following information is displayed. The microservice does not access theservice center or configuration center. Therefore, no error code can be foundin the service center or configuration center.Connection refused: no further information

Checking method:a. Check whether IP addresses of the service center and configuration center

in the microservice.yaml file are correct. If not, correct them.cse: service: //Information about the service center. The address field indicates the service center address. registry: address: https://cse.cn-north-1.myhuaweicloud.com instance: watch: false config: //Information about the configuration center. The address field indicates the configuration center address. client: serverUri: https://cse.cn-north-1.myhuaweicloud.com refreshMode: 1 refresh_interval: 5000

b. If IP addresses of the service center and configuration center are correct,run the following commands to check whether the network is normal.ping <servicecenter ip>ping <configurationcenter ip>If ping command execution is successful, the network connection isnormal.

ServiceStageFAQs 8 Application Development

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 28

Page 34: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

NO TE

If the address of the service center or configuration center is a domain name,change the address configured in the microservice.yaml file to the domainname. Then, run the ping command.

c. If the network is normal, run the following command to obtain the IPaddress of the service center or configuration center.

ping <domain name>

If the following information is displayed, configure the obtained IPaddress and domain name in the local /etc/hosts file.10.153.78.18 cse.cn-north-1.myhuaweicloud.com

● In addition, if a microservice port number is occupied, the microservice mayfail to start. In this case, you can run the following command to checkwhether the service monitoring port is occupied.

netstat -ano | findstr 8080If the port is occupied by another application, modify the microservice.yamlfile and change the monitoring port to an unoccupied port.rest: address: 0.0.0.0:8087 //Microservice port. Ensure that the port number is unique.

8.3 How Do I Troubleshoot Microservices Deployed onthe Cloud?

You can use Dashboard to locate a fault. Dashboard allows you to check real-timerunning status of all microservices and instances.

After locating the faulty node, you can use application performance management(APM) to check running logs of the node for further analysis.

8.4 Shall I Use the SDK or ServiceMesh to Build aMicroservice?

● The SDK applies to self-governed microservices, which enables offlinedebugging. Theses microservices need to be developed based on the SDK.

● The microservice built using ServiceMesh requires a ServiceMesh environmentduring deployment. ServiceMesh enables microservices to be easily developed,and other SDKs are not required.

ServiceMesh Scenarios● When the service code compiled in non-Java language is reconstructed into

the microservice code.

● When a Java service is reconstructed into a microservice.

● When a non-Java-SDK-based service interconnects with a Java-SDK-basedservice.

ServiceStageFAQs 8 Application Development

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 29

Page 35: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

JAVA SDK Scenarios● When the distributed transaction is required.● When a microservice, especially a new microservice, is compiled by Java.● When only HTTP1.1 is supported. If other protocols are required, you are

advised to use the SDK to build a microservice.

8.5 Is the Microservice Bound to the Public Cloud? HowDo I Perform Local Development?

ServiceStage is provided in the public cloud, which allows you to perform O&Moperations on your microservices while they are running. ServiceComb, as theopen-source development framework of ServiceStage, is not bound to the publiccloud. You can use ServiceComb to develop and run microservices in variousscenarios, including the local environment. By leveraging the features ofServiceComb, ServiceStage integrates some features for commercial use. Thesecommercial-use features are not open-source, but free of charge.

You can use CSE Java SDK to locally develop microservices. For details, DeveloperGuide.

8.6 Common Problems About Switching of SpringBootApplications to CSE Java SDK Framework

Failed to Initialize the Container● Symptom: The error message "Unable to start embedded container" is

displayed during initialization.This problem occurs if the resource directory contains application properties.

● Cause: By default, Spring starts the built-in container (Servlet dependency isimported to Vert.x).

● Solution: Modify SpringApplication.run (TestspringbootApplication.class,args) to web selection disabled. The code is as follows:new SpringApplicationBuilder().sources(TestspringbootApplication.class).web(false).run();

Failed to Initialize Bean Related to Database● Symptom: The error message "Property 'sqlSessionFactory' or

'sqlSessionTemplate' are required" is displayed during initialization.● Cause: By default, spring-jdbc is set to provided for

org.apache.servicecomb:java-chassis-core. As a result, the .jar packagecannot be found when the program is running, leading to the initializationfailure.

● Solution: Modify scope of spring-jdbc in pom.xml.<dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <scope>compile</scope></dependency>

ServiceStageFAQs 8 Application Development

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 30

Page 36: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

8.7 How Do I Handle a Dependency ObtainmentFailure?

After the Maven image source is configured, the dependency fails to be obtained,as shown in Figure 8-1.

Figure 8-1 Failed to obtain the dependency

If you need to use a proxy to access the external network, you need to configurethe Maven proxy. Specifically, you can configure proxy in the setting.xml file (userconfiguration) in the m2 directory in the user directory (for example, C:\Users\yang****\ in the Windows OS) or the setting.xml file (system globalconfiguration) in the conf directory in the Maven installation directory.

Find the tags in the setting.xml file and configure the proxy information. Forexample,

<proxies> <!-- proxy | Specification for one proxy, to be used in connecting to the network. | --> <proxy> <id>self-defined proxy ID. The proxy configuration must be unique. </id> <active>true</active> <protocol>http</protocol> <username>proxy authentication account</username> <password>proxy authentication password</password> <host>enterprise's proxy address</host> <port>port number of the proxy address</port> </proxy> <proxy> <id>self-defined proxy ID. The proxy configuration must be unique. </id> <active>true</active> <protocol>http</protocol> <username>proxy authentication account</username> <password>proxy authentication password</password> <host>enterprise's proxy address</host> <port>port number of the proxy address</port> </proxy>

</proxies>

ServiceStageFAQs 8 Application Development

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 31

Page 37: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

8.8 What Database Does the Service Center Use? WhatAre the Differences Between etcd and Eureka?

CSE uses the etcd- and Golang-based service center in the API server layer.Different from the Eureka that manages only dynamic routing data, the servicecenter of CSE provides abundant management capabilities for static metadata. Forexample, the service center provides integrated metadata management for theapplication, service, and instance, service-based version and tag management tosupport dark launch, and service dependency records based on discovered actions.

Based on the dynamic routing data management of Eureka, the service center canmanage a system with a large scale of microservices deployed, which is highlyvalued for large-scale enterprise-level microservice systems. In addition, theservice center provides various fault-tolerance capabilities to handle faults occurduring the request sent from the SDK to the service center, or from the API serverto the etcd, and those occur on the etcd or network partition. With the cachedesign of each level of the API server, the service center provides betteravailability.

Therefore, compared with Eureka, not only the management capability, the servicecenter also enhances its consistency, availability, and partition tolerance (CAP).Unlike Eureka that sacrifices consistency to ensure availability, the service centerenhances all capabilities of the BASE model.

8.9 What Are the Differences Between theConfiguration Center and Spring Cloud Config?

The configuration center of CSE is developed using the Java language, and usesetcd as the background storage. The configuration center is irrelevant to SpringCloud Config. Compared with Spring Cloud Config, the configuration center usesmulti-dimensional data modeling to organize configuration data, which providesbetter description capability and better scalability. In addition, the configurationcenter supports the push and pull modes to provides better real-timeconfiguration change notification.

8.10 Why Do I Use Cloud Service Engine?By leveraging the best experience of microservice construction in multiple Huaweiinternal large-scale systems, Cloud Service Engine (CSE) provides mature andstable microservices for enterprise-level applications. This lowers microservicerequirements for enterprise-level applications.

With CSE, you do not need to care about the infrastructure of microservices otherthan your own microservices. This ensures system stability. In addition, you canuse and govern a microservice once it is deployed. You can also obtain guidanceand assistance during microservice development and the latest technologydevelopment.

ServiceStageFAQs 8 Application Development

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 32

Page 38: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

8.11 How Can I Obtain the CSE Service Center Address?

SymptomHowe can I obtain the CSE service center address?

AnswerLog in to the ServiceStage console, choose Infrastructure > Cloud ServiceEngines, and find Connection Address of Service Center.

Figure 8-2 Service center address of the professional engine

Figure 8-3 Service center address of the exclusive engine

ServiceStageFAQs 8 Application Development

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 33

Page 39: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

8.12 What Is Service Name Duplication Check?

Symptom

What is service name duplication check? This may involve service developmentand deployment.

Answer

After a microservice starts, it is registered with the microservice engine. Under thesame microservice engine, the system checks whether the APPLICATION_ID(application name) and microservice name are the same.

8.13 Is a Certificate Verified When a Client SendsHTTPS Messages to CSE? Where Can I Find the RootCertificate?

Currently, CSE does not verify the microservice certificate. The root certificate isgenerated by calling the common component PSM.

8.14 Why Shall I Define Service Contracts?The enterprise-level systems are in large scale and involve many microservicecomponents. Therefore, unified API management is a key requirement ofenterprises. HUAWEI CLOUD CSE uses contract management to meet thisrequirement.

For management: Through contract management, API definition files that complywith API description standards for microservices are defined. In this way, APIdevelopment of multiple development teams can be standardized andcoordinated, reducing communication costs and facilitating management.

For development: During microservice development, different teams or evendifferent independent software vendors (ISVs) can develop the same applicationor system based on the unified API definition file, facilitating consistencymaintenance of the overall system. Specifically, modules in a monolithicapplication are called using code. Therefore, any API incompatibility can beresolved during the early compilation with low bug fixing costs. Aftermicroservices are decoupled, services are remotely called. Therefore, APIinconsistency cannot be found during the early compilation, resulting in high bugfixing costs. Using service contracts, contract design can be assured, changes canbe strictly reviewed, and code can be reversely generated. This ensures APIcompatibility.

In addition, for small-scale systems that do not have high requirements on unifiedmanagement, API definition files can be automatically generated through APIs.

ServiceStageFAQs 8 Application Development

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 34

Page 40: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

9 Java SDK FAQs

9.1 How Do I Extend AK/SK Decryption Methods?

ProblemHow do I extend AK/SK decryption methods?

SolutionExtend and implement AKSKCipher: implementscom.huawei.paas.foundation.auth.credentials.AKSKCipher

Implement the name() and decode(TYPE type, char[] encrypted) methods, anduse the @Component annotation to initialize the class as bean. TYPE is of theenumerated value, which can be AK or SK. Generally, only SK needs to beencrypted for storage.

An example is as follows:

@Componentpublic class CustomAKSKDepl implements com.huawei.paas.foundation.auth.credentials.AKSKCipher { @Override public String name() { return "base64"; }

@Override public char[] decode(TYPE type, char[] encrypted) { try { String a = new String(Base64.decodeBase64(String.valueOf(encrypted)), "UTF-8"); return a.toCharArray(); } catch (UnsupportedEncodingException e) { return null; } }}

ServiceStageFAQs 9 Java SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 35

Page 41: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

9.2 How Do I Perform Local Development and Test?The lightweight local service center provides you with the service discovery,registration, and query functions during development, commissioning, and testing.

ConceptThis section describes how you can locally develop and commission consumer andprovider applications. Both service providers and consumers need to connect to aremote service center. Two methods of building a local service center for localmicroservice commissioning are as follows:

1. Starting the local service center.2. Starting the local service center (Mock mechanism) by using the local file.

The local service center is an important component in the microservicearchitecture, and is used for managing, registering, and detecting metadata andinstance metadata. The logic relationship between the service center andmicroservice provider/consumer is as follows:

Prerequisites● JDK 1.8 has been installed, and the JAVA_HOME environment variable has

been correctly configured.● Starting the local service center will occupy ports 30100 and 30103 of the

server, which respectively indicate the backend and frontend service ports ofthe service center. Ensure that these two ports are not in use.

Starting the Local Service Center

Step 1 Go to and download the installation package of Local Service Center.

Step 2 Install the package of the service center.● Software package installation: Decompress the installation package to the

installation directory.

ServiceStageFAQs 9 Java SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 36

Page 42: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

● Image package installation: Run the following command to install the servicecenter:docker load -i local-service-center-{version}-docker.tar

NO TE

1. The OS must be 64-bit.

2. If you need to change the IP address and port number when installing the softwarepackage of the service center, modify the /../conf/app.conf file. In the file,frontend_host_ip and frontend_host_port respectively represent the IP addressand port number for monitoring the frontend service of the service center, andhttpaddr and httpport respectively represent the IP address and port number formonitoring the backend service of the service center. The following shows how tochange the IP address and port number by taking the backend service of theservice center as an example:

If httpaddr is set to 127.0.0.1, the service center can be accessed by a localprocess. To enable the service center to be accessed by remote processes, sethttpaddr to an external IP address or 0.0.0.0.# listen addresshttpaddr = 127.0.0.1httpport = 30100

Step 3 Start the local service center.● For the Windows OS: In the installation package, click the start.bat script to

start the local service center.● For the Linux OS: Run the start.sh script to start the local service center.

NO TE

Before running the start.sh script, run the following command to modify the filepermission:

chmod -R 550 /../bin

● For the Docker container: Run the following command to start the localservice center:docker rm -f scdocker run -d --name sc -p 30100:30100 -p 30103:30103 local-service-center:latest

Step 4 Enter http://127.0.0.1:30103 in the address bar of a browser, and access thefrontend page.

Step 5 After the local service center starts, configure the service center address in themicroservice.yaml file that stores SDK configurations, as shown in the following:cse: service: registry: address: http://127.0.0.1:30100 #Backend address and port number of the service center

NO TE

● By default, the listening address of the service center is set to 0.0.0.0. To enhancesecurity, you can set the listening address to 127.0.0.1.

● If you have customized the IP address and port number when using the service center,change the value of address as required.

● If the configuration center and dashboard are not used, delete related configurations.

ServiceStageFAQs 9 Java SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 37

Page 43: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

After the microservice application is developed, run MainServer on the server tostart the service process and register services with the service center.

Step 6 (Development service providers and consumers) Start the microservice for localtests.

----End

Enabling the Local Service Center Using the Mock MechanismStep 1 Create the registry.yaml file for local service center.

springmvctest: - id: "001" version: "1.0" appid: myapp #Commissioning service ID instances: - endpoints: - rest://127.0.0.1:8080

NO TE

In the mock mechanism, you need to prepare service schemas on your own. Currently, onlylocal commissioning for service consumers is supported.

Step 2 Add the following code to the end of the Main function for service consumers.public class xxxClient {public static void main(String[] args) { System.setProperty("local.registry.file", "/path/registry.yaml"); //your code System.clearProperty("local.registry.file");}

NO TE

Set the second parameter of setProperty to the absolute path of registry.yaml in the disk.Path separators vary depending on systems.

Step 3 (Development service consumers) Start the microservice for local tests.

----End

Entering the Developer ModeWhen the Local Service Center is downloaded for local test and development, theLocal Service Center needs to be restarted or the version needs to be upgradedevery time the code is changed. Otherwise, an error is displayed.

Add the following configuration to the microservice.yaml file to enter thedevelopment mode.

service_description.environment: development

9.3 Message "Invalid request, header is invalid, ak skor project is empty." Is Displayed When the ServiceCenter Is Attempted to Be Connected

Developers can use the service center provided by the public cloud to developservices. To use the service center, a developer must register an account and

ServiceStageFAQs 9 Java SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 38

Page 44: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

generate AK/SK information in My Credential for access authentication control.For details about how to access the public cloud, see Accessing Applications toServiceComb Engines.

Abnormal message

{"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Invalidrequest, header is invalid, ak sk or project is empty."}

Cause

The AK and SK are not correctly set or carried in the request header.

Diagnosis method

Check whether the project depends on the following authentication modules.(Check whether indirect dependency exists, for example, whether the projectdepends on cse-solution-service-engine.)

<groupId>com.huawei.paas.cse</groupId> <artifactId>foundation-auth</artifactId>

Check whether AK/SK configurations in microservice.yaml are correct. Generally,the SK is longer than the AK.

cse: credentials: accessKey: your access key secretKey: your serect key akskCustomCipher: default

Specifically, log in to the public cloud and query the AK information in MyCredential. The SK is saved by the user and cannot be queried. If you forget therelated credential, delete the credential information and create new credentialinformation.

9.4 Message "validate ak sk error" Is Displayed Whenthe Service Center Is Attempted to Be Connected

Developers can use the service center provided by the public cloud to developservices. To use the service center, a developer must register an account andgenerate AK/SK information in My Credential for access authentication control.For details about how to access the public cloud, see Accessing Applications toServiceComb Engines.

Abnormal Message

{"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Getservice token from iam proxy failed,{\"error\":\"validate ak sk error\"}"}

Cause

The AK and SK are incorrect.

ServiceStageFAQs 9 Java SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 39

Page 45: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Diagnosis method

Check whether AK/SK configurations in microservice.yaml are correct. Specifically,log in to the public cloud and query the AK information in My Credential. The SKis saved by the user and cannot be queried. If you forget the related credential,delete the credential information and create new credential information.

9.5 Message "get project token from iam failed" IsDisplayed When the Service Center Is Attempted to BeConnected

Developers can use the service center provided by the public cloud to developservices. To use the service center, a developer must register an account andgenerate AK/SK information in My Credential for access authentication control.For details about how to access the public cloud, see Accessing Applications toServiceComb Engines.

Abnormal Message

{"errorCode":"401002","errorMessage":"Request unauthorized","detail":"Getservice token from iam proxy failed,{\"error\":\"get project token from iam failed.error:http post failed, statuscode: 400\"}"}

Cause

The project name is incorrect.

Diagnosis method

Check whether the value of cse.credentials.project is correct. Specifically, querythe correct project name in My Credential. If this configuration item does notexist, the system checks the domain name of the service center by default. If thedomain name does not contain a valid project name, add this configuration itemand ensure that it is a valid project name in My Credential.

9.6 Message "Version validate failed" Is DisplayedWhen the Service Center Is Attempted to Be Connected

Developers can use the service center provided by the public cloud to developservices. To use the service center, a developer must register an account andgenerate AK/SK information in My Credential for access authentication control.For details about how to access the public cloud, see Accessing Applications toServiceComb Engines.

Abnormal Message

{"errorCode":"400001","errorMessage":"Invalid parameter(s)","detail":"Versionvalidate failed, rule: {Length: 64,Length: ^[a-zA-Z0-9_\-.]*$}"}

ServiceStageFAQs 9 Java SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 40

Page 46: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

CauseA new SDK is used, but an earlier SDK of the service center is connected.

Diagnosis methodCheck the version of the service center. You can download the latest service centerfrom the official website of the public cloud or ServiceComb.

9.7 Message "Not enough quota" Is Displayed Whenthe Service Center Is Attempted to Be Connected

Developers can use the service center provided by the public cloud to developservices. To use the service center, a developer must register an account andgenerate AK/SK information in My Credential for access authentication control.For details about how to access the public cloud, see Accessing Applications toServiceComb Engines.

Abnormal Message{"errorCode":"400100","errorMessage":"Not enough quota","detail":"no quota tocreate instance, ..."}

CauseThere is no sufficient quota to add a service instance.

Diagnosis methodLog in to the public cloud and view the instance quota on the microservice enginepage. If there a quota on the page, check the service center address and areainformation configured in the code.

ServiceStageFAQs 9 Java SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 41

Page 47: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

10 Go SDK FAQs

10.1 Certificate Loading Failed

Symptom

If this error message is displayed, the verifyPeer option is set to true and nocertificate is configured. The default value of verifyPeer in Go-chassis is false,which will not be changed automatically.

Solution● If a certificate is not necessary, the verifyPeer value changes during

development or continuous integration. In this case, check the code fromcommitting to deployment, and change value true to its default value false.

● If a certificate is necessary, configure it.

10.2 CSE Connection Times Out

Symptom

If this problem occurs, DNS resolution is successful but the CSE service cannot beaccessed.

AnalysisThe possible causes are as follows:

1. The IP address is unreachable, that is, the infrastructure fails.

ServiceStageFAQs 10 Go SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 42

Page 48: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

2. The CSE service has no response.

Fault LocatingRun the following command on the node where the failure occurs:

curl -v https://cse.cn-north-1.myhuaweicloud.com

Check the debug log to determine the phase where the failure occurs, that is,whether the IP address is unreachable, whether the request is sent, or whether theresponse is not returned.

10.3 invalid header name

Symptom

This problem is irrelevant to Go-chassis.

SolutionCheck the service code, especially the customized Go-chassis handler. Specifically,check whether there is an empty header or a non-standard header name.

ServiceStageFAQs 10 Go SDK FAQs

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 43

Page 49: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

11 Service Mesh

11.1 What Is the Mesher Performance Loss?The service mesh technology uses network traffic hijacking to manage inter-service traffic. In addition to the performance loss in internal logic processing ofMesher, service mesh also causes extra conversion between the user mode andkernel mode (the CPU consumes extra resources). Compared with the latter, theformer has little impact on performance. Therefore, the performance loss dependson the size of the payload transmitted over the network. For example, the size ofthe header and body affects the HTTP transmission speed. Latency of an end-to-end calling of Mesher is 1 ms. For example, if Mesher performance loss iscalculated to the latency in an actual service calling, the total latency is 4 mshigher. However, such a latency is acceptable to the user.

The following table lists the performance test results before and after Mesher isused. The payload is small, that is, the character string helloworld. However,certain code is added to increase the computing time of the server to simulate theservice code execution time.

Table 11-1 Test result

Metric Before After

TPS 1749 1496

ServiceStageFAQs 11 Service Mesh

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 44

Page 50: FAQs - Huawei · 2020. 4. 26. · This enables services to change faster, and the system to be more reliable. Type Microservice Common Application Develo pment The workload of a microservice

Metric Before After

Latency 2.8 ms 3.34 ms

CPU 50% 100%

Concurrency 5 5

The preceding result shows that the performance loss of Mesher is low. Theperformance bottleneck lies in the service code. If the payload content isincreased, the performance will be further deteriorated.

It is recommended that this technology be used to call services during initialtechnical selection and POC to test the real performance loss.

ServiceStageFAQs 11 Service Mesh

Issue 01 (2020-11-30) Copyright © Huawei Technologies Co., Ltd. 45