Merge pull request #9956 from zmstone/0210-fix-bridge-status

0210 docs: fix bridge status
This commit is contained in:
Zaiming (Stone) Shi 2023-02-28 19:44:07 +01:00 committed by GitHub
commit b3100ca8ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 13 deletions

View File

@ -222,6 +222,10 @@ run: $(PROFILE) quickrun
quickrun:
./_build/$(PROFILE)/rel/emqx/bin/emqx console
## Take the currently set PROFILE
docker:
@$(BUILD) $(PROFILE) docker
## docker target is to create docker instructions
.PHONY: $(REL_PROFILES:%=%-docker) $(REL_PROFILES:%=%-elixir-docker)
define gen-docker-target

View File

@ -35,8 +35,18 @@ emqx_bridge_schema {
desc_status {
desc {
en: """The status of the bridge"""
zh: """Bridge 的状态"""
en: """The status of the bridge<br/>
- <code>connecting</code>: the initial state before any health probes were made.<br/>
- <code>connected</code>: when the bridge passes the health probes.<br/>
- <code>disconnected</code>: when the bridge can not pass health probes.<br/>
- <code>stopped</code>: when the bridge resource is requested to be stopped.<br/>
- <code>inconsistent</code>: When not all the nodes are at the same status."""
zh: """Bridge 的连接状态<br/>
- <code>connecting</code>: 启动时的初始状态。<br/>
- <code>connected</code>: 桥接驱动健康检查正常。<br/>
- <code>disconnected</code>: 当桥接无法通过健康检查。<br/>
- <code>stopped</code>: 桥接处于停用状态。<br/>
- <code>inconsistent</code>: 集群中有各节点汇报的状态不一致。"""
}
label: {
en: "Bridge Status"
@ -46,8 +56,16 @@ emqx_bridge_schema {
desc_node_status {
desc {
en: """The status of the bridge for each node"""
zh: """每个节点的 Bridge 状态"""
en: """The status of the bridge for each node.
- <code>connecting</code>: the initial state before any health probes were made.<br/>
- <code>connected</code>: when the bridge passes the health probes.<br/>
- <code>disconnected</code>: when the bridge can not pass health probes.<br/>
- <code>stopped</code>: when the bridge resource is requested to be stopped."""
zh: """每个节点的 Bridge 状态
- <code>connecting</code>: 启动时的初始状态。<br/>
- <code>connected</code>: 桥接驱动健康检查正常。<br/>
- <code>disconnected</code>: 当桥接无法通过健康检查。<br/>
- <code>stopped</code>: 桥接处于停用状态。"""
}
label: {
en: "Node Bridge Status"

View File

@ -208,7 +208,7 @@ desc(_) ->
undefined.
status() ->
hoconsc:enum([connected, disconnected, connecting]).
hoconsc:enum([connected, disconnected, connecting, inconsistent]).
node_name() ->
{"node", mk(binary(), #{desc => ?DESC("desc_node_name"), example => "emqx@127.0.0.1"})}.

View File

@ -10,7 +10,8 @@ set -euo pipefail
# ensure dir
cd -P -- "$(dirname -- "$0")/.."
IMAGE="${1}"
IMAGE1="${1}"
IMAGE2="${2:-${IMAGE1}}"
NET='emqx.io'
NODE1="node1.$NET"
@ -35,7 +36,7 @@ docker run -d -t --restart=always --name "$NODE1" \
-e EMQX_listeners__wss__default__enable=false \
-e EMQX_listeners__tcp__default__proxy_protocol=true \
-e EMQX_listeners__ws__default__proxy_protocol=true \
"$IMAGE"
"$IMAGE1"
docker run -d -t --restart=always --name "$NODE2" \
--net "$NET" \
@ -47,7 +48,7 @@ docker run -d -t --restart=always --name "$NODE2" \
-e EMQX_listeners__wss__default__enable=false \
-e EMQX_listeners__tcp__default__proxy_protocol=true \
-e EMQX_listeners__ws__default__proxy_protocol=true \
"$IMAGE"
"$IMAGE2"
mkdir -p tmp
cat <<EOF > tmp/haproxy.cfg
@ -84,14 +85,17 @@ defaults
## API
##----------------------------------------------------------------
frontend emqx_dashboard
mode tcp
option tcplog
bind *:18083
default_backend emqx_dashboard_back
mode tcp
option tcplog
bind *:18083
default_backend emqx_dashboard_back
backend emqx_dashboard_back
# Must use a consistent dispatch when EMQX is running on different versions
# because the js files for the dashboard is chunked, having the backends sharing
# load randomly will cause the browser fail to GET some chunks (or get bad chunks if names clash)
balance first
mode http
# balance static-rr
server emqx-1 $NODE1:18083
server emqx-2 $NODE2:18083