Skip to content

Commit b307eec

Browse files
author
Adam Locke
authored
[DOCS] Clarifying env variable substitution (#57370) (#57738)
* Clarifying environment variable substitution in the ES configuration YAML * Update code snippet * Remove extraneous quotes from string example * Incorporating review feedback
1 parent cc3762a commit b307eec

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

docs/reference/setup/configuration.asciidoc

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ path.logs: /var/log/elasticsearch
7171

7272
Environment variables referenced with the `${...}` notation within the
7373
configuration file will be replaced with the value of the environment
74-
variable, for instance:
74+
variable. For example:
7575

7676
[source,yaml]
7777
--------------------------------------------------
@@ -109,3 +109,36 @@ Enter value for [node.name]:
109109
NOTE: Elasticsearch will not start if `${prompt.text}` or `${prompt.secret}`
110110
is used in the settings and the process is run as a service or in the background.
111111

112+
Values for environment variables must be simple strings. Use a comma-separated string to provide values that Elasticsearch will parse as a list. For example, Elasticsearch will split the following string into a list of values for the `${HOSTNAME}` environment variable:
113+
114+
[source,yaml]
115+
----
116+
export HOSTNAME=“host1,host2"
117+
----
118+
119+
[discrete]
120+
[[cluster-setting-types]]
121+
=== Cluster and node setting types
122+
123+
Cluster and node settings can be categorized based on how they are configured:
124+
125+
[[dynamic-cluster-setting]]
126+
Dynamic::
127+
You can configure and update dynamic settings on a running cluster using the
128+
<<cluster-update-settings,cluster update settings API>>.
129+
+
130+
You can also configure dynamic settings locally on an unstarted or shut down
131+
node using `elasticsearch.yml`.
132+
+
133+
TIP: It’s best to set dynamic, cluster-wide settings with the cluster update
134+
settings API and use `elasticsearch.yml` only for local configurations. Using
135+
the cluster update settings API ensures the setting is the same on all nodes. If
136+
you accidentally configure different settings in `elasticsearch.yml` on
137+
different nodes, it can be difficult to notice discrepancies.
138+
139+
[[static-cluster-setting]]
140+
Static::
141+
Static settings can only be configured on an unstarted or shut down node using
142+
`elasticsearch.yml`.
143+
+
144+
Static settings must be set on every relevant node in the cluster.

0 commit comments

Comments
 (0)