当前位置:网站首页>Sentinel series integrates Nacos and realizes dynamic flow control
Sentinel series integrates Nacos and realizes dynamic flow control
2022-06-13 05:40:00 【codain】
From the flow control in the previous chapter , You can actually see ,Sentinel It is essential to focus only on the definition of resources , It will control the flow of resources , In the last chapter we based on Sentinel Dashboard The console controls the flow of resources , But I don't know if you have found a problem in the process of actual operation , When the service restarts , When I looked back at the console, I found : All the flow control rules have disappeared , In fact, this is because the relevant data is stored in memory , Once the application restarts , The data will be clear , So in order to solve this problem ,Sentinel Dedicated dynamic data source support
at present ,Sentinel Support the expansion of multiple data sources :Consul、ZK wait , Let's focus on integration Nacos Implement dynamic flow control rules , Steps are as follows :
1、 add to Nacos Dependence of data source
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-datasource-nacos</artifactId>
<version>1.7.0</version>
</dependency>2、 Add configuration file
spring: application: name: sentinel-server cloud: sentinel: transport: dashboard: 127.0.0.1:8080 datasource: # Support redis、zk Such as middleware , Which one to use , Below - key Just follow the one - nacos: server-addr: 127.0.0.1:8848 data-id: ${spring.application.name}-nacos group-id: DEFAULT_GROUP data-type: json rule-type: flow
3、 Define an interface
@RestController public class DashController { @GetMapping("/dash") public String dash(){ return "dash"; } }
4、 Get into Nacos Console , Add configuration file
5、 Start project , see Sentinel Dashboard Flow control rule list
This resource name , When the service starts , load nacos The resources just configured , And then call /dynamic Interface , Current limiting will occur json, as follows :
thus , The dynamic current limiting rule is completed
边栏推荐
- Vagrant virtual machine installation, disk expansion and LAN access tutorial
- 2021.9.30学习日志-postman
- C calls the API and parses the returned JSON string
- 行情绘图课程大纲1-基础知识
- Case - count the number of occurrences of each string in the string
- About Evaluation Metrics
- Case - traversing the directory (file class & recursive call)
- MySQL log management and master-slave replication
- [thread / multithread] execution sequence of threads
- Implementation of concurrent programming locking
猜你喜欢

MySQL built-in functions

Use of natural sorting comparable

Float type value range

Mongodb multi field aggregation group by

MySQL performs an inner join on query. The query result is incorrect because the associated fields have different field types.

Case - random numbers without repetition (HashSet and TreeSet)

1 Introduction to drools rule engine (usage scenarios and advantages)

KVM virtualization management tool

Automatic database backup (using Navicat)

行情绘图课程大纲1-基础知识
随机推荐
Celery understands
NVIDIA Jetson Nano/Xavier NX 扩容教程
Hainan University Postgraduate Entrance Examination electronic information (085400) landing experience
Basic operations of MySQL auto correlation query
OpenGL mosaic (VIII)
Windbos common CMD (DOS) command set
Solution to prompt "permission is required to perform this operation" (file cannot be deleted) when win10 deletes a file
@Detailed explanation of propertysource usage method and operation principle mechanism
System performance monitoring system
Use of mongodb
The problem of flex layout adaptive failure
One of PowerShell optimizations: prompt beautification
Bicolor case
Case -- the HashSet set stores the student object and traverses
安装harbor(在线|离线)
Agile conflicts and benefits
Solutions to conflicts between xampp and VMware port 443
Mysql database backup and restore:
KVM hot migration for KVM virtual management
MongoDB 多字段聚合Group by


