Microservice Development Architecture - Spring Cloud Common Problems and Summary <5> Summary of Spring Cloud Positioning Problems

Personal GitHub address: https://github.com/leebingbin/

    In the process of using Spring Cloud, it is inevitable to encounter some problems. So make some conclusions about the common problems of Spring Cloud.

5. Summary of Spring Cloud positioning problem ideas

    According to the feedback from the market, Spring Cloud has been relatively stable since it entered the Camden era. Generally speaking, the problem is not caused by a bug in Spring Cloud itself.

5.1 Troubleshoot configuration issues

    Check for configuration problems:

    Is the YAML indentation correct?

    Generally, novices will find that the Spring Cloud application cannot be started normally, or the configuration cannot be loaded normally. Sometimes when assisting with the solution, it is found that only the YAML configuration file is indented incorrectly. Problems like this should be strictly avoided in the coding process.

   · Whether the configuration properties are correct

    It is also a very common problem to write configuration properties incorrectly. Although this question is low-level, many beginners will encounter this kind of problem (especially when the IDE does not automatically prompt or give warnings, you should pay special attention).

    · Is the location of the configuration properties correct?

    Incorrect location of configuration properties may lead to abnormal application, such as:

    -- The properties that should be configured in the Eureka Client project are configured on the Eureka Server project

    -- Properties that should be written in bootstrap.yml are written in application.yml

    -- Properties that should be written in application.yml are written in bootstrap.yml

5.2 Troubleshooting environmental problems

    If it is confirmed that the configuration is correct, you can consider whether there is a problem with the operating environment.

    · Environment variables

    For example, Java environment variables, Maven environment variables, and Docker container environment variables, etc. When the application does not work properly, you should make sure that the environment variable is configured.

    · Depends on whether the download is complete

    When I brought some new recruits, they encountered the problem that the application could not start properly, and finally found that it was only caused by the incomplete download of the dependencies. Therefore, it is recommended to use the following command to package before starting the application to confirm the integrity of dependencies.

mvn clean package

     · Internet problem

    Communication between microservices is maintained through the network, so the network is often the key to troubleshooting. When problems occur, network problems can be prioritized.

5.3 Troubleshoot code issues

    If after the above steps, the problem of Spring Cloud is still not located, then there may be a problem with the code written. In many cases, various exceptions are often caused by missing an annotation or missing dependencies.

    Therefore, a reasonable log level will have a miraculous effect on locating the problem.

5.4 Troubleshoot Spring Cloud itself

    If you are sure that it is not your own code problem, you can debug the Spring Cloud code. At the same time, you can submit an Issue to the Spring Cloud project team on GitHub and other platforms, and then refer to the official documentation to reply to try to avoid the corresponding problem. If the problem cannot be avoided, Spring Cloud needs to be extended, or the bug of Spring Cloud needs to be fixed to meet the demand. At this point, please don't forget to pull Request on Spring Cloud's GitHub to help the official improve Spring Cloud and make Spring Cloud more complete and stable.

 

    Tips: Reference resources (in these places, there are official personnel involved, which can help us solve problems quickly)

    1) Each project's own GitHub, such as Eureka's GitHub:  http://github.com/Netflix/eureka

    2) GitHub of Spring Cloud corresponding projects, such as Eureka project in Spring Cloud Netflix: http://github.com/spring-cloud/spring-cloud-netflix

    3)Spring Cloud 的 StackOverflow : http://stackoverflow.com/questions/tagged/spring-cloud

    4)Spring Cloud 的 Gitter : http://gitter.im/spring-cloud/spring-cloud

    5) Spring Cloud Chinese Community: http://springcloud.cn

 

 

· For "Eureka Frequently Asked Questions", you can refer to my previous article "Microservice Development Architecture - Spring Cloud Common Problems and Summary <1> Eureka Common Problems": https://my.oschina.net/u/3375733/blog /1555725  ;

· Regarding "The first request fails after Hystrix/Feign integrates Hystrix", please refer to my previous article "Microservice Development Architecture - Spring Cloud Common Problems and Summary <2> The first request fails after Hystrix/Feign integrates Hystrix": https:/ /my.oschina.net/u/3375733/blog/1558095 ;

· Regarding "Incomplete Turbine Aggregated Data", you can refer to my previous article "Microservice Development Architecture - Spring Cloud Common Problems and Summary <3> Incomplete Turbine Aggregated Data": https://my.oschina.net/u /3375733/blog/1559265 ;

· For "Spring Cloud components configuration properties", you can refer to my previous article "Microservice Development Architecture - Spring Cloud Common Problems and Summary <4> Spring Cloud Components Configuration Properties": https://my.oschina.net /u/3375733/blog/1559677  .

 

This article is an original article by the blogger, please indicate the source for reprinting!

https://my.oschina.net/u/3375733/blog/

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325484646&siteId=291194637