当前位置:网站首页>[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);
}
边栏推荐
- A plug-in framework for implementing registration free and login verification with hook technology
- Transition from digitalization to intelligent manufacturing
- Use of JMeter easynmon
- Scrollview height cannot fill full screen
- Activity startup process
- Garbage collection of C closure
- Paper review: U2 net, u-net composed of u-net
- 2021-09-12
- A small crawler program written by beginners
- Previous basic review (link)
猜你喜欢
【微服务|Sentinel】Sentinel快速入门|构建镜像|启动控制台
[leaderboard] Carla leaderboard leaderboard leaderboard operation and participation in hands-on teaching
Hyperledger Fabric 2. X dynamic update smart contract
Outer screen and widescreen wasted? Harmonyos folding screen design specification teaches you to use it
Encryption and encoding resolution
Related operations of ansible and Playbook
2021-11-07
Kubernetes 架构核心组件工作原理解析
Practical operation notes - notebook plus memory and ash cleaning
Alternative to log4j
随机推荐
Creative SVG ring clock JS effect
Apk decompiled method (not confused)
Qiniu cloud uploads video to get the first frame of video
热力图展示相关矩阵
Uniapp encapsulated incentive advertisement, screen insert advertisement and banner advertisement
Custom animation (simulated win10 loading animation)
通过kubernetes可视化界面(rancher)安装kibana
A small crawler program written by beginners
Common redis commands in Linux system
A website for programmers with a monthly salary of 30K
A plug-in framework for implementing registration free and login verification with hook technology
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
Input series
【Redis实现秒杀业务②】超卖问题的解决方案
Custom control - round dot progress bar (imitating one key acceleration in security guard)
Several ways for wechat applet to jump to the page are worth collecting
移动安全工具-jarsigner
【Redis实现秒杀业务③】超卖问题之乐观锁具体实现
The acceleration of 100 km is only 5.92 seconds, and the willanda high-performance version leads with the strength of high-energy products
2021-09-12