Skip to content

Commit

Permalink
docs: 修改registry心跳开关相关文档
Browse files Browse the repository at this point in the history
fix: 移除无用consul开关
  • Loading branch information
zyseap committed Apr 26, 2016
1 parent b3b0681 commit fa1b81c
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/wiki/en_quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ Install and start ZooKeeper:
4. After the server starts, you SHOULD call hearbeat switcher explicitly in order to start heartbeat for Zookeeper.

```java
MotanSwitcherUtil.setSwitcher(MotanConstants.REGISTRY_HEARTBEAT_SWITCHER, true)
MotanSwitcherUtil.setSwitcherValue(MotanConstants.REGISTRY_HEARTBEAT_SWITCHER, true)
```

5. Start client, call service.
Expand Down
10 changes: 8 additions & 2 deletions docs/wiki/zh_quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ ui后台 [http://localhost:8500/ui](http://localhost:8500/ui)
4. server程序启动后,需要显式调用心跳开关,注册到consul。

```java
MotanSwitcherUtil.setSwitcher(ConsulConstants.NAMING_PROCESS_HEARTBEAT_SWITCHER, true)
MotanSwitcherUtil.setSwitcherValue(MotanConstants.REGISTRY_HEARTBEAT_SWITCHER, true)
```

5. 进入[ui后台](http://localhost:8500/ui)查看服务是否正常提供调用
Expand Down Expand Up @@ -261,7 +261,13 @@ ui后台 [http://localhost:8500/ui](http://localhost:8500/ui)
<motan:service interface="quickstart.FooService" ref="serviceImpl" registry="my_zookeeper" export="8002" />
```

4. 启动client,调用服务
4. server程序启动后,需要显式调用心跳开关,注册到zookeeper。

```java
MotanSwitcherUtil.setSwitcherValue(MotanConstants.REGISTRY_HEARTBEAT_SWITCHER, true)
```

5. 启动client,调用服务


[maven]:https://maven.apache.org
Expand Down
6 changes: 2 additions & 4 deletions docs/wiki/zh_userguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,14 @@ motan:referer中的basicService属性用来标识引用哪个motan:basicReferer

# 运维及监控
## 优雅的停止服务
Motan支持在Consul集群环境下优雅的关闭节点,当需要关闭或重启节点时,可以先将待上线节点从集群中摘除,避免直接关闭影响正常请求。
Motan支持在Consul、ZooKeeper集群环境下优雅的关闭节点,当需要关闭或重启节点时,可以先将待上线节点从集群中摘除,避免直接关闭影响正常请求。

待关闭节点需要调用以下代码,建议通过servlet或业务的管理模块进行该调用。

```java
MotanSwitcherUtil.setSwitcher(ConsulConstants.NAMING_PROCESS_HEARTBEAT_SWITCHER, false)
MotanSwitcherUtil.setSwitcherValue(MotanConstants.REGISTRY_HEARTBEAT_SWITCHER, true)
```

> 注意:Zookeeper模块此功能正在开发。
## 管理后台
管理后台主要包括RPC服务查询、流量切换、Motan指令设置等功能,需使用ZooKeeper作为注册中心

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public class ConsulConstants {
/**
* consul心跳检测开关。
*/
@Deprecated
public static final String CONSUL_PROCESS_HEARTBEAT_SWITCHER = "feature.consul.heartbeat";

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ public class ConsulHeartbeatManager {
// 开关检查次数。
private int switcherCheckTimes = 0;

static {
// 心跳开关默认为关闭状态。rpc服务启动正常后,通过设置开关状态为开启,打开心跳,对外提供rpc服务
MotanSwitcherUtil.initSwitcher(
ConsulConstants.CONSUL_PROCESS_HEARTBEAT_SWITCHER, false);
}

public ConsulHeartbeatManager(MotanConsulClient client) {
this.client = client;
heartbeatExecutor = Executors.newSingleThreadScheduledExecutor();
Expand Down

0 comments on commit fa1b81c

Please sign in to comment.