You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: emqx/content.md
+17-42Lines changed: 17 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -32,51 +32,35 @@ The EMQX broker runs as Linux user `emqx` in the docker container.
32
32
33
33
All EMQX Configuration in [`etc/emqx.conf`](https://github.com/emqx/emqx/blob/master/apps/emqx/etc/emqx.conf) can be configured via environment variables.
34
34
35
-
By default, the environment variables with `EMQX_` prefix are mapped to key-value pairs in configuration files.
36
-
37
-
You can change the prefix by overriding `HOCON_ENV_OVERRIDE_PREFIX`.
|`EMQX_NAME`| container name | none | EMQX node short name |
71
-
|`EMQX_HOST`| container IP | none | EMQX node host, IP or FQDN |
57
+
Environment variable `EMQX_NODE__NAME` allows you to specify an EMQX node name, which defaults to `<container_name>@<container_ip>`.
72
58
73
-
These environment variables are used during container startup phase only in [docker-entrypoint.sh](./docker-entrypoint.sh).
74
-
75
-
If `EMQX_NAME` and `EMQX_HOST` are set, and `EMQX_NODE_NAME` is not set, `EMQX_NODE_NAME=$EMQX_NAME@$EMQX_HOST`. Otherwise `EMQX_NODE_NAME` is taken verbatim.
59
+
If not specified, EMQX determines its node name based on the running environment or other environment variables used for node discovery.
76
60
77
61
### Cluster
78
62
79
-
EMQX supports a variety of clustering methods, see our [documentation](https://www.emqx.io/docs/en/latest/deploy/cluster/intro.html) for details.
63
+
EMQX supports a variety of clustering methods, see our [documentation](https://docs.emqx.com/en/emqx/latest/deploy/cluster/create-cluster.html) for details.
80
64
81
65
Let's create a static node list cluster from docker-compose.
82
66
@@ -89,8 +73,7 @@ Let's create a static node list cluster from docker-compose.
@@ -134,19 +116,16 @@ Let's create a static node list cluster from docker-compose.
134
116
If you want to persist the EMQX docker container, you need to keep the following directories:
135
117
136
118
-`/opt/emqx/data`
137
-
-`/opt/emqx/etc`
138
119
-`/opt/emqx/log`
139
120
140
-
Since data in these folders are partially stored under the `/opt/emqx/data/mnesia/${node_name}`, the user also needs to reuse the same node name to see the previous state. In detail, one needs to specify the two environment variables: `EMQX_NAME` and `EMQX_HOST`, `EMQX_HOST` set as `127.0.0.1`or network alias would be useful.
121
+
Since data in these folders are partially stored under the `/opt/emqx/data/mnesia/${node_name}`, the user also needs to reuse the same node name to see the previous state. To make this work, one needs to set the host part of `EMQX_NODE__NAME` to something static that does not change when you restart or recreate the container. It could be container name, hostname or loopback IP address `127.0.0.1`if you only have one node.
141
122
142
123
In if you use docker-compose, the configuration would look something like this:
143
124
144
125
```YAML
145
126
volumes:
146
127
vol-emqx-data:
147
128
name: foo-emqx-data
148
-
vol-emqx-etc:
149
-
name: foo-emqx-etc
150
129
vol-emqx-log:
151
130
name: foo-emqx-log
152
131
@@ -155,19 +134,15 @@ services:
155
134
image: %%IMAGE%%:latest
156
135
restart: always
157
136
environment:
158
-
EMQX_NAME: foo_emqx
159
-
EMQX_HOST: 127.0.0.1
137
+
EMQX_NODE__NAME: foo_emqx@127.0.0.1
160
138
volumes:
161
139
- vol-emqx-data:/opt/emqx/data
162
-
- vol-emqx-etc:/opt/emqx/etc
163
140
- vol-emqx-log:/opt/emqx/log
164
141
```
165
142
166
-
Note that `/opt/emqx/etc` contains some essential configuration files. If you want to mount a host directory in the container to persist configuration overrides, you will need to bootstrap it with [default configuration files](https://github.com/emqx/emqx/tree/master/apps/emqx/etc).
167
-
168
143
### Kernel Tuning
169
144
170
-
Under Linux host machine, the easiest way is [Tuning guide](https://www.emqx.io/docs/en/latest/deploy/tune.html).
145
+
Under Linux host machine, the easiest way is [Tuning guide](https://docs.emqx.com/en/emqx/latest/performance/tune.html).
171
146
172
147
If you want tune Linux kernel by docker, you must ensure your docker is latest version (>=1.12).
0 commit comments