当前位置:网站首页>[microservices sentinel] sentinel quick start | building an image | starting the console

[microservices sentinel] sentinel quick start | building an image | starting the console

2022-06-25 00:45:00 Bulst

brief introduction

Sentinel Distributed oriented 、 Traffic management component of multilingual isomerization service architecture , The main pointcut is traffic , Route from traffic 、 flow control 、 Traffic shaping 、 Fusing the drop 、 System adaptive overload protection 、 Hotspot traffic protection and other dimensions help developers ensure the stability of microservices .

Timeline

2019 year ,Sentinel Explore the direction of multilingual expansion , Introduction C++ Native version , Also aim at Service Mesh The scene also came out Envoy Cluster traffic control support , To solve the problem Service Mesh The problem of multi language flow restriction under the framework .

2021 year ,Sentinel It's heading towards 2.0 Evolution of cloud native high availability decision center components ; At the same time, it launched Sentinel Rust Native version .

2022 year ,Sentinel The brand is upgraded to traffic management , The field covers traffic routing / Dispatch 、 Flow dyeing 、 Flow control degradation 、 Overload protection / Instance removal, etc ; At the same time, the community draws out the relevant standards of flow management to OpenSergo In the standard ,Sentinel Implemented as a traffic governance standard .

Two modules

Sentinel The use of can be divided into two parts :

  1. Console (Dashboard): The console is mainly responsible for managing push rules 、 monitor 、 Cluster current limiting distribution management 、 Machine discovery, etc .

  2. Core library (Java client ): Don't rely on any framework / library , Can run on Java 7 And above , At the same time Dubbo / Spring Cloud And other frameworks also have better support .

Work flow chart

 Insert picture description here

sentinel-dashboard-1.8.1 Mirror image

Dockerfile

FROM java:8
LABEL maintainer="issa <[email protected]>"
ADD sentinel-dashboard-1.8.1.jar app.jar
EXPOSE 80
ENTRYPOINT ["java" ,"-Dserver.port=80","-Dcsp.sentinel.dashboard.server=localhost:80","-Dproject.name=mysentinel","-jar", "app.jar"]

Prerequisite : Need to put sentinel-dashboard-1.8.1.jar Upload to the current directory .

Execute the following command to complete the creation of the image
docker build -t mysentinel:1.8.1 .

function
docker run -d -p 80:80 mysentinel:1.8.1

Console

Sentinel Provide a lightweight open source console , It provides machine discovery and health management 、 monitor ( Stand alone and cluster ), The function of rule management and push .

Sentinel The console contains the following functions :

Check the list of machines and their health : collect Sentinel Heartbeat packets sent by the client , Used to determine if the machine is online .

monitor ( Single machine and cluster aggregation ): adopt Sentinel Monitoring of client exposure API, Pull and aggregate application monitoring information regularly , Finally, it can realize real-time monitoring in seconds .

Rule management and push : Unified management of push rules .

authentication : Authentication is very important in the production environment . Here, each developer needs to customize according to their own actual situation .

Be careful :Sentinel The console currently only supports stand-alone deployment .Sentinel The console project provides Sentinel
Complete set of functions , Not used as a production environment console out of the box , If you want to use it in the production environment, please customize and transform it according to the documents .

sentinel Console access code

rely on

        <dependency>
            <groupId>com.alibaba.cloud</groupId>
            <artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>

The configuration file :

spring:
  cloud:
    sentinel:
      transport:
        dashboard: localhost
#        port: 8719
#        client-ip: localhost
      eager: true
management:
  endpoints:
    web:
      exposure:
        include: '*'

Successful startup

 Insert picture description here

原网站

版权声明
本文为[Bulst]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/176/202206242001480388.html