Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
trainyao authored and yaochangyu committed Nov 2, 2020
1 parent 4d001be commit c5556ea
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 79 deletions.
167 changes: 88 additions & 79 deletions reports/0.18.0.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# v0.18.0

## 新增 MOSN 配置工具,提升用户配置体验

### 克隆 [mosn/configure](https://github.com/mosn/configure) 项目并安装依赖

```log
➜ mosn.io git:(master) ✗ cd ~/go/src/mosn.io && git clone https://github.com/mosn/configure.git && \
cd configure && npm install && npm run dev
```

### 自定义页面上的配置, 然后点击浏览器页面的 `Generate JSON` 按钮, 下方即生成 MOSN 的配置 json 内容

![mosn/configure.jpg](./assets/v0.18.0/mosn_configure.png)

## 使用内存池减少了 TLS 连接的内存占用

### benchmark
Expand Down Expand Up @@ -75,7 +88,7 @@ ConnOutbufWithPool-8 6.00 ± 0% 2.00 ± 0% -66.67% (p=0.000 n=10+10)
"servers":[
{
"default_log_path":"stdout",
"default_log_level": "ERROR",
"default_log_level": "WARN",
"routers":[
{
"router_config_name":"server_router",
Expand Down Expand Up @@ -108,6 +121,23 @@ ConnOutbufWithPool-8 6.00 ± 0% 2.00 ± 0% -66.67% (p=0.000 n=10+10)
}
]
}]
},
{
"name":"serverListener_no_bind",
"address": "127.0.0.1:9090",
"bind_port": false,
"filter_chains": [{
"filters": [
{
"type": "proxy",
"config": {
"downstream_protocol": "Http1",
"upstream_protocol": "Http1",
"router_config_name":"server_router"
}
}
]
}]
}
]
}
Expand Down Expand Up @@ -141,97 +171,76 @@ ConnOutbufWithPool-8 6.00 ± 0% 2.00 ± 0% -66.67% (p=0.000 n=10+10)

```log
➜ main git:(master) ✗ cd ~/go/src/mosn.io/mosn/cmd/mosn/main && go build -mod=vendor -o mosn && ./mosn -config config.json
2020-11-02 16:16:22,115 [INFO] [router] [Extend] [RegisterRouterRule] order is 1
2020-11-02 16:16:22,115 [INFO] [router] [Extend] [RegisterHandlerChain] order is 1
2020-11-02 16:16:22,116 [INFO] [config] processor added to configParsedCBMaps
2020-11-02 16:16:22,119 [INFO] [network] [ register pool factory] register protocol: Http1 factory
2020-11-02 16:16:22,119 [INFO] [network] [ register pool factory] register protocol: Http2 factory
2020-11-02 16:16:22,119 [INFO] [network] [ register pool factory] register protocol: X factory
2020-11-02 16:16:22,121 [INFO] load config from : config.json
2020-11-02 16:16:22,122 [INFO] [mosn] [start] xds service type must be sidecar or router
2020-11-02 16:16:22,122 [INFO] [mosn] [init tracing] disable tracing
2020-11-02 16:16:22,122 [INFO] [server] [reconfigure] not reconfigure: dial unix /home/trainyao/go/src/mosn.io/mosn/cmd/mosn/main/reconfig.sock: connect: no such file or directory
2020-11-02 16:16:22,122 [INFO] [mosn] [NewMosn] new mosn created
2020-11-02 16:16:22,122 [INFO] [cluster] [cluster manager] [AddOrUpdatePrimaryCluster] cluster serverCluster updated
2020-11-02 16:16:22,122 [INFO] [upstream] [host set] update host, final host total: 1
2020-11-02 16:16:22,122 [INFO] [cluster] [primaryCluster] [UpdateHosts] cluster serverCluster update hosts: 1
2020-11-02 16:16:22,122 [INFO] mosn start xds client
2020-11-02 16:16:22,122 [WARN] [feature gate] feature XdsMtlsEnable is not enabled
2020-11-02 16:16:22,122 [WARN] [feature gate] feature PayLoadLimitEnable is not enabled
2020-11-02 16:16:22,122 [WARN] [feature gate] feature MultiTenantMode is not enabled
2020-11-02 16:16:22,122 [WARN] [feature gate] feature auto_config is not enabled
2020-11-02 16:16:22,122 [INFO] mosn parse extend config
2020-11-02 16:16:22,122 [INFO] mosn prepare for start
2020-11-02 16:16:22,122 [ERROR] StaticResources is null
2020-11-02 16:16:22,122 [INFO] mosn start server
2020-11-02 16:16:22,122 [INFO] [admin store] [start service] start service Mosn Admin Server on [::]:34902
```

### `config.json` listeners 添加一个 `bind_port` = `false` 的 listener, 名为 `serverListener2`, 监听 `2047` 端口

```json
{
"name":"serverListener2",
"address": "127.0.0.1:2047",
"bind_port": false,
"filter_chains": [{
"filters": [
{
"type": "proxy",
"config": {
"downstream_protocol": "Http1",
"upstream_protocol": "Http1",
"router_config_name":"server_router"
}
}
]
}]
}
2020-11-02 19:53:57,585 [INFO] [router] [Extend] [RegisterRouterRule] order is 1
2020-11-02 19:53:57,585 [INFO] [router] [Extend] [RegisterHandlerChain] order is 1
2020-11-02 19:53:57,585 [INFO] [config] processor added to configParsedCBMaps
2020-11-02 19:53:57,599 [INFO] [network] [ register pool factory] register protocol: Http1 factory
2020-11-02 19:53:57,599 [INFO] [network] [ register pool factory] register protocol: Http2 factory
2020-11-02 19:53:57,599 [INFO] [network] [ register pool factory] register protocol: X factory
2020-11-02 19:53:57,601 [INFO] load config from : config.json
2020-11-02 19:53:57,601 [INFO] [mosn] [start] xds service type must be sidecar or router
2020-11-02 19:53:57,601 [INFO] [mosn] [init tracing] disable tracing
2020-11-02 19:53:57,601 [INFO] [server] [reconfigure] not reconfigure: dial unix /home/trainyao/go/src/mosn.io/mosn/cmd/mosn/main/reconfig.sock: connect: no such file or directory
2020-11-02 19:53:57,601 [INFO] [mosn] [NewMosn] new mosn created
2020-11-02 19:53:57,602 [INFO] [cluster] [cluster manager] [AddOrUpdatePrimaryCluster] cluster serverCluster updated
2020-11-02 19:53:57,602 [INFO] [upstream] [host set] update host, final host total: 1
2020-11-02 19:53:57,602 [INFO] [cluster] [primaryCluster] [UpdateHosts] cluster serverCluster update hosts: 1
2020-11-02 19:53:57,602 [INFO] mosn start xds client
2020-11-02 19:53:57,602 [WARN] [feature gate] feature XdsMtlsEnable is not enabled
2020-11-02 19:53:57,602 [WARN] [feature gate] feature PayLoadLimitEnable is not enabled
2020-11-02 19:53:57,602 [WARN] [feature gate] feature MultiTenantMode is not enabled
2020-11-02 19:53:57,602 [WARN] [feature gate] feature auto_config is not enabled
2020-11-02 19:53:57,602 [INFO] mosn parse extend config
2020-11-02 19:53:57,602 [INFO] mosn prepare for start
2020-11-02 19:53:57,609 [ERROR] StaticResources is null
2020-11-02 19:53:57,609 [WARN] fail to init xds config, skip xds: null point exception
2020-11-02 19:53:57,609 [INFO] mosn start server
2020-11-02 19:53:57,609 [INFO] [admin store] [start service] start service Mosn Admin Server on [::]:34902
```

### 执行新 MOSN reload, 新 MOSN 可以正常重启

```log
➜ main git:(master) ✗ cd ~/go/src/mosn.io/mosn/cmd/mosn/main && ./mosn -config config.json
2020-11-02 16:16:29,574 [INFO] [router] [Extend] [RegisterRouterRule] order is 1
2020-11-02 16:16:29,574 [INFO] [router] [Extend] [RegisterHandlerChain] order is 1
2020-11-02 16:16:29,575 [INFO] [config] processor added to configParsedCBMaps
2020-11-02 16:16:29,578 [INFO] [network] [ register pool factory] register protocol: Http1 factory
2020-11-02 16:16:29,578 [INFO] [network] [ register pool factory] register protocol: Http2 factory
2020-11-02 16:16:29,578 [INFO] [network] [ register pool factory] register protocol: X factory
2020-11-02 16:16:29,580 [INFO] load config from : config.json
2020-11-02 16:16:29,581 [INFO] [mosn] [start] xds service type must be sidecar or router
2020-11-02 16:16:29,581 [INFO] [mosn] [init tracing] disable tracing
2020-11-02 16:16:29,581 [INFO] [server] Get InheritListeners start
2020-11-02 16:16:30,581 [INFO] [server] Get InheritListeners Accept
2020-11-02 16:16:30,582 [INFO] [mosn] [NewMosn] active reconfiguring
2020-11-02 16:16:30,582 [INFO] [admin store] [mosn state] state changed to 2
2020-11-02 16:16:30,582 [INFO] load config from : /home/trainyao/go/src/mosn.io/mosn/cmd/mosn/main/config.json
2020-11-02 16:16:30,583 [INFO] [cluster] [cluster manager] [AddOrUpdatePrimaryCluster] cluster serverCluster updated
2020-11-02 16:16:30,583 [INFO] [upstream] [host set] update host, final host total: 1
2020-11-02 16:16:30,583 [INFO] [cluster] [primaryCluster] [UpdateHosts] cluster serverCluster update hosts: 1
2020-11-02 16:16:30,584 [INFO] [config] [parse listener] [tcp] inherit listener addr: 127.0.0.1:2046
2020-11-02 16:16:30,584 [INFO] mosn start xds client
2020-11-02 16:16:30,584 [WARN] [feature gate] feature XdsMtlsEnable is not enabled
2020-11-02 16:16:30,584 [WARN] [feature gate] feature PayLoadLimitEnable is not enabled
2020-11-02 16:16:30,584 [WARN] [feature gate] feature MultiTenantMode is not enabled
2020-11-02 16:16:30,584 [WARN] [feature gate] feature auto_config is not enabled
2020-11-02 16:16:30,584 [INFO] mosn parse extend config
2020-11-02 16:16:30,584 [INFO] mosn prepare for start
2020-11-02 16:16:30,585 [INFO] [admin store] [start service] [inheritListener] inherit listener addr: [::]:34902
2020-11-02 16:16:30,585 [INFO] mosn start server
2020-11-02 16:16:30,585 [ERROR] StaticResources is null
2020-11-02 16:16:30,585 [INFO] [admin store] [start service] start service Mosn Admin Server on [::]:34902
2020-11-02 19:58:03,751 [INFO] [router] [Extend] [RegisterRouterRule] order is 1
2020-11-02 19:58:03,751 [INFO] [router] [Extend] [RegisterHandlerChain] order is 1
2020-11-02 19:58:03,751 [INFO] [config] processor added to configParsedCBMaps
2020-11-02 19:58:03,763 [INFO] [network] [ register pool factory] register protocol: Http1 factory
2020-11-02 19:58:03,763 [INFO] [network] [ register pool factory] register protocol: Http2 factory2020-11-02 19:58:03,763 [INFO] [network] [ register pool factory] register protocol: X factory
2020-11-02 19:58:03,767 [INFO] load config from : config.json
2020-11-02 19:58:03,768 [INFO] [mosn] [start] xds service type must be sidecar or router
2020-11-02 19:58:03,768 [INFO] [mosn] [init tracing] disable tracing
2020-11-02 19:58:03,768 [INFO] [server] Get InheritListeners start
2020-11-02 19:58:04,769 [INFO] [server] Get InheritListeners Accept
2020-11-02 19:58:04,769 [INFO] [mosn] [NewMosn] active reconfiguring
2020-11-02 19:58:04,769 [INFO] [admin store] [mosn state] state changed to 2
2020-11-02 19:58:04,769 [INFO] load config from : /home/trainyao/go/src/mosn.io/mosn/cmd/mosn/main/config.json
2020-11-02 19:58:04,769 [INFO] [cluster] [cluster manager] [AddOrUpdatePrimaryCluster] cluster serverCluster updated
2020-11-02 19:58:04,769 [INFO] [upstream] [host set] update host, final host total: 1
2020-11-02 19:58:04,769 [INFO] [cluster] [primaryCluster] [UpdateHosts] cluster serverCluster update hosts: 1
2020-11-02 19:58:04,769 [INFO] [config] [parse listener] [tcp] inherit listener addr: 127.0.0.1:2046
2020-11-02 19:58:04,769 [INFO] mosn start xds client
2020-11-02 19:58:04,769 [WARN] [feature gate] feature auto_config is not enabled
2020-11-02 19:58:04,769 [WARN] [feature gate] feature XdsMtlsEnable is not enabled
2020-11-02 19:58:04,769 [WARN] [feature gate] feature PayLoadLimitEnable is not enabled
2020-11-02 19:58:04,769 [WARN] [feature gate] feature MultiTenantMode is not enabled
2020-11-02 19:58:04,769 [INFO] mosn parse extend config
2020-11-02 19:58:04,769 [INFO] mosn prepare for start
2020-11-02 19:58:04,769 [ERROR] StaticResources is null
2020-11-02 19:58:04,769 [WARN] fail to init xds config, skip xds: null point exception
2020-11-02 19:58:04,769 [INFO] [admin store] [start service] [inheritListener] inherit listener addr: [::]:34902
2020-11-02 19:58:04,769 [INFO] mosn start server
2020-11-02 19:58:04,769 [INFO] [admin store] [start service] start service Mosn Admin Server on [::]:34902
```

### 旧 MOSN 日志

```log
...
...
2020-11-02 16:16:30,585 [WARN] [admin store] [start service] start serve failed : Mosn Admin Server [::]:34902 http: Server closed
2020-11-02 19:58:04,769 [WARN] [admin store] [start service] start serve failed : Mosn Admin Server [::]:34902 http: Server closed
```

### client 日志, client 可以正常访问新 MOSN
Expand Down
Binary file added reports/assets/v0.18.0/mosn_configure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c5556ea

Please sign in to comment.