Merge pull request #7232 from thalesmg/rlog-default-db-backend2
feat: use rlog db backend by default
This commit is contained in:
commit
b231a13794
|
@ -0,0 +1,29 @@
|
||||||
|
x-default-emqx: &default-emqx
|
||||||
|
env_file:
|
||||||
|
- conf.cluster.env
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "/opt/emqx/bin/emqx_ctl", "status"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 25s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
|
services:
|
||||||
|
emqx1:
|
||||||
|
<<: *default-emqx
|
||||||
|
container_name: node1.emqx.io
|
||||||
|
restart: on-failure
|
||||||
|
environment:
|
||||||
|
- "EMQX_HOST=node1.emqx.io"
|
||||||
|
- "EMQX_DB__BACKEND=mnesia"
|
||||||
|
- "EMQX_DB__ROLE=core"
|
||||||
|
|
||||||
|
emqx2:
|
||||||
|
<<: *default-emqx
|
||||||
|
container_name: node2.emqx.io
|
||||||
|
depends_on:
|
||||||
|
- emqx1
|
||||||
|
restart: on-failure
|
||||||
|
environment:
|
||||||
|
- "EMQX_HOST=node2.emqx.io"
|
||||||
|
- "EMQX_DB__BACKEND=mnesia"
|
||||||
|
- "EMQX_DB__ROLE=core"
|
|
@ -5,12 +5,18 @@ set -euxo pipefail
|
||||||
export _EMQX_DOCKER_IMAGE_TAG="$1"
|
export _EMQX_DOCKER_IMAGE_TAG="$1"
|
||||||
_EMQX_TEST_DB_BACKEND="${2:-${_EMQX_TEST_DB_BACKEND:-mnesia}}"
|
_EMQX_TEST_DB_BACKEND="${2:-${_EMQX_TEST_DB_BACKEND:-mnesia}}"
|
||||||
|
|
||||||
if [ "$_EMQX_TEST_DB_BACKEND" = "rlog" ]
|
case "$_EMQX_TEST_DB_BACKEND" in
|
||||||
then
|
rlog)
|
||||||
CLUSTER_OVERRIDES="-f .ci/docker-compose-file/docker-compose-emqx-cluster-rlog.override.yaml"
|
CLUSTER_OVERRIDES=".ci/docker-compose-file/docker-compose-emqx-cluster-rlog.override.yaml"
|
||||||
else
|
;;
|
||||||
CLUSTER_OVERRIDES=""
|
mnesia)
|
||||||
fi
|
CLUSTER_OVERRIDES=".ci/docker-compose-file/docker-compose-emqx-cluster-mnesia.override.yaml"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "ERROR: Unknown DB backend: ${_EMQX_TEST_DB_BACKEND}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
{
|
{
|
||||||
echo "HOCON_ENV_OVERRIDE_PREFIX=EMQX_"
|
echo "HOCON_ENV_OVERRIDE_PREFIX=EMQX_"
|
||||||
|
@ -39,10 +45,9 @@ is_cluster_up() {
|
||||||
is_node_listening node2.emqx.io
|
is_node_listening node2.emqx.io
|
||||||
}
|
}
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
docker-compose \
|
docker-compose \
|
||||||
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
-f .ci/docker-compose-file/docker-compose-emqx-cluster.yaml \
|
||||||
$CLUSTER_OVERRIDES \
|
-f "$CLUSTER_OVERRIDES" \
|
||||||
-f .ci/docker-compose-file/docker-compose-python.yaml \
|
-f .ci/docker-compose-file/docker-compose-python.yaml \
|
||||||
up -d
|
up -d
|
||||||
|
|
||||||
|
|
|
@ -315,22 +315,22 @@ a crash dump"
|
||||||
sc(emqx_schema:duration(),
|
sc(emqx_schema:duration(),
|
||||||
#{ mapping => "vm_args.-kernel net_ticktime"
|
#{ mapping => "vm_args.-kernel net_ticktime"
|
||||||
, default => "2m"
|
, default => "2m"
|
||||||
, desc => "This is the approximate time an EMQX node may"
|
, desc => "This is the approximate time an EMQX node may be unresponsive "
|
||||||
" be unresponsive until it is considered down and thereby disconnected."
|
"until it is considered down and thereby disconnected."
|
||||||
})}
|
})}
|
||||||
, {"dist_listen_min",
|
, {"dist_listen_min",
|
||||||
sc(range(1024, 65535),
|
sc(range(1024, 65535),
|
||||||
#{ mapping => "kernel.inet_dist_listen_min"
|
#{ mapping => "kernel.inet_dist_listen_min"
|
||||||
, default => 6369
|
, default => 6369
|
||||||
, desc => "Lower bound for the port range where"
|
, desc => "Lower bound for the port range where EMQX broker "
|
||||||
" EMQX broker listens for peer connections."
|
"listens for peer connections."
|
||||||
})}
|
})}
|
||||||
, {"dist_listen_max",
|
, {"dist_listen_max",
|
||||||
sc(range(1024, 65535),
|
sc(range(1024, 65535),
|
||||||
#{ mapping => "kernel.inet_dist_listen_max"
|
#{ mapping => "kernel.inet_dist_listen_max"
|
||||||
, default => 6369
|
, default => 6369
|
||||||
, desc => "Upper bound for the port range "
|
, desc => "Upper bound for the port range where EMQX broker "
|
||||||
"where EMQX broker listens for peer connections."
|
"listens for peer connections."
|
||||||
})}
|
})}
|
||||||
, {"backtrace_depth",
|
, {"backtrace_depth",
|
||||||
sc(integer(),
|
sc(integer(),
|
||||||
|
@ -362,11 +362,12 @@ fields("db") ->
|
||||||
[ {"backend",
|
[ {"backend",
|
||||||
sc(hoconsc:enum([mnesia, rlog]),
|
sc(hoconsc:enum([mnesia, rlog]),
|
||||||
#{ mapping => "mria.db_backend"
|
#{ mapping => "mria.db_backend"
|
||||||
, default => mnesia
|
, default => rlog
|
||||||
, desc => """
|
, desc => """
|
||||||
Select the backend for the embedded database.<br/>
|
Select the backend for the embedded database.<br/>
|
||||||
<code>mnesia</code> is the default backend, that offers decent performance in small clusters.<br/>
|
<code>rlog</code> is the default backend, a new experimental backend
|
||||||
<code>rlog</code> is a new experimental backend that is suitable for very large clusters.
|
that is suitable for very large clusters.<br/>
|
||||||
|
<code>mnesia</code> is a backend that offers decent performance in small clusters.
|
||||||
"""
|
"""
|
||||||
})}
|
})}
|
||||||
, {"role",
|
, {"role",
|
||||||
|
@ -391,7 +392,10 @@ to <code>rlog</code>.
|
||||||
, desc => """
|
, desc => """
|
||||||
List of core nodes that the replicant will connect to.<br/>
|
List of core nodes that the replicant will connect to.<br/>
|
||||||
Note: this parameter only takes effect when the <code>backend</code> is set
|
Note: this parameter only takes effect when the <code>backend</code> is set
|
||||||
to <code>rlog</code> and the <code>role</code> is set to <code>replicant</code>.
|
to <code>rlog</code> and the <code>role</code> is set to <code>replicant</code>.<br/>
|
||||||
|
This values needs to be defined for manual or static cluster discovery mechanisms.<br/>
|
||||||
|
If an automatic cluster discovery mechanism is being used (such as <code>etcd</code>),
|
||||||
|
there is no need to set this value.
|
||||||
"""
|
"""
|
||||||
})}
|
})}
|
||||||
, {"rpc_module",
|
, {"rpc_module",
|
||||||
|
@ -458,8 +462,8 @@ fields("rpc") ->
|
||||||
#{ mapping => "gen_rpc.port_discovery"
|
#{ mapping => "gen_rpc.port_discovery"
|
||||||
, default => stateless
|
, default => stateless
|
||||||
, desc => "<code>manual</code>: discover ports by <code>tcp_server_port</code>.<br/>"
|
, desc => "<code>manual</code>: discover ports by <code>tcp_server_port</code>.<br/>"
|
||||||
"<code>stateless</code>: discover ports in a stateless manner,"
|
"<code>stateless</code>: discover ports in a stateless manner, "
|
||||||
" using the following algorithm. "
|
"using the following algorithm. "
|
||||||
"If node name is <code>emqxN@127.0.0.1</code>, where the N is an integer, "
|
"If node name is <code>emqxN@127.0.0.1</code>, where the N is an integer, "
|
||||||
"then the listening port will be 5370 + N."
|
"then the listening port will be 5370 + N."
|
||||||
})}
|
})}
|
||||||
|
@ -468,8 +472,8 @@ fields("rpc") ->
|
||||||
#{ mapping => "gen_rpc.tcp_server_port"
|
#{ mapping => "gen_rpc.tcp_server_port"
|
||||||
, default => 5369
|
, default => 5369
|
||||||
, desc => "Listening port used by RPC local service.<br/> "
|
, desc => "Listening port used by RPC local service.<br/> "
|
||||||
"Note that this config only takes effect "
|
"Note that this config only takes effect when rpc.port_discovery "
|
||||||
"when rpc.port_discovery is set to manual."
|
"is set to manual."
|
||||||
})}
|
})}
|
||||||
, {"ssl_server_port",
|
, {"ssl_server_port",
|
||||||
sc(integer(),
|
sc(integer(),
|
||||||
|
@ -502,8 +506,8 @@ fields("rpc") ->
|
||||||
sc(file(),
|
sc(file(),
|
||||||
#{ mapping => "gen_rpc.keyfile"
|
#{ mapping => "gen_rpc.keyfile"
|
||||||
, desc => "Path to the private key file for the <code>rpc.certfile</code>.<br/>"
|
, desc => "Path to the private key file for the <code>rpc.certfile</code>.<br/>"
|
||||||
"Note: contents of this file are secret, so it's necessary to "
|
"Note: contents of this file are secret, so "
|
||||||
"set permissions to 600."
|
"it's necessary to set permissions to 600."
|
||||||
})}
|
})}
|
||||||
, {"cacertfile",
|
, {"cacertfile",
|
||||||
sc(file(),
|
sc(file(),
|
||||||
|
@ -534,8 +538,8 @@ fields("rpc") ->
|
||||||
sc(emqx_schema:duration_s(),
|
sc(emqx_schema:duration_s(),
|
||||||
#{ mapping => "gen_rpc.socket_keepalive_idle"
|
#{ mapping => "gen_rpc.socket_keepalive_idle"
|
||||||
, default => "7200s"
|
, default => "7200s"
|
||||||
, desc => "How long the connections between the brokers should remain open "
|
, desc => "How long the connections between the brokers "
|
||||||
"after the last message is sent."
|
"should remain open after the last message is sent."
|
||||||
})}
|
})}
|
||||||
, {"socket_keepalive_interval",
|
, {"socket_keepalive_interval",
|
||||||
sc(emqx_schema:duration_s(),
|
sc(emqx_schema:duration_s(),
|
||||||
|
|
Loading…
Reference in New Issue