@@ -113,7 +113,7 @@ endif::[]
113
113
ifeval::["{release-state}"!="unreleased"]
114
114
[source,sh,subs="attributes"]
115
115
----
116
- docker run --name es-node01 --net elastic -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:{version}
116
+ docker run --name es01 --net elastic -p 9200:9200 -it docker.elastic.co/elasticsearch/elasticsearch:{version}
117
117
----
118
118
119
119
endif::[]
@@ -130,15 +130,15 @@ to the `http_ca.crt` certificate, which you'll use in the next step.
130
130
+
131
131
[source,sh]
132
132
----
133
- docker exec -it es-node01 /bin/bash -c "find /usr/share/elasticsearch -name http_ca.crt"
133
+ docker exec -it es01 /bin/bash -c "find /usr/share/elasticsearch -name http_ca.crt"
134
134
----
135
135
136
136
. Copy the `http_ca.crt` security certificate from your Docker container to
137
137
your local machine.
138
138
+
139
139
[source,sh]
140
140
----
141
- docker cp es-node01 :/usr/share/elasticsearch/config/tls_auto_config_<timestamp>/http_ca.crt .
141
+ docker cp es01 :/usr/share/elasticsearch/config/tls_auto_config_<timestamp>/http_ca.crt .
142
142
----
143
143
`<timestamp>`:: The timestamp of when the auto-configuration process created
144
144
the security files directory in your Docker container.
@@ -226,6 +226,57 @@ endif::[]
226
226
.. Log in to {kib} as the `elastic` user with the password that was generated
227
227
when you started {es}.
228
228
229
+ [[docker-enroll-nodes]]
230
+ [discrete]
231
+ ==== Enroll additional nodes
232
+
233
+ When you start {es} for the first time, the installation process configures a single-node cluster by default. This process also generates an enrollment token
234
+ and prints it to your terminal. If you want a node to join an existing cluster,
235
+ start the new node with the generated enrollment token.
236
+
237
+ --
238
+ .Generating enrollment tokens
239
+ ****
240
+ The enrollment token is valid for 30 minutes. If you need to generate a
241
+ new enrollment token, run the
242
+ {ref}/create-enrollment-token.html[`elasticsearch-create-enrollment-token`] tool
243
+ on your existing node. This tool is available in the {es} `bin` directory of the
244
+ Docker container.
245
+
246
+ For example, run the following command on the existing `es01` node to
247
+ generate an enrollment token for new {es} nodes:
248
+
249
+ [source,sh]
250
+ ----
251
+ docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s node
252
+ ----
253
+ ****
254
+ --
255
+
256
+ . In the terminal where you started your first node, copy the generated
257
+ enrollment token for adding new {es} nodes.
258
+
259
+ . On your new node, start {es} and include the generated enrollment token.
260
+ +
261
+ [source,sh,subs="attributes"]
262
+ ----
263
+ docker run -e ENROLLMENT_TOKEN="<token>" --name es02 --net elastic -it docker.elastic.co/elasticsearch/elasticsearch:{version}
264
+ ----
265
+ +
266
+ {es} is now configured to join the existing cluster.
267
+
268
+ If you experience issues where the container where your first node is running
269
+ exits when your second node starts, explicitly set values for the JVM heap size.
270
+ To {ref}/docker.html#docker-set-heap-size[manually configure the heap size],
271
+ include the `ES_JAVA_OPTS` variable and set values for `-Xms` and `-Xmx` when
272
+ starting each node. For example, the following command starts node `es02` and
273
+ sets the minimum and maximum JVM heap size to 1 GB:
274
+
275
+ [source,sh,subs="attributes"]
276
+ ----
277
+ docker run -e ES_JAVA_OPTS="-Xms1g -Xmx1g" -e ENROLLMENT_TOKEN="<token>" --name es02 -p 9201:9200 --net elastic -it docker.elastic.co/elasticsearch/elasticsearch:{version}
278
+ ----
279
+
229
280
[[docker-generate]]
230
281
[discrete]
231
282
==== Generate passwords and enrollment tokens
@@ -237,7 +288,7 @@ For example, to reset the password for the `elastic` user:
237
288
238
289
[source,sh]
239
290
----
240
- docker exec -it es-node01 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
291
+ docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-reset-password -u elastic
241
292
----
242
293
243
294
If you need to generate new enrollment tokens for {kib} or {es} nodes, run the
@@ -248,7 +299,7 @@ For example, to generate a new enrollment token for {kib}:
248
299
249
300
[source,sh]
250
301
----
251
- docker exec -it es-node01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
302
+ docker exec -it es01 /usr/share/elasticsearch/bin/elasticsearch-create-enrollment-token -s kibana
252
303
----
253
304
254
305
@@ -261,7 +312,7 @@ To remove the containers and their network, run:
261
312
[source,sh]
262
313
----
263
314
docker network rm elastic
264
- docker rm es-node01
315
+ docker rm es01
265
316
docker rm kib01
266
317
----
267
318
@@ -380,8 +431,8 @@ and join the lines before running this command.
380
431
--
381
432
["source","sh"]
382
433
----
383
- docker exec es-node01 /bin/bash -c "bin/elasticsearch-setup-passwords \
384
- auto --batch --url https://es-node01 :9200"
434
+ docker exec es01 /bin/bash -c "bin/elasticsearch-setup-passwords \
435
+ auto --batch --url https://es01 :9200"
385
436
----
386
437
387
438
IMPORTANT: Make a note of the generated passwords.
@@ -406,13 +457,13 @@ ifeval::["{release-state}"!="unreleased"]
406
457
kib01:
407
458
image: docker.elastic.co/kibana/kibana:${VERSION}
408
459
container_name: kib01
409
- depends_on: {"es-node01 ": {"condition": "service_healthy"}}
460
+ depends_on: {"es01 ": {"condition": "service_healthy"}}
410
461
ports:
411
462
- 5601:5601
412
463
environment:
413
464
SERVERNAME: localhost
414
- ELASTICSEARCH_URL: https://es-node01 :9200
415
- ELASTICSEARCH_HOSTS: https://es-node01 :9200
465
+ ELASTICSEARCH_URL: https://es01 :9200
466
+ ELASTICSEARCH_HOSTS: https://es01 :9200
416
467
ELASTICSEARCH_USERNAME: kibana_system
417
468
**ELASTICSEARCH_PASSWORD: CHANGEME**
418
469
ELASTICSEARCH_SSL_CERTIFICATEAUTHORITIES: $CERTS_DIR/ca/ca.crt
@@ -453,15 +504,15 @@ volumes by running `docker-compose -f elastic-docker-tls.yml down -v`.
453
504
Specifying settings for {es} and {{kib}} directly in the compose file is a convenient way to get started,
454
505
but loading settings from a file is preferable once you get past the experimental stage.
455
506
456
- For example, to use `es-node01 .yml` as the configuration file for the `es-node01 ` {es} node,
507
+ For example, to use `es01 .yml` as the configuration file for the `es01 ` {es} node,
457
508
you can create a bind mount in the volumes section.
458
509
459
510
["source","yaml"]
460
511
----
461
512
volumes:
462
513
- data01:/usr/share/elasticsearch/data
463
514
- certs:$CERTS_DIR
464
- - ./es-node01 .yml:/usr/share/elasticsearch/config/elasticsearch.yml
515
+ - ./es01 .yml:/usr/share/elasticsearch/config/elasticsearch.yml
465
516
----
466
517
467
518
Similarly, to load {kib} settings from a file, you overwrite `/usr/share/kibana/config/kibana.yml`:
0 commit comments