Skip to content

Commit 5bf0239

Browse files
committed
docs: update articles
1 parent 0a52be9 commit 5bf0239

File tree

5 files changed

+44
-45
lines changed

5 files changed

+44
-45
lines changed

docs/distributed-system/distributed-lock-redis-vs-zookeeper.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ public class ZooKeeperDistributedLock implements Watcher {
272272
// 如果不是最小的节点,找到比自己小1的节点
273273
int previousLockIndex = -1;
274274
for (int i = 0; i < locks.size(); i++) {
275-
if (lockNode.equals(locksRoot + /+locks.get(i))){
275+
if (lockNode.equals(locksRoot + "/" +locks.get(i))){
276276
previousLockIndex = i - 1;
277277
break;
278278
}

docs/high-availability/hystrix-fallback.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Hystrix 出现以下四种情况,都会去调用 fallback 降级机制:
3232
* 品牌名称本地缓存
3333
*
3434
*/
35-
3635
public class BrandCache {
3736

3837
private static Map<Long, String> brandMap = new HashMap<>();

docs/high-availability/hystrix-introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ Hystrix 可以对其进行资源隔离,比如限制服务 B 只有 40 个线
4646
- 避免请求排队和积压,采用限流和 `fail fast` 来控制故障。
4747
- 提供 fallback 降级机制来应对故障。
4848
- 使用资源隔离技术,比如 `bulkhead`(舱壁隔离技术)、`swimlane`(泳道技术)、`circuit breaker`(断路技术)来限制任何一个依赖服务的故障的影响。
49-
- 通过近实时的统计/监控/报警功能,来提高故障发现的速度。
49+
- 通过近实时的统计、监控、报警功能,来提高故障发现的速度。
5050
- 通过近实时的属性和配置**热修改**功能,来提高故障处理和恢复的速度。
5151
- 保护依赖服务调用的所有故障情况,而不仅仅只是网络故障情况。

docs/high-availability/hystrix-thread-pool-current-limiting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,5 @@ ProductInfo(id=null, name=降级商品, price=null, pictureList=null, specificat
165165
ProductInfo(id=null, name=降级商品, price=null, pictureList=null, specification=null, service=null, color=null, size=null, shopId=null, modifiedTime=null, cityId=null, cityName=null, brandId=null, brandName=null)
166166
{"id": -2, "name": "iphone7手机", "price": 5599, "pictureList":"a.jpg,b.jpg", "specification": "iphone7的规格", "service": "iphone7的售后服务", "color": "红色,白色,黑色", "size": "5.5", "shopId": 1, "modifiedTime": "2017-01-01 12:00:00", "cityId": 1, "brandId": 1}
167167
// 后面都是一些正常的商品信息,就不贴出来了
168-
//...
168+
// ...
169169
```

docs/high-concurrency/how-to-limit-current.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -288,25 +288,25 @@ public class TokenBucket {
288288

289289
```yaml
290290
spring:
291-
cloud:
292-
gateway:
293-
routes:
294-
- id: requestratelimiter_route
295-
296-
uri: lb://pigx-upms
297-
order: 10000
298-
predicates:
299-
- Path=/admin/**
300-
301-
filters:
302-
- name: RequestRateLimiter
303-
304-
args:
305-
redis-rate-limiter.replenishRate: 1 # 令牌桶的容积
306-
redis-rate-limiter.burstCapacity: 3 # 流速 每秒
307-
key-resolver: '#{@remoteAddrKeyResolver}' #SPEL表达式去的对应的bean
308-
309-
- StripPrefix=1
291+
cloud:
292+
gateway:
293+
routes:
294+
- id: requestratelimiter_route
295+
296+
uri: lb://pigx-upms
297+
order: 10000
298+
predicates:
299+
- Path=/admin/**
300+
301+
filters:
302+
- name: RequestRateLimiter
303+
304+
args:
305+
redis-rate-limiter.replenishRate: 1 # 令牌桶的容积
306+
redis-rate-limiter.burstCapacity: 3 # 流速 每秒
307+
key-resolver: '#{@remoteAddrKeyResolver}' #SPEL表达式去的对应的bean
308+
309+
- StripPrefix=1
310310
```
311311
312312
```java
@@ -329,35 +329,35 @@ KeyResolver remoteAddrKeyResolver() {
329329

330330
```yaml
331331
spring:
332-
cloud:
333-
nacos:
334-
discovery:
335-
server-addr: localhost:8848
336-
sentinel:
337-
transport:
338-
dashboard: localhost:8080
339-
port: 8720
340-
datasource:
341-
ds:
342-
nacos:
343-
server-addr: localhost:8848
344-
dataId: spring-cloud-sentinel-nacos
345-
groupId: DEFAULT_GROUP
346-
rule-type: flow
347-
namespace: xxxxxxxx
332+
cloud:
333+
nacos:
334+
discovery:
335+
server-addr: localhost:8848
336+
sentinel:
337+
transport:
338+
dashboard: localhost:8080
339+
port: 8720
340+
datasource:
341+
ds:
342+
nacos:
343+
server-addr: localhost:8848
344+
dataId: spring-cloud-sentinel-nacos
345+
groupId: DEFAULT_GROUP
346+
rule-type: flow
347+
namespace: xxxxxxxx
348348
```
349349
350350
- 配置内容在 nacos 上进行编辑
351351
352352
```json
353353
[
354354
{
355-
"resource": "/hello"
356-
"limitApp": "default"
357-
"grade": 1
358-
"count": 1
359-
"strategy": 0
360-
"controlBehavior": 0
355+
"resource": "/hello",
356+
"limitApp": "default",
357+
"grade": 1,
358+
"count": 1,
359+
"strategy": 0,
360+
"controlBehavior": 0,
361361
"clusterMode": false
362362
}
363363
]

0 commit comments

Comments
 (0)