当前位置:网站首页>【微服务|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);
}
边栏推荐
- 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
- Xcode预览(Preview)显示List视图内容的一个Bug及解决
- D does not require opapply() as a domain
- 无人驾驶: 对多传感器融合的一些思考
- Dry and wet contacts
- Human body transformation vs digital Avatar
- Ansible及playbook的相关操作
- Tiktok wallpaper applet source code
- Use coordinatorlayout+appbarlayout+collapsingtoolbarlayout to create a collapsed status bar
- Hyperledger Fabric 2. X dynamic update smart contract
猜你喜欢
Fuxin Kunpeng joins in, and dragon lizard community welcomes a new partner in format document technical service

【面试题】什么是事务,什么是脏读、不可重复读、幻读,以及MySQL的几种事务隔离级别的应对方法

无人驾驶: 对多传感器融合的一些思考
More pictures | explain the Nacos parameters in detail!
WordPress add photo album function [advanced custom fields Pro custom fields plug-in series tutorial]

OTT营销之风正盛,商家到底该怎么投?

I suddenly find that the request dependent package in NPM has been discarded. What should I do?
Modstart: embrace new technologies and take the lead in supporting laravel 9.0

传输层 以字节为单位的滑动窗口技术

Design scheme of authority management of fusion model
随机推荐
在企业级开发过程中我发现有位同事用select * from where 条件 for update
Analysis report on development mode and investment direction of sodium lauriminodipropionate in the world and China 2022 ~ 2028
Wx applet jump page
Unimportant tokens can be stopped in advance! NVIDIA proposes an efficient visual transformer network a-vit with adaptive token to improve the throughput of the model
Dynamic effect of canvas lines
The third generation of power electronics semiconductors: SiC MOSFET learning notes (V) research on driving power supply
不重要的token可以提前停止计算!英伟达提出自适应token的高效视觉Transformer网络A-ViT,提高模型的吞吐量!...
Global and Chinese tetrahydrofurfuryl butyrate industry operation pattern and future prospect report 2022 ~ 2028
技术分享| WVP+ZLMediaKit实现摄像头GB28181推流播放
Analysis report on operation trend and investment strategy of global and Chinese tetrahydrofurfuryl propionate industry from 2022 to 2028
Basic summary of MySQL database knowledge
Time unified system
How to quickly open traffic master for wechat applet
D manual destruction may violate memory security
Common redis commands in Linux system
The drawableleft of the custom textview in kotlin is displayed in the center together with the text
[leaderboard] Carla leaderboard leaderboard leaderboard operation and participation in hands-on teaching
Go crawler framework -colly actual combat (IV) -- Zhihu answer crawl (I)
@mysql
Qiniu cloud uploads video to get the first frame of video