当前位置:网站首页>【微服务|Sentinel】簇点链路|微服务集群环境搭建
【微服务|Sentinel】簇点链路|微服务集群环境搭建
2022-06-24 20:01:00 【步尔斯特】
簇点链路
"簇点链路"中显示刚刚调用的资源(单机实时),簇点链路(单机调用链路)页面实时的去拉取指定客户端资源的运行情况。
它一共提供两种展示模式:一种用树状结构展示资源的调用链路,另外一种则不区分调用链路展示资源的运行情况。
注意: 簇点监控是内存态的信息,它仅展示启动后调用过的资源。
默认以树状视图展示

- 列表展示了该服务下所有的接口,包括通过QPS,拒接QPS,线程数,平均RT,分钟通过,分钟拒绝。
- 172.20.10.3:8721 为当前的服务ip地址,端口为服务于sentinel控制台的交互的端口,服务本地会起一个该端口占用的HttpServer,该Server会与sentinel控制台做交互,比如sentinel控制台添加了一个限流规则,会把规则数据push给这个HttpServer接收,HttpServer再将规则注册到Sentinel中。
- 可以对当前的资源添加流控、降级、热点、授权等操作。
列表视图:
我们可以看到在操作列表下,有流控、降级、热点、授权等选项。
接下来,我们将对上述功能做详细的介绍。
测试环境(微服务集群)
父pom文件
<spring-cloud.version>Hoxton.SR9</spring-cloud.version>
<spring-boot.version>2.3.2.RELEASE</spring-boot.version>
<spring-cloud-alibaba.version>2.2.6.RELEASE</spring-cloud-alibaba.version>
代码结构一览

生产者多节点部署

生产者
/** * 生产者controller * * @author issa **/
@RefreshScope
@RequestMapping(value = "/producer")
@RestController
public class ProducerController {
@GetMapping("/{id}")
@SentinelResource("test")
public String producerById(@PathVariable(value = "id") String id) {
ProducerVO producerVO = new ProducerVO();
producerVO.setId(id);
producerVO.setPort(UUID.randomUUID().toString());
return producerVO.toString();
}
}
生产者启动类
/** * 生产者 * * @author issa **/
@EnableDiscoveryClient
@SpringBootApplication
public class ProducerApplication {
public static void main(String[] args) {
SpringApplication.run(ProducerApplication.class, args);
}
}
消费者
/** * 消费者controller * * @author issavior **/
@RequestMapping(value = "/consumer")
@RestController
@RefreshScope
public class ConsumerController {
@Autowired
private RestTemplate restTemplate;
@Autowired
private ProducerFeign producerFeign;
@GetMapping("/rest/{id}")
@SentinelResource("rest")
public String restConsumerById(@PathVariable(value = "id") String id) {
return restTemplate.getForObject("http://ossa-service-producer/producer/" + id, String.class);
}
@GetMapping("/feign/{id}")
@SentinelResource("feign")
public String feignConsumerById(@PathVariable(value = "id") String id) {
return producerFeign.producerById(id);
}
}
消费者启动类
/** * 消费者 * * @author issavior */
@EnableFeignClients("com.ossa.common.feignapi")
@EnableDiscoveryClient
@SpringBootApplication
public class ConsumerApplication {
public static void main(String[] args) {
SpringApplication.run(ConsumerApplication.class, args);
}
@LoadBalanced
@Bean
public RestTemplate restTemplate() {
return new RestTemplate();
}
}
feignapi
/** * @author issavior */
@FeignClient(value = "ossa-service-producer")
@RequestMapping(value = "/producer")
public interface ProducerFeign {
/** * 根据ID查询商品 * * @param id 商品的主键ID * @return 相关商品的信息 */
@GetMapping("/{id}")
String producerById(@PathVariable(value = "id") String id);
}
边栏推荐
- Color gradient gradient color collection
- 软件测试与游戏测试文章合集录
- 【排行榜】Carla leaderboard 排行榜 运行与参与手把手教学
- 无人驾驶: 对多传感器融合的一些思考
- 融合模型权限管理设计方案
- JDBC - database connection
- 5G dtu无线通信模块的电力应用
- Go crawler framework -colly actual combat (IV) -- Zhihu answer crawl (I)
- How to delete the entire row with duplicate items in a column of WPS table
- C# Winform 最大化遮挡任务栏和全屏显示问题
猜你喜欢

Unmanned driving: Some Thoughts on multi-sensor fusion

Applet opening traffic master

JDBC - database connection

Collective example

ros(25):rqt_image_view报错Unable to load plugin for transport ‘compressed‘, error string

MySQL log management

Tiktok wallpaper applet source code
Outer screen and widescreen wasted? Harmonyos folding screen design specification teaches you to use it

水库大坝安全监测

Use coordinatorlayout+appbarlayout+collapsingtoolbarlayout to create a collapsed status bar
随机推荐
Outer screen and widescreen wasted? Harmonyos folding screen design specification teaches you to use it
Android SQLite database
Use of JMeter easynmon
Encryption and encoding resolution
【面试题】什么是事务,什么是脏读、不可重复读、幻读,以及MySQL的几种事务隔离级别的应对方法
C program design topic 18-19 final exam exercise solutions (Part 2)
ros(24):error: invalid initialization of reference of type ‘xx’ from expression of type ‘xx’
Meta & Berkeley proposed a universal multi-scale visual transformer based on pooled self attention mechanism. The classification accuracy in Imagenet reached 88.8%! Open source
Common redis commands in Linux system
The third generation of power electronics semiconductors: SiC MOSFET learning notes (V) research on driving power supply
2019 summary and 2020 outlook
wx小程序跳转页面
Apk slimming compression experience
[proteus simulation] example of using timer 0 as a 16 bit counter
5G dtu无线通信模块的电力应用
Analysis report on operation trend and investment strategy of global and Chinese tetrahydrofurfuryl propionate industry from 2022 to 2028
融合模型权限管理设计方案
【面试题】instancof和getClass()的区别
Eliminate duplicate dependencies
Report on operation pattern and future prospect of global and Chinese propyl isovalerate industry from 2022 to 2028