Skip to content

Commit

Permalink
修改文章中的联系方式
Browse files Browse the repository at this point in the history
  • Loading branch information
all4you committed Feb 14, 2019
2 parents a5ab1b3 + 5029fb1 commit f186a1c
Show file tree
Hide file tree
Showing 58 changed files with 1,293 additions and 154 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
- [Sentinel原理:调用链](sentinel-principle/sentinel-slot-chain/sentinel-slot-chain.md)
- [Sentinel原理:滑动窗口](sentinel-principle/sentinel-slide-window/sentinel-slide-window.md)
- [Sentinel原理:扩展点](sentinel-principle/sentinel-extension-points/sentinel-extension-points.md)
- [Sentinel原理:控制台是如何获取实时数据的](sentinel-principle/sentinel-dashboard-transport/sentinel-dashboard-transport.md)
- 未完待续。。


Expand All @@ -27,6 +28,7 @@
- [Sentinel实战:使用控制台管理规则](sentinel-practice/sentinel-manage-rule-with-dashboard/sentinel-manage-rule-with-dashboard.md)
- [Sentinel实战:规则持久化的5种方式](sentinel-practice/sentinel-persistence-rules/sentinel-persistence-rules.md)
- [Sentinel实战:在集群中实现流控](sentinel-practice/sentinel-cluster-flow-control/sentinel-cluster-flow-control.md)
- [Sentinel实战:集群限流环境搭建(详细图文描述)](sentinel-practice/sentinel-cluster-flow-control/sentinel-cluster-flow-environment-build.md)
- [Sentinel实战:如何对热点参数限流](sentinel-practice/sentinel-frequent-param-flow-control/sentinel-frequent-param-flow-control.md)
- 未完待续。。

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 7 additions & 16 deletions sentinel-practice/sentinel-cluster-flow-control/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,15 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>sentinel-cluster-flow-control</artifactId>
<packaging>pom</packaging>
<version>1.0.0-SNAPSHOT</version>

<properties>
<spring-boot-version>1.5.17.RELEASE</spring-boot-version>
<sentinel-version>1.4.0</sentinel-version>
</properties>
<modules>
<module>sentinel-cluster-server-alone</module>
<module>sentinel-cluster-client-1</module>
<module>sentinel-cluster-client-2</module>
</modules>


<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot-version}</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<mxfile modified="2019-01-13T13:45:55.982Z" host="www.draw.io" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/9.3.1 Chrome/66.0.3359.181 Electron/3.0.6 Safari/537.36" etag="eeetiHvFRpbpvqQMgJGt" version="10.0.34" type="device"><diagram id="E2slolmBda3K2eMiNaJM" name="第 1 页">7V1bc6O4Ev41fkwKXbg95uLseThbNVVTdXb3kdjEZsYxPphMkvn1K2KELQmQfBES4DykbBnL0N361Or+1Jqgh9ePP7Jos/wzncerCXTmHxP0OIEwdB3yv2j43DV4GO8aFlky3zU5+4bvye941who61syj7dl264pT9NVnmzYxlm6XseznGmLsix9Zy97SVdzpmETLWLmNoqG77NoFQuX/ZXM8+WuNYD+vv0/cbJY0l8GXrj75DWiF5cdb5fRPH0/aELTCXrI0jT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vLQxSxz3jYOrHwKLzVW+YaPpiPUu3GkXJ+FYp5Pp1yF0eE6gnp2fHCwRKefxgKlHuCez+/Ak4LmsmsyXIec44xMp9cAlU3/82ugyfExJ9uxZtgaVWFJig3QWqZDZ7KpKsKSJBuABvdxSaAbc8wIC6B7OPu6oGUMZFrfY4zQbTcHGdQcizVIRpuqImyBbqSwHjUE3S5XigEBUVjdwgtSWKL0BLpRw/Znc7IVVzQjge4mVdgC3UhcDw2S2aaqCGug20QdqcBngolVaJGPFmopCHNEJFH1TKFytW8qkog5VhgIuC6Uc7IB1xHiOrrYoUKQ/R0fcpasIzaIOqRxKh1bqDoM7DJ1o0FzRONq5xI8q3MKK79QD/8Ah2zGlYafNJu6CQrf4FAdGS0IxltoVbjiaFN3OVOHekzdc9ixWSaANFu6uR2wsqWnxxXTMh81rDk2WRBWX5aelm2CrUo+jq8aVJMqbFl6YjE6NcxqUIqKsGXpiRUCYVd/XOqkhCadFOxgjlIIeEda1U3xAnjLT5h6KrrvCY4n+ibkbZam+eHlZCgv/0zncXHFvw==</diagram></mxfile>
<mxfile modified="2019-01-27T07:11:39.449Z" host="www.draw.io" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/8.8.0 Chrome/61.0.3163.100 Electron/2.0.2 Safari/537.36" etag="G5T6XITC1pHONfepQ0ND" version="10.1.4" type="device"><diagram id="E2slolmBda3K2eMiNaJM" name="第 1 页">7V1bd+I4Ev41PCbHuvj2mGvPw845s9N7dnYeHXASpgmmDekk/evXbiyDSjKWbcmWTfqhTzBgoKr0qeqri2bk5uX9Sxptnn9PFvFqhp3F+4zczjAOXSf7P7/wsb/guf7+wlO6XOwvOYcLX5c/4/1FxK6+Lhfxtri2v7RLktVuueEvzpP1Op7vuGtRmiZv/Msek9WCu7CJnmLua+QXvs6jVSy87K/lYve8vxpg/3D9t3j59Mw+GXnh/pmXiL24uPH2OVokb0eXyN2M3KRJstv/9fJ+E69y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n8kUgEjkl7MGQs4LhOQt8rIhaDviIHRBb2DWPQP6rdBdDVeEZGgzPLIcpTOGYsJbOGXYhR2wKo0BHL+0DpEQS8xOkqpZzvyBVDl0EXpyRSXXyX218aNT9veddk+PItgWT1wwQqzhy8+6dMm4OyuMh4JMhNqqzcVDrghs54EaacBNj8DlE7yQE+dIQyewM5DbJehufBR76dXhICGjFuGBDBjvaJ2Dz+otpRf62GxjKIK+nmLaEXYtAb1AqDwOswnAYl7qzCObhhcQM6DGKpQzCeyDyqMhnH0DvLN3CsA4GjbmFSGCMe0trMGrabrcQzRo4heZxkKjiYMXO2pfzB7i9tmlc5IIbGUrkCp8T9hA0U5Hc2WRmnd3rYZXMv50D8tHTrF0GfAS0qzB8spezUxkhahDXFH0/DtfqPL/hgl08CrzDgFxp7fd5cPCrGbcPeRBWuSmBhuBOTGScHdxVRCcl3BGYWb8I9WzIIDPco5dnvMdVQMPj7G478q8ODy3CPW9I3CNgOipq6eZRMBy1ZEl050aQf/p7gDFEmgceyG1CdBfOiQKkFQZcQqID98RultsD4vWf7uhezzKiyHZQxCvnP5eeXtuDNXzeBSOBoXnQYOtnfXyqEIj9PnojRSrorDDwdBrEuUQOAhut9SBorEujI4Vnd8WypwqCFbzJMGmO1tN9QDld2VukfZAVv3rcPqJdMc/3GO/mz2KGI/+kzNrPMvNBa/s5zBXEEAekPiC3bA4dXTEDph8dWxGB00DHQZPAFIPcLQU93spJYI+HR1O9HPBkkrCHwheWb/mEx5NLo7bpwxw8wq6kMq/RBR6zh2mS7I5fnkab59+TRZy/4v8=</diagram></mxfile>
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>sentinel-cluster-flow-control</artifactId>
<groupId>com.lememo</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<artifactId>sentinel-cluster-client-1</artifactId>
<version>1.0.0-SNAPSHOT</version>

<properties>
<spring-boot-version>1.5.17.RELEASE</spring-boot-version>
<sentinel-version>1.4.1</sentinel-version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<version>${spring-boot-version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>${spring-boot-version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-transport-simple-http</artifactId>
<version>${sentinel-version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-cluster-client-default</artifactId>
<version>${sentinel-version}</version>
</dependency>
<dependency>
<groupId>com.alibaba.csp</groupId>
<artifactId>sentinel-datasource-nacos</artifactId>
<version>${sentinel-version}</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.9.1</version>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.lememo.sentinel.clusterclient;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
* 启动时加参数:
* -Dproject.name=xxx -Dcsp.sentinel.dashboard.server=consoleIp:port
* 可以在对应的 sentinel 的 dashboard 中查看效果
* @author houyi
* @date 2019-01-19
*/
@SpringBootApplication(scanBasePackages = {"com.lememo.sentinel"})
public class ClusterFlowClientApplication {
public static void main(String[] args) {
SpringApplication.run(ClusterFlowClientApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
package com.lememo.sentinel.clusterclient;

import com.alibaba.csp.sentinel.Entry;
import com.alibaba.csp.sentinel.EntryType;
import com.alibaba.csp.sentinel.SphU;
import com.alibaba.csp.sentinel.cluster.client.config.ClusterClientAssignConfig;
import com.alibaba.csp.sentinel.cluster.client.config.ClusterClientConfig;
import com.alibaba.csp.sentinel.cluster.client.config.ClusterClientConfigManager;
import com.alibaba.csp.sentinel.datasource.ReadableDataSource;
import com.alibaba.csp.sentinel.datasource.nacos.NacosDataSource;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.flow.FlowRule;
import com.alibaba.csp.sentinel.slots.block.flow.FlowRuleManager;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
* @author houyi.wh
* @since 2019-01-01
*/
@Controller
public class ClusterFlowClientController {

private static String RESOURCE_NAME = "cluster-resource";

private static final String APP_NAME = "appA";

private static final String REMOTE_ADDRESS = "localhost";
private static final String GROUP_ID = "SENTINEL_GROUP";

private static final String FLOW_POSTFIX = "-flow-rules";

private static final String CLUSTER_SERVER_HOST = "localhost";
private static final int CLUSTER_SERVER_PORT = 11111;
private static final int REQUEST_TIME_OUT = 200;

public ClusterFlowClientController(){
loadClusterClientConfig();
registerClusterClientProperty();
registerClusterFlowRuleProperty();
}

/**
* 加载集群客户端配置
* 主要是集群服务端的相关连接信息
*/
private void loadClusterClientConfig(){
ClusterClientAssignConfig assignConfig = new ClusterClientAssignConfig();
assignConfig.setServerHost(CLUSTER_SERVER_HOST);
assignConfig.setServerPort(CLUSTER_SERVER_PORT);
ClusterClientConfigManager.applyNewAssignConfig(assignConfig);

ClusterClientConfig clientConfig = new ClusterClientConfig();
clientConfig.setRequestTimeout(REQUEST_TIME_OUT);
ClusterClientConfigManager.applyNewConfig(clientConfig);
}

/**
* 为ClusterClientConfig注册一个SentinelProperty
* 这样的话可以动态的更改这些配置
*/
private void registerClusterClientProperty() {
String clientConfigDataId = "cluster-client-config";
// 初始化一个配置ClusterClientConfig的 Nacos 数据源
ReadableDataSource<String, ClusterClientConfig> clientConfigDS = new NacosDataSource<>(REMOTE_ADDRESS, GROUP_ID, clientConfigDataId,
source -> JSON.parseObject(source, new TypeReference<ClusterClientConfig>() {}));
ClusterClientConfigManager.registerClientConfigProperty(clientConfigDS.getProperty());

String clientAssignConfigDataId = "cluster-client-assign-config";
// 初始化一个配置ClusterClientAssignConfig的 Nacos 数据源
ReadableDataSource<String, ClusterClientAssignConfig> clientAssignConfigDS = new NacosDataSource<>(REMOTE_ADDRESS, GROUP_ID, clientAssignConfigDataId,
source -> JSON.parseObject(source, new TypeReference<ClusterClientAssignConfig>() {}));
ClusterClientConfigManager.registerServerAssignProperty(clientAssignConfigDS.getProperty());
}

/**
* 注册动态规则Property
* 当client与Server连接中断,退化为本地限流时需要用到的该规则
*/
private void registerClusterFlowRuleProperty(){
// 使用 Nacos 数据源作为配置中心,需要在 REMOTE_ADDRESS 上启动一个 Nacos 的服务
ReadableDataSource<String, List<FlowRule>> ds = new NacosDataSource<>(REMOTE_ADDRESS, GROUP_ID, APP_NAME+FLOW_POSTFIX,
source -> JSON.parseObject(source, new TypeReference<List<FlowRule>>() {}));
// 为集群客户端注册动态规则源
FlowRuleManager.register2Property(ds.getProperty());
}


/**
* 模拟流量请求该方法
*/
@GetMapping("/clusterFlow")
public @ResponseBody
String clusterFlow() {
Entry entry = null;
String retVal;
try{
entry = SphU.entry(RESOURCE_NAME, EntryType.IN,1);
retVal = "passed";
}catch(BlockException e){
retVal = "blocked";
}finally {
if(entry!=null){
entry.exit();
}
}
return retVal;
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
spring.application.name=cluster-client-1
server.port=7001
Loading

0 comments on commit f186a1c

Please sign in to comment.