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/README.md
+17-42Lines changed: 17 additions & 42 deletions
Original file line number
Diff line number
Diff line change
@@ -85,51 +85,35 @@ The EMQX broker runs as Linux user `emqx` in the docker container.
85
85
86
86
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.
87
87
88
-
By default, the environment variables with `EMQX_` prefix are mapped to key-value pairs in configuration files.
89
-
90
-
You can change the prefix by overriding `HOCON_ENV_OVERRIDE_PREFIX`.
|`EMQX_NAME`| container name | none | EMQX node short name |
124
-
|`EMQX_HOST`| container IP | none | EMQX node host, IP or FQDN |
110
+
Environment variable `EMQX_NODE__NAME` allows you to specify an EMQX node name, which defaults to `<container_name>@<container_ip>`.
125
111
126
-
These environment variables are used during container startup phase only in [docker-entrypoint.sh](./docker-entrypoint.sh).
127
-
128
-
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.
112
+
If not specified, EMQX determines its node name based on the running environment or other environment variables used for node discovery.
129
113
130
114
### Cluster
131
115
132
-
EMQX supports a variety of clustering methods, see our [documentation](https://www.emqx.io/docs/en/latest/deploy/cluster/intro.html) for details.
116
+
EMQX supports a variety of clustering methods, see our [documentation](https://docs.emqx.com/en/emqx/latest/deploy/cluster/create-cluster.html) for details.
133
117
134
118
Let's create a static node list cluster from docker-compose.
135
119
@@ -142,8 +126,7 @@ Let's create a static node list cluster from docker-compose.
@@ -187,19 +169,16 @@ Let's create a static node list cluster from docker-compose.
187
169
If you want to persist the EMQX docker container, you need to keep the following directories:
188
170
189
171
-`/opt/emqx/data`
190
-
-`/opt/emqx/etc`
191
172
-`/opt/emqx/log`
192
173
193
-
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.
174
+
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.
194
175
195
176
In if you use docker-compose, the configuration would look something like this:
196
177
197
178
```YAML
198
179
volumes:
199
180
vol-emqx-data:
200
181
name: foo-emqx-data
201
-
vol-emqx-etc:
202
-
name: foo-emqx-etc
203
182
vol-emqx-log:
204
183
name: foo-emqx-log
205
184
@@ -208,19 +187,15 @@ services:
208
187
image: emqx:latest
209
188
restart: always
210
189
environment:
211
-
EMQX_NAME: foo_emqx
212
-
EMQX_HOST: 127.0.0.1
190
+
EMQX_NODE__NAME: foo_emqx@127.0.0.1
213
191
volumes:
214
192
- vol-emqx-data:/opt/emqx/data
215
-
- vol-emqx-etc:/opt/emqx/etc
216
193
- vol-emqx-log:/opt/emqx/log
217
194
```
218
195
219
-
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).
220
-
221
196
### Kernel Tuning
222
197
223
-
Under Linux host machine, the easiest way is [Tuning guide](https://www.emqx.io/docs/en/latest/deploy/tune.html).
198
+
Under Linux host machine, the easiest way is [Tuning guide](https://docs.emqx.com/en/emqx/latest/performance/tune.html).
224
199
225
200
If you want tune Linux kernel by docker, you must ensure your docker is latest version (>=1.12).
0 commit comments