Spring Cloud Alibaba learning (2) fuse

Sentinel console

Sentinel console provides a lightweight console that provides discovery machine, stand-alone real-time monitoring of resources, cluster resources summary, as well as the rules of management. You simply need to configure applications, you can use these features.

Note: Cluster resource summary table below supports only 500 Application Clusters, there are about 1--2 seconds delay.

Download and packaged

Download Source

git clone https://github.com/alibaba/Sentinel.git

Compiler package

mvn clean package

Start the Console

Sentinel console is a standard SpringBoot applications to SpringBoot the jar package to run.

cd sentinel-dashboard\target
java -Dserver.port=8080 -Dcsp.sentinel.dashboard.server=localhost:8080 -Dproject.name=sentinel-dashboard -jar sentinel-dashboard.jar

Should the 8080 conflict, use -Dserver.port = new port to be set.

Access Services

Open a browser to access: HTTP: // localhost: 8080 / # / Dashboard / Home

Configuration Console Information

application.yml configuration file to add the following configuration:

spring:
  cloud:
    sentinel:
      transport:
        port: 8719
        dashboard: localhost:8080

Here spring.cloud.sentinel.transport.port port configuration starts a Http Server application on the corresponding machine, the Server Sentinel will do interact with the console. For example, Sentinel console adds a limiting rule, the rule will push data to the receiving Http Server, Http Server rules and then registered to the Sentinel.

Testing Sentinel

application.yml complete configuration is as follows:

spring:
  application:
    name: nacos-consumer-feign
  cloud:
    nacos:
      discovery:
        server-addr: 127.0.0.1:8848
    sentinel:
      transport:
        port: 8720
        dashboard: localhost:8080

server:
  port: 7001

feign:
  sentinel:
    enabled: true

Guess you like

Origin www.cnblogs.com/faramita/p/11351713.html