Skip to content

Commit

Permalink
update document
Browse files Browse the repository at this point in the history
  • Loading branch information
GentleWang1011 committed Dec 16, 2021
1 parent c2228cc commit f0aa042
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion document/docs/config/proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</table>

### route_table配置
下面的json代码大致说明了router_table.json的填写规则,根据具体案例来配置。
下面的json代码大致说明了route_table.json的填写规则,根据具体案例来配置。

>启动注册中心时,只配置默认对外转发地址(default)即可 ;
>在2.1.0版本开始支持HTTP接口配置,2.1.0之前的版本只支持GRPC配置。
Expand Down
4 changes: 2 additions & 2 deletions document/docs/example/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ zk.url=192.168.0.1:2181,192.168.0.2:2181,192.168.0.3:2181
proxy.grpc.intra.port=8879
proxy.grpc.inter.port=9370
```
• guest 的serving-proxy router_table.json配置:
• guest 的serving-proxy route_table.json配置:

由于guest的请求只会向外发送,所以只需要配置出口ip端口就好, 如下代码所示只需要配置default转发规则,则会将所有请求转发至出口ip,而出口ip需要与host端proxy.grpc.inter.port对齐。
```yml
Expand Down Expand Up @@ -59,7 +59,7 @@ zk.url=192.134.0.1:2181,192.134.0.2:2181,192.134.0.3:2181
proxy.grpc.intra.port=8879
proxy.grpc.inter.port=9370
```
• host 的serving-proxy router_table.json配置:
• host 的serving-proxy route_table.json配置:
```yml
xxxxxxxxxx
{
Expand Down
4 changes: 2 additions & 2 deletions document/docs/quickstart/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ export PATH=$PATH:$JAVA_HOME/bin

### serving-proxy部署
1.根据需求修改部署目录下 conf/application.properties文件,具体配置项解释见配置文件详解[proxy.md](../config/proxy.md)中application.properties配置。
2.配置router_table.json ,具体配置项解释见文件详解[proxy.md](../config/proxy.md)中route_table配置。
>对router_table.json的修改是定时刷新生效,可以不需要重启serving-proxy;配置本身为json格式,修改时需要注意是否满足json格式。
2.配置route_table.json ,具体配置项解释见文件详解[proxy.md](../config/proxy.md)中route_table配置。
>对route_table.json的修改是定时刷新生效,可以不需要重启serving-proxy;配置本身为json格式,修改时需要注意是否满足json格式。
3.sh service.sh restart (或 ./service.sh restart) 启动应用(windows 脚本暂时不支持,如有需要可自行编写)
有可能出现的问题:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.webank.ai.fate.serving.common.health;

public enum HealthCheckItemEnum {
CHECK_ROUTER_FILE("check router_table.json exist",HealthCheckComponent.SERVINGPROXY),
CHECK_ROUTER_FILE("check route_table.json exist",HealthCheckComponent.SERVINGPROXY),
CHECK_ZOOKEEPER_CONFIG("check zk config",HealthCheckComponent.ALL),
CHECK_ROUTER_NET("check router",HealthCheckComponent.SERVINGPROXY),
CHECK_MEMORY_USAGE("check memory usage",HealthCheckComponent.ALL),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static JsonObject initRouter() {
// long now = new Date().getTime();
// JsonObject routerJson = loadRoutTable();
// if (routerJson == null) {
// throw new RouterInfoOperateException("router_table.json not exists");
// throw new RouterInfoOperateException("route_table.json not exists");
// }
// JsonObject route_table = routerJson.getAsJsonObject("route_table");
// if (route_table == null) {
Expand Down Expand Up @@ -126,8 +126,8 @@ public static JsonObject initRouter() {
// }
// routerJson.add("route_table", route_table);
// if (writeRouterFile(JsonUtil.formatJson(routerJson.toString()))) {
// logger.error("write router_table.json error");
// throw new RouterInfoOperateException("write router_table.json error");
// logger.error("write route_table.json error");
// throw new RouterInfoOperateException("write route_table.json error");
// }
// } catch (RouterInfoOperateException routerEx) {
// throw new RouterInfoOperateException(routerEx.getMessage());
Expand All @@ -141,7 +141,7 @@ public static JsonObject initRouter() {
// try {
// JsonObject routerJson = loadRoutTable();
// if (routerJson == null) {
// throw new RouterInfoOperateException("router_table.json not exists");
// throw new RouterInfoOperateException("route_table.json not exists");
// }
// JsonObject route_table = routerJson.getAsJsonObject("route_table");
// if (route_table == null) {
Expand All @@ -167,8 +167,8 @@ public static JsonObject initRouter() {
// partyIdRouter.add(routerInfo.getServerType(), serverTypeArray);
// }
// if (writeRouterFile(JsonUtil.formatJson(routerJson.toString()))) {
// logger.error("write router_table.json error");
// throw new RouterInfoOperateException("write router_table.json error");
// logger.error("write route_table.json error");
// throw new RouterInfoOperateException("write route_table.json error");
// }
// } catch (RouterInfoOperateException routerEx) {
// throw new RouterInfoOperateException(routerEx.getMessage());
Expand All @@ -182,7 +182,7 @@ public static JsonObject initRouter() {
// try {
// JsonObject routerJson = loadRoutTable();
// if (routerJson == null) {
// throw new RouterInfoOperateException("router_table.json not exists");
// throw new RouterInfoOperateException("route_table.json not exists");
// }
// JsonObject route_table = routerJson.getAsJsonObject("route_table");
// if (route_table == null) {
Expand All @@ -193,8 +193,8 @@ public static JsonObject initRouter() {
// if (StringUtils.isBlank(routerInfo.getServerType())) {
// route_table.remove(routerInfo.getPartyId());
// if (writeRouterFile(JsonUtil.formatJson(routerJson.toString()))) {
// logger.error("write router_table.json error");
// throw new RouterInfoOperateException("write router_table.json error");
// logger.error("write route_table.json error");
// throw new RouterInfoOperateException("write route_table.json error");
// }
// return;
// }
Expand All @@ -216,8 +216,8 @@ public static JsonObject initRouter() {
// }
// routerJson.add("route_table", route_table);
// if (writeRouterFile(JsonUtil.formatJson(routerJson.toString()))) {
// logger.error("write router_table.json error");
// throw new RouterInfoOperateException("write router_table.json error");
// logger.error("write route_table.json error");
// throw new RouterInfoOperateException("write route_table.json error");
// }
// } catch (RouterInfoOperateException routerEx) {
// throw new RouterInfoOperateException(routerEx.getMessage());
Expand All @@ -230,17 +230,17 @@ public static JsonObject initRouter() {
public static void saveRouter(String routerInfo){
try {
if (!RouteTableJsonValidator.isJSON(routerInfo)) {
logger.error("validate router_table.json format error");
logger.error("validate route_table.json format error");
}
} catch (Exception e) {
throw new RouterInfoOperateException("validate router_table.json format error:" + e.getMessage());
throw new RouterInfoOperateException("validate route_table.json format error:" + e.getMessage());
}
try {
if (writeRouterFile(JsonUtil.formatJson(routerInfo))) {
logger.error("write router_table.json fail");
logger.error("write route_table.json fail");
}
} catch (Exception e) {
throw new RouterInfoOperateException("router_table.json : " + e.getMessage());
throw new RouterInfoOperateException("route_table.json : " + e.getMessage());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ private void checkRouterInfo(HealthCheckResult healthCheckResult){

healthCheckResult.getRecords().add(new HealthCheckRecord(HealthCheckItemEnum.CHECK_ROUTER_FILE.getItemName(),"check router file : no router info found",HealthCheckStatus.error));

// healthCheckResult.getErrorList().add("check router_table.json "+": no router info found");
// healthCheckResult.getErrorList().add("check route_table.json "+": no router info found");
}else{
healthCheckResult.getRecords().add(new HealthCheckRecord(HealthCheckItemEnum.CHECK_ROUTER_FILE.getItemName(),"check router file : router info is found",HealthCheckStatus.ok));

// healthCheckResult.getOkList().add("check router_table.json "+": router_table.json is found");
// healthCheckResult.getOkList().add("check route_table.json "+": route_table.json is found");
}

routerInfoCheck(healthCheckResult);
Expand Down Expand Up @@ -221,7 +221,7 @@ public HealthCheckResult check(Context context) {
return healthCheckComponent == HealthCheckComponent.ALL || healthCheckComponent == HealthCheckComponent.SERVINGPROXY;
}).forEach((item) -> {
switch (item) {
// CHECK_ROUTER_FILE("check router_table.json exist",HealthCheckComponent.SERVINGPROXY),
// CHECK_ROUTER_FILE("check route_table.json exist",HealthCheckComponent.SERVINGPROXY),
// CHECK_ZOOKEEPER_CONFIG("check zk config",HealthCheckComponent.ALL),
// CHECK_ROUTER_NET("check router",HealthCheckComponent.SERVINGPROXY),
// CHECK_MEMORY_USAGE("check memory usage",HealthCheckComponent.ALL),
Expand Down

0 comments on commit f0aa042

Please sign in to comment.