当前位置:网站首页>[microservices sentinel] cluster link | microservices cluster environment construction
[microservices sentinel] cluster link | microservices cluster environment construction
2022-06-25 00:45:00 【Bulst】
List of articles
Cluster link
" Cluster link " The resource just called is shown in ( Stand alone real time ), Cluster link ( Single machine call link ) Page real-time to pull the operation of the specified client resources .
It offers two display modes : A call link that displays resources in a tree structure , The other one does not distinguish between call links to show the operation of resources .
Be careful : Cluster monitoring is memory state information , It only shows the resources that have been invoked after startup .
By default, it is displayed in a tree view

- The list shows all interfaces under the service , Including passage QPS, Reject QPS, Number of threads , Average RT, Minutes pass , Minutes to refuse .
- 172.20.10.3:8721 For the current service ip Address , The port serves sentinel The interactive port of the console , The local service will play a role occupied by this port HttpServer, The Server Will be with sentinel Console interaction , such as sentinel A current limiting rule has been added to the console , Will put the rule data push Here it is HttpServer receive ,HttpServer Then register the rules to Sentinel in .
- You can add flow control to the current resource 、 Downgrade 、 hotspot 、 Authorization and other operations .
List view :
We can see that under the action list , Flow control 、 Downgrade 、 hotspot 、 Authorization and other options .
Next , We will introduce the above functions in detail .
Test environment ( Micro service cluster )
Father pom file
<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>
Code structure list

Producer multi node deployment

producer
/** * producer 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();
}
}
Producer startup class
/** * producer * * @author issa **/
@EnableDiscoveryClient
@SpringBootApplication
public class ProducerApplication {
public static void main(String[] args) {
SpringApplication.run(ProducerApplication.class, args);
}
}
consumer
/** * consumer 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);
}
}
Consumer startup class
/** * consumer * * @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 {
/** * according to ID Query products * * @param id The primary key of the item ID * @return Information about related products */
@GetMapping("/{id}")
String producerById(@PathVariable(value = "id") String id);
}
边栏推荐
- C# 闭包的垃圾回收
- Use of JMeter easynmon
- [interview question] the difference between instancof and getclass()
- adb shell sendevent
- Fuxin Kunpeng joins in, and dragon lizard community welcomes a new partner in format document technical service
- Input series
- Binder mechanism and Aidl communication example
- D omit parameter name
- Tiktok wallpaper applet v1.0.2 function, new arrival function
- Discrete mathematics and its application detailed explanation of exercises in the final exam of spring and summer semester of 2018-2019 academic year
猜你喜欢
Paper review: U2 net, u-net composed of u-net

Kubernetes 架构核心组件工作原理解析
5-minute NLP: summary of 3 pre training libraries for rapid realization of NER

Interesting checkbox counters

C# Winform 最大化遮挡任务栏和全屏显示问题

How to reduce the font size of custom controls (optimize the round dot progress bar)

Go crawler framework -colly actual combat (4) -- Zhihu answer crawl (2) -- visual word cloud

Registration method of native method in JNI

Go crawler framework -colly actual combat (III) -- panoramic cartoon picture capture and download
@mysql
随机推荐
A small program written this week
【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
Design scheme of authority management of fusion model
Basic summary of MySQL database knowledge
Interesting checkbox counters
How to use promise Race() and promise any() ?
Creative SVG ring clock JS effect
Helm chart仓库操作
The acceleration of 100 km is only 5.92 seconds, and the willanda high-performance version leads with the strength of high-energy products
Only positive integers can be entered in the text box
Virtual machine - network configuration
Domain Driven Design and coding
傳輸層 以字節為單比特的滑動窗口技術
C program design topic 18-19 final exam exercise solutions (Part 2)
Scrollview height cannot fill full screen
[Solved] Public key for mysql-community-xxx. rpm is not installed
UE4 WebBrowser chart cannot display problems
VIM use command
ros(25):rqt_ image_ View reports an error unable to load plugin for transport 'compressed', error string
Jar package merging using Apache ant