You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2021/02/19 07:42:20 UTC
[GitHub] [rocketmq] zsmweiwei opened a new pull request #2682: [ISSUE #2680]Add namesrv startup process description
zsmweiwei opened a new pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682
**Make sure set the target branch to `develop`**
## What is the purpose of the change
XXXXX
## Brief changelog
XX
## Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
- [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
- [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test` to make sure integration-test pass.
- [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] duhenglucky commented on pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
duhenglucky commented on pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#issuecomment-1010571191
@zsmweiwei ping
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] duhenglucky commented on pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
duhenglucky commented on pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#issuecomment-1000078429
@zsmweiwei Would you like to modify these docs according to the comments?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] coveralls edited a comment on pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#issuecomment-781909132
[](https://coveralls.io/builds/37291816)
Coverage decreased (-0.09%) to 51.826% when pulling **bc776b7fcafd08d835ff570c5077584fb1302c5d on zsmweiwei:dev_zsm** into **97c77701f863c69d28f5ba253bd80103a63f9fd1 on apache:develop**.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] coveralls commented on pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
coveralls commented on pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#issuecomment-781909132
[](https://coveralls.io/builds/37266564)
Coverage decreased (-0.02%) to 51.898% when pulling **322df8ebabf32a530ac2bed865c79e8e7b072033 on zsmweiwei:dev_zsm** into **97c77701f863c69d28f5ba253bd80103a63f9fd1 on apache:develop**.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] caigy commented on a change in pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
caigy commented on a change in pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#discussion_r725425728
##########
File path: docs/cn/client/java/API_Reference_NamesrvStartup.md
##########
@@ -0,0 +1,80 @@
+##NamesrvStarup
+---
+###类简介
+‘public class NamesrvStartup’
+
+>`NamesrvStartup`类是namesrv启动的入口类,在本地配置好环境变量ROCKETMQ_HOME后可通过执行其中的main方法来快速启动一个namesrv。namesrv主要负责维护活跃broker的信息和topic以及topic所在队列的信息。其中启动参数主要由namesrvConfig和nettyServerConfig这两个类来初始化,这两个类后面讲到,当然这些配置也可以通过启动指定配置文件进行修改。
+
+``` java
+ public static void main(String[] args) {
+ main0(args);
+ }
+
+ public static NamesrvController main0(String[] args) {
+
+ try {
+ //NamesrvController是namesrv接受请求并响应的核心类,
+ NamesrvController controller = createNamesrvController(args);
+ //启动并初始化NamesrvController
+ start(controller);
+ String tip = "The Name Server boot success. serializeType=" + RemotingCommand.getSerializeTypeConfigInThisServer();
+ log.info(tip);
+ System.out.printf("%s%n", tip);
+ return controller;
+ } catch (Throwable e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ return null;
+ }
+```
+
+###namesrv启动过程一:创建NamesrvController
+createNamesrvController中会创建并初始化namesrvConfig和nettyServerConfig的实例
+
+#### namesrvConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|String|rocketmqHome|rocketmq的主目录|
+|String|kvConfigPath|kv配置属性的持久化路径|
+|String|configStorePath|namesrv的配置文件路径,可以使用-c指定|
+|String|productEnvName|环境名|
+|boolean|clusterTest|是否开启集群测试,默认false|
+|boolean|orderMessageEnable|是否支持顺序消息,默认是false|
+
+#### nettyServerConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|int|listenPort|nameServer监听的端口,是8888,后面会被初始化为9876|
+|int|serverWorkerThreads|netty的线程池线程个数|
+|int|serverCallbackExecutorThreads|netty的公共任务(发送,消费,心跳检测)的线程池线程个数|
+|int|serverSelectorThreads|io任务的线程池线程个数|
+|int|serverOnewaySemaphoreValue|发送oneway消息时的请求并发度|
+|int|serverAsyncSemaphoreValue|异步消息最大并发度|
+|int|serverChannelMaxIdleTimeSeconds|网络最大空闲时间|
Review comment:
“网络连接最大空闲时间” may be more appropriate
##########
File path: docs/cn/client/java/API_Reference_NamesrvStartup.md
##########
@@ -0,0 +1,80 @@
+##NamesrvStarup
+---
+###类简介
+‘public class NamesrvStartup’
+
+>`NamesrvStartup`类是namesrv启动的入口类,在本地配置好环境变量ROCKETMQ_HOME后可通过执行其中的main方法来快速启动一个namesrv。namesrv主要负责维护活跃broker的信息和topic以及topic所在队列的信息。其中启动参数主要由namesrvConfig和nettyServerConfig这两个类来初始化,这两个类后面讲到,当然这些配置也可以通过启动指定配置文件进行修改。
+
+``` java
+ public static void main(String[] args) {
+ main0(args);
+ }
+
+ public static NamesrvController main0(String[] args) {
+
+ try {
+ //NamesrvController是namesrv接受请求并响应的核心类,
+ NamesrvController controller = createNamesrvController(args);
+ //启动并初始化NamesrvController
+ start(controller);
+ String tip = "The Name Server boot success. serializeType=" + RemotingCommand.getSerializeTypeConfigInThisServer();
+ log.info(tip);
+ System.out.printf("%s%n", tip);
+ return controller;
+ } catch (Throwable e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ return null;
+ }
+```
+
+###namesrv启动过程一:创建NamesrvController
+createNamesrvController中会创建并初始化namesrvConfig和nettyServerConfig的实例
+
+#### namesrvConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|String|rocketmqHome|rocketmq的主目录|
+|String|kvConfigPath|kv配置属性的持久化路径|
+|String|configStorePath|namesrv的配置文件路径,可以使用-c指定|
+|String|productEnvName|环境名|
+|boolean|clusterTest|是否开启集群测试,默认false|
+|boolean|orderMessageEnable|是否支持顺序消息,默认是false|
+
+#### nettyServerConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|int|listenPort|nameServer监听的端口,是8888,后面会被初始化为9876|
+|int|serverWorkerThreads|netty的线程池线程个数|
+|int|serverCallbackExecutorThreads|netty的公共任务(发送,消费,心跳检测)的线程池线程个数|
Review comment:
Add:“如果RequestCode未注册特定线程池,则由该公共线程池执行”
##########
File path: docs/cn/client/java/API_Reference_NamesrvStartup.md
##########
@@ -0,0 +1,80 @@
+##NamesrvStarup
+---
+###类简介
+‘public class NamesrvStartup’
+
+>`NamesrvStartup`类是namesrv启动的入口类,在本地配置好环境变量ROCKETMQ_HOME后可通过执行其中的main方法来快速启动一个namesrv。namesrv主要负责维护活跃broker的信息和topic以及topic所在队列的信息。其中启动参数主要由namesrvConfig和nettyServerConfig这两个类来初始化,这两个类后面讲到,当然这些配置也可以通过启动指定配置文件进行修改。
+
+``` java
+ public static void main(String[] args) {
+ main0(args);
+ }
+
+ public static NamesrvController main0(String[] args) {
+
+ try {
+ //NamesrvController是namesrv接受请求并响应的核心类,
+ NamesrvController controller = createNamesrvController(args);
+ //启动并初始化NamesrvController
+ start(controller);
+ String tip = "The Name Server boot success. serializeType=" + RemotingCommand.getSerializeTypeConfigInThisServer();
+ log.info(tip);
+ System.out.printf("%s%n", tip);
+ return controller;
+ } catch (Throwable e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ return null;
+ }
+```
+
+###namesrv启动过程一:创建NamesrvController
+createNamesrvController中会创建并初始化namesrvConfig和nettyServerConfig的实例
+
+#### namesrvConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|String|rocketmqHome|rocketmq的主目录|
+|String|kvConfigPath|kv配置属性的持久化路径|
+|String|configStorePath|namesrv的配置文件路径,可以使用-c指定|
+|String|productEnvName|环境名|
+|boolean|clusterTest|是否开启集群测试,默认false|
+|boolean|orderMessageEnable|是否支持顺序消息,默认是false|
+
+#### nettyServerConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|int|listenPort|nameServer监听的端口,是8888,后面会被初始化为9876|
+|int|serverWorkerThreads|netty的线程池线程个数|
Review comment:
netty用于处理nameserver业务逻辑的的线程数
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] lizhiboo commented on a change in pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
lizhiboo commented on a change in pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#discussion_r579160093
##########
File path: docs/cn/client/java/API_Reference_NamesrvStartup.md
##########
@@ -0,0 +1,80 @@
+##NamesrvStarup
+---
+###类简介
+‘public class NamesrvStartup’
+
+>`NamesrvStartup`类是namesrv启动的入口类,在本地配置好环境变量ROCKETMQ_HOME后可通过执行其中的main方法来快速启动一个namesrv。namesrv主要负责维护活跃broker的信息和topic以及topic所在队列的信息。其中启动参数主要由namesrvConfig和nettyServerConfig这两个类来初始化,这两个类后面讲到,当然这些配置也可以通过启动指定配置文件进行修改。
+
+``` java
+ public static void main(String[] args) {
+ main0(args);
+ }
+
+ public static NamesrvController main0(String[] args) {
+
+ try {
+ //NamesrvController是namesrv接受请求并响应的核心类,
+ NamesrvController controller = createNamesrvController(args);
+ //启动并初始化NamesrvController
+ start(controller);
+ String tip = "The Name Server boot success. serializeType=" + RemotingCommand.getSerializeTypeConfigInThisServer();
+ log.info(tip);
+ System.out.printf("%s%n", tip);
+ return controller;
+ } catch (Throwable e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ return null;
+ }
+```
+
+###namesrv启动过程一:创建NamesrvController
+createNamesrvController中会创建并初始化namesrvConfig和nettyServerConfig的实例
+
+#### namesrvConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|String|rocketmqHome|rocketmq的主目录|
+|String|kvConfigPath|kv配置属性的持久化路径|
+|String|configStorePath|namesrv的配置文件路径,可以使用-c指定|
+|String|productEnvName|环境名|
+|boolean|clusterTest|是否开启集群测试,默认false|
+|boolean|orderMessageEnable|是否支持顺序消息,默认是false|
+
+#### nettyServerConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|int|listenPort|nameServer监听的端口,是8888,后面会被初始化为9876|
+|int|serverWorkerThreads|netty的线程池线程个数|
+|int|serverCallbackExecutorThreads|netty的公共任务(发送,消费,心跳检测)的线程池线程个数|
+|int|serverSelectorThreads|io任务的线程池线程个数|
+|int|serverOnewaySemaphoreValue|发送oneway消息时的请求并发度|
+|int|serverAsyncSemaphoreValue|异步消息最大并发度|
+|int|serverChannelMaxIdleTimeSeconds|网络最大空闲时间|
+|int|serverSocketSndBufSize|socket发送端缓冲区大小|
+|int|serverSocketRcvBufSize|socket接收端缓存区大小|
+|boolean|serverPooledByteBufAllocatorEnable|是否启用bytebuffer缓存(提高读写速度用的),默认true|
+|boolean|useEpollNativeSelector|是否启用Epoll,默认false|
+
+namesrvConfig和nettyServerConfig里的这些配置都可以通过"-c"来指定属性配置文件的位置来重新修改;也可以通过"-p 属性名=属性值"这样来重新指定
+
+最后调用NamesrvController的构造方法创建NamesrvController实例,NamesrvController创建完成
+
+###namesrv启动过程二:初始化NamesrvController
+
+1.调用start方法启动NamesrvController
+
+2.调用NamesrvController的initialize来初始化
+
+3.初始化过程如下:
+- 加载kv配置,存在一个kv配置管理器
+- 创建netty服务的对象,同时在onChannelDestroy方法规定了当broker宕机时要触发的动作,其实就是把registerBroker方法做的事回退掉
+- 创建netty处理响应的线程池,然后注册
+- 创建了一个定时线程池,调用scanNotActiveBroker方法每隔10s来检查哪些broker宕机了
Review comment:
用于检查broker失去心跳
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] ShannonDing commented on a change in pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
ShannonDing commented on a change in pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#discussion_r581023705
##########
File path: docs/cn/client/java/API_Reference_NamesrvStartup.md
##########
@@ -0,0 +1,172 @@
+##NamesrvStarup
Review comment:
标题格式缺少空格
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] codecov-io commented on pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#issuecomment-782523912
# [Codecov](https://codecov.io/gh/apache/rocketmq/pull/2682?src=pr&el=h1) Report
> Merging [#2682](https://codecov.io/gh/apache/rocketmq/pull/2682?src=pr&el=desc) (365703c) into [develop](https://codecov.io/gh/apache/rocketmq/commit/606de993d3da0e6cec3d5e6f1c2a9126abec054b?el=desc) (606de99) will **decrease** coverage by `0.08%`.
> The diff coverage is `n/a`.
[](https://codecov.io/gh/apache/rocketmq/pull/2682?src=pr&el=tree)
```diff
@@ Coverage Diff @@
## develop #2682 +/- ##
=============================================
- Coverage 46.25% 46.17% -0.09%
+ Complexity 4347 4341 -6
=============================================
Files 547 547
Lines 36246 36246
Branches 4809 4809
=============================================
- Hits 16766 16736 -30
- Misses 17395 17420 +25
- Partials 2085 2090 +5
```
| [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/2682?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| [...a/org/apache/rocketmq/logging/inner/SysLogger.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-bG9nZ2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbG9nZ2luZy9pbm5lci9TeXNMb2dnZXIuamF2YQ==) | `28.57% <0.00%> (-5.72%)` | `5.00% <0.00%> (-1.00%)` | |
| [...he/rocketmq/client/impl/consumer/ProcessQueue.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9Qcm9jZXNzUXVldWUuamF2YQ==) | `58.60% <0.00%> (-4.66%)` | `31.00% <0.00%> (-2.00%)` | |
| [...ketmq/common/protocol/body/ConsumerConnection.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-Y29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jb21tb24vcHJvdG9jb2wvYm9keS9Db25zdW1lckNvbm5lY3Rpb24uamF2YQ==) | `95.83% <0.00%> (-4.17%)` | `13.00% <0.00%> (-1.00%)` | |
| [...java/org/apache/rocketmq/logging/inner/Logger.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-bG9nZ2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbG9nZ2luZy9pbm5lci9Mb2dnZXIuamF2YQ==) | `52.63% <0.00%> (-3.35%)` | `28.00% <0.00%> (-1.00%)` | |
| [...ava/org/apache/rocketmq/test/util/VerifyUtils.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-dGVzdC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvdGVzdC91dGlsL1ZlcmlmeVV0aWxzLmphdmE=) | `46.26% <0.00%> (-2.99%)` | `14.00% <0.00%> (-1.00%)` | |
| [...ava/org/apache/rocketmq/filter/util/BitsArray.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-ZmlsdGVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9maWx0ZXIvdXRpbC9CaXRzQXJyYXkuamF2YQ==) | `59.82% <0.00%> (-2.57%)` | `30.00% <0.00%> (-1.00%)` | |
| [...mq/client/consumer/store/LocalFileOffsetStore.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvY29uc3VtZXIvc3RvcmUvTG9jYWxGaWxlT2Zmc2V0U3RvcmUuamF2YQ==) | `56.86% <0.00%> (-1.97%)` | `19.00% <0.00%> (ø%)` | |
| [...mq/client/impl/consumer/RebalanceLitePullImpl.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvaW1wbC9jb25zdW1lci9SZWJhbGFuY2VMaXRlUHVsbEltcGwuamF2YQ==) | `54.23% <0.00%> (-1.70%)` | `11.00% <0.00%> (-1.00%)` | |
| [...a/org/apache/rocketmq/store/StoreStatsService.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL1N0b3JlU3RhdHNTZXJ2aWNlLmphdmE=) | `29.50% <0.00%> (-1.32%)` | `26.00% <0.00%> (-2.00%)` | |
| [...etmq/client/latency/LatencyFaultToleranceImpl.java](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree#diff-Y2xpZW50L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9jbGllbnQvbGF0ZW5jeS9MYXRlbmN5RmF1bHRUb2xlcmFuY2VJbXBsLmphdmE=) | `50.00% <0.00%> (-1.29%)` | `8.00% <0.00%> (ø%)` | |
| ... and [8 more](https://codecov.io/gh/apache/rocketmq/pull/2682/diff?src=pr&el=tree-more) | |
------
[Continue to review full report at Codecov](https://codecov.io/gh/apache/rocketmq/pull/2682?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/apache/rocketmq/pull/2682?src=pr&el=footer). Last update [606de99...bc776b7](https://codecov.io/gh/apache/rocketmq/pull/2682?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] coveralls edited a comment on pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
coveralls edited a comment on pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#issuecomment-781909132
[](https://coveralls.io/builds/37291762)
Coverage decreased (-0.1%) to 51.797% when pulling **bc776b7fcafd08d835ff570c5077584fb1302c5d on zsmweiwei:dev_zsm** into **97c77701f863c69d28f5ba253bd80103a63f9fd1 on apache:develop**.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] lizhiboo commented on a change in pull request #2682: [ISSUE #2680]Add namesrv startup process description
Posted by GitBox <gi...@apache.org>.
lizhiboo commented on a change in pull request #2682:
URL: https://github.com/apache/rocketmq/pull/2682#discussion_r579158834
##########
File path: docs/cn/client/java/API_Reference_NamesrvStartup.md
##########
@@ -0,0 +1,80 @@
+##NamesrvStarup
+---
+###类简介
+‘public class NamesrvStartup’
+
+>`NamesrvStartup`类是namesrv启动的入口类,在本地配置好环境变量ROCKETMQ_HOME后可通过执行其中的main方法来快速启动一个namesrv。namesrv主要负责维护活跃broker的信息和topic以及topic所在队列的信息。其中启动参数主要由namesrvConfig和nettyServerConfig这两个类来初始化,这两个类后面讲到,当然这些配置也可以通过启动指定配置文件进行修改。
+
+``` java
+ public static void main(String[] args) {
+ main0(args);
+ }
+
+ public static NamesrvController main0(String[] args) {
+
+ try {
+ //NamesrvController是namesrv接受请求并响应的核心类,
+ NamesrvController controller = createNamesrvController(args);
+ //启动并初始化NamesrvController
+ start(controller);
+ String tip = "The Name Server boot success. serializeType=" + RemotingCommand.getSerializeTypeConfigInThisServer();
+ log.info(tip);
+ System.out.printf("%s%n", tip);
+ return controller;
+ } catch (Throwable e) {
+ e.printStackTrace();
+ System.exit(-1);
+ }
+
+ return null;
+ }
+```
+
+###namesrv启动过程一:创建NamesrvController
+createNamesrvController中会创建并初始化namesrvConfig和nettyServerConfig的实例
+
+#### namesrvConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|String|rocketmqHome|rocketmq的主目录|
+|String|kvConfigPath|kv配置属性的持久化路径|
+|String|configStorePath|namesrv的配置文件路径,可以使用-c指定|
+|String|productEnvName|环境名|
+|boolean|clusterTest|是否开启集群测试,默认false|
+|boolean|orderMessageEnable|是否支持顺序消息,默认是false|
+
+#### nettyServerConfig参数说明
+|类型|参数名称|描述|
+|------|-------|-------|
+|int|listenPort|nameServer监听的端口,是8888,后面会被初始化为9876|
+|int|serverWorkerThreads|netty的线程池线程个数|
Review comment:
netty的woker线程数,处理namesrv的业务逻辑线程。
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org