Browse Source

Rename CONF_DIR to ES_PATH_CONF

The environment variable CONF_DIR was previously inconsistently used in
our packaging to customize the location of Elasticsearch configuration
files. The importance of this environment variable has increased
starting in 6.0.0 as it's now used consistently to ensure Elasticsearch
and all secondary scripts (e.g., elasticsearch-keystore) all use the
same configuration. The name CONF_DIR is there for legacy reasons yet
it's too generic. This commit renames CONF_DIR to ES_PATH_CONF.

Relates #26197
Jason Tedor 8 years ago
parent
commit
e9687622bd
35 changed files with 86 additions and 75 deletions
  1. 1 1
      buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy
  2. 6 6
      buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy
  3. 1 2
      buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy
  4. 2 2
      distribution/build.gradle
  5. 2 2
      distribution/deb/src/main/packaging/init.d/elasticsearch
  6. 2 2
      distribution/rpm/src/main/packaging/init.d/elasticsearch
  7. 1 1
      distribution/src/main/packaging/env/elasticsearch
  8. 3 3
      distribution/src/main/packaging/scripts/postrm
  9. 1 1
      distribution/src/main/packaging/systemd/elasticsearch.service
  10. 4 4
      distribution/src/main/resources/bin/elasticsearch
  11. 2 2
      distribution/src/main/resources/bin/elasticsearch-env
  12. 2 2
      distribution/src/main/resources/bin/elasticsearch-env.bat
  13. 1 1
      distribution/src/main/resources/bin/elasticsearch-keystore
  14. 1 1
      distribution/src/main/resources/bin/elasticsearch-keystore.bat
  15. 1 1
      distribution/src/main/resources/bin/elasticsearch-plugin
  16. 1 1
      distribution/src/main/resources/bin/elasticsearch-plugin.bat
  17. 2 2
      distribution/src/main/resources/bin/elasticsearch-service.bat
  18. 1 1
      distribution/src/main/resources/bin/elasticsearch-translog
  19. 1 1
      distribution/src/main/resources/bin/elasticsearch-translog.bat
  20. 2 2
      distribution/src/main/resources/bin/elasticsearch.bat
  21. 1 1
      docs/plugins/plugin-script.asciidoc
  22. 11 2
      docs/reference/migration/migrate_6_0/packaging.asciidoc
  23. 6 6
      docs/reference/setup/configuration.asciidoc
  24. 1 1
      docs/reference/setup/install/deb.asciidoc
  25. 1 1
      docs/reference/setup/install/rpm.asciidoc
  26. 4 3
      docs/reference/setup/install/sysconfig-file.asciidoc
  27. 1 1
      docs/reference/setup/install/zip-targz.asciidoc
  28. 5 4
      docs/reference/setup/install/zip-windows.asciidoc
  29. 3 2
      docs/reference/setup/rolling_upgrade.asciidoc
  30. 3 3
      qa/vagrant/src/test/resources/packaging/tests/20_tar_package.bats
  31. 1 1
      qa/vagrant/src/test/resources/packaging/tests/60_systemd.bats
  32. 1 1
      qa/vagrant/src/test/resources/packaging/tests/70_sysv_initd.bats
  33. 3 3
      qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash
  34. 3 3
      qa/vagrant/src/test/resources/packaging/utils/plugins.bash
  35. 5 5
      qa/vagrant/src/test/resources/packaging/utils/utils.bash

+ 1 - 1
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/ClusterFormationTasks.groovy

@@ -326,7 +326,7 @@ class ClusterFormationTasks {
             if (unicastTransportUri != null) {
                 esConfig['discovery.zen.ping.unicast.hosts'] = "\"${unicastTransportUri}\""
             }
-            File configFile = new File(node.confDir, 'elasticsearch.yml')
+            File configFile = new File(node.pathConf, 'elasticsearch.yml')
             logger.info("Configuring ${configFile}")
             configFile.setText(esConfig.collect { key, value -> "${key}: ${value}" }.join('\n'), 'UTF-8')
         }

+ 6 - 6
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/NodeInfo.groovy

@@ -55,7 +55,7 @@ class NodeInfo {
     File homeDir
 
     /** config directory */
-    File confDir
+    File pathConf
 
     /** data directory (as an Object, to allow lazy evaluation) */
     Object dataDir
@@ -110,13 +110,13 @@ class NodeInfo {
         pidFile = new File(baseDir, 'es.pid')
         this.nodeVersion = nodeVersion
         homeDir = homeDir(baseDir, config.distribution, nodeVersion)
-        confDir = confDir(baseDir, config.distribution, nodeVersion)
+        pathConf = pathConf(baseDir, config.distribution, nodeVersion)
         if (config.dataDir != null) {
             dataDir = "${config.dataDir(nodeNum)}"
         } else {
             dataDir = new File(homeDir, "data")
         }
-        configFile = new File(confDir, 'elasticsearch.yml')
+        configFile = new File(pathConf, 'elasticsearch.yml')
         // even for rpm/deb, the logs are under home because we dont start with real services
         File logsDir = new File(homeDir, 'logs')
         httpPortsFile = new File(logsDir, 'http.ports')
@@ -158,9 +158,9 @@ class NodeInfo {
                 args.add("${property.key.substring('tests.es.'.size())}=${property.value}")
             }
         }
-        env.put('CONF_DIR', confDir)
+        env.put('ES_PATH_CONF', pathConf)
         if (Version.fromString(nodeVersion).major == 5) {
-            args.addAll("-E", "path.conf=${confDir}")
+            args.addAll("-E", "path.conf=${pathConf}")
         }
         if (!System.properties.containsKey("tests.es.path.data")) {
             args.addAll("-E", "path.data=${-> dataDir.toString()}")
@@ -240,7 +240,7 @@ class NodeInfo {
         return new File(baseDir, path)
     }
 
-    static File confDir(File baseDir, String distro, String nodeVersion) {
+    static File pathConf(File baseDir, String distro, String nodeVersion) {
         switch (distro) {
             case 'integ-test-zip':
             case 'zip':

+ 1 - 2
buildSrc/src/main/groovy/org/elasticsearch/gradle/test/RestIntegTestTask.groovy

@@ -24,7 +24,6 @@ import org.gradle.api.DefaultTask
 import org.gradle.api.Task
 import org.gradle.api.execution.TaskExecutionAdapter
 import org.gradle.api.internal.tasks.options.Option
-import org.gradle.api.plugins.JavaBasePlugin
 import org.gradle.api.tasks.Input
 import org.gradle.api.tasks.TaskState
 
@@ -68,7 +67,7 @@ public class RestIntegTestTask extends DefaultTask {
         // we pass all nodes to the rest cluster to allow the clients to round-robin between them
         // this is more realistic than just talking to a single node
         runner.systemProperty('tests.rest.cluster', "${-> nodes.collect{it.httpUri()}.join(",")}")
-        runner.systemProperty('tests.config.dir', "${-> nodes[0].confDir}")
+        runner.systemProperty('tests.config.dir', "${-> nodes[0].pathConf}")
         // TODO: our "client" qa tests currently use the rest-test plugin. instead they should have their own plugin
         // that sets up the test cluster and passes this transport uri instead of http uri. Until then, we pass
         // both as separate sysprops

+ 2 - 2
distribution/build.gradle

@@ -521,12 +521,12 @@ Map<String, String> expansionsForDistribution(distributionType) {
       'rpm': '/etc/sysconfig/elasticsearch',
       /* There isn't one of these files for tar or zip but its important to
         make an empty string here so the script can properly skip it. */
-      'def': 'if [ -z "$CONF_DIR" ]; then CONF_DIR="$ES_HOME"/config; done',
+      'def': 'if [ -z "$ES_PATH_CONF" ]; then ES_PATH_CONF="$ES_HOME"/config; done',
     ],
     'source.path.env': [
        'deb': 'if [ -f /etc/default/elasticsearch ]; then source /etc/default/elasticsearch; fi',
        'rpm': 'if [ -f /etc/sysconfig/elasticsearch ]; then source /etc/sysconfig/elasticsearch; fi',
-       'def': 'if [ -z "$CONF_DIR" ]; then CONF_DIR="$ES_HOME"/config; fi',
+       'def': 'if [ -z "$ES_PATH_CONF" ]; then ES_PATH_CONF="$ES_HOME"/config; fi',
     ],
     'path.logs': [
       'deb': packagingPathLogs,

+ 2 - 2
distribution/deb/src/main/packaging/init.d/elasticsearch

@@ -45,7 +45,7 @@ MAX_OPEN_FILES=65536
 #MAX_LOCKED_MEMORY=
 
 # Elasticsearch configuration directory
-CONF_DIR=/etc/$NAME
+ES_PATH_CONF=/etc/$NAME
 
 # Maximum number of VMA (Virtual Memory Areas) a process can own
 MAX_MAP_COUNT=262144
@@ -73,7 +73,7 @@ DAEMON_OPTS="-d -p $PID_FILE"
 
 export ES_JAVA_OPTS
 export JAVA_HOME
-export CONF_DIR
+export ES_PATH_CONF
 
 if [ ! -x "$DAEMON" ]; then
 	echo "The elasticsearch startup script does not exists or it is not executable, tried: $DAEMON"

+ 2 - 2
distribution/rpm/src/main/packaging/init.d/elasticsearch

@@ -35,7 +35,7 @@ fi
 ES_HOME="/usr/share/elasticsearch"
 MAX_OPEN_FILES=65536
 MAX_MAP_COUNT=262144
-CONF_DIR="${path.conf}"
+ES_PATH_CONF="${path.conf}"
 
 PID_DIR="/var/run/elasticsearch"
 
@@ -57,7 +57,7 @@ pidfile="$PID_DIR/${prog}.pid"
 
 export ES_JAVA_OPTS
 export JAVA_HOME
-export CONF_DIR
+export ES_PATH_CONF
 export ES_STARTUP_SLEEP_TIME
 
 lockfile=/var/lock/subsys/$prog

+ 1 - 1
distribution/src/main/packaging/env/elasticsearch

@@ -9,7 +9,7 @@
 #JAVA_HOME=
 
 # Elasticsearch configuration directory
-CONF_DIR=${path.conf}
+ES_PATH_CONF=${path.conf}
 
 # Elasticsearch PID directory
 #PID_DIR=/var/run/elasticsearch

+ 3 - 3
distribution/src/main/packaging/scripts/postrm

@@ -50,7 +50,7 @@ LOG_DIR="/var/log/elasticsearch"
 PLUGINS_DIR="/usr/share/elasticsearch/plugins"
 PID_DIR="/var/run/elasticsearch"
 DATA_DIR="/var/lib/elasticsearch"
-CONF_DIR="/etc/elasticsearch"
+ES_PATH_CONF="/etc/elasticsearch"
 
 # Source the default env file
 if [ "$SOURCE_ENV_FILE" = "true" ]; then
@@ -86,8 +86,8 @@ if [ "$REMOVE_DIRS" = "true" ]; then
     fi
 
     # delete the conf directory if and only if empty
-    if [ -d "$CONF_DIR" ]; then
-        rmdir --ignore-fail-on-non-empty "$CONF_DIR"
+    if [ -d "$ES_PATH_CONF" ]; then
+        rmdir --ignore-fail-on-non-empty "$ES_PATH_CONF"
     fi
 
 fi

+ 1 - 1
distribution/src/main/packaging/systemd/elasticsearch.service

@@ -6,7 +6,7 @@ After=network-online.target
 
 [Service]
 Environment=ES_HOME=/usr/share/elasticsearch
-Environment=CONF_DIR=${path.conf}
+Environment=ES_PATH_CONF=${path.conf}
 Environment=PID_DIR=/var/run/elasticsearch
 EnvironmentFile=-${path.env}
 

+ 4 - 4
distribution/src/main/resources/bin/elasticsearch

@@ -5,7 +5,7 @@
 # This script relies on a few environment variables to determine startup
 # behavior, those variables are:
 #
-#   CONF_DIR -- Path to config directory
+#   ES_PATH_CONF -- Path to config directory
 #   ES_JAVA_OPTS -- External Java Opts on top of the defaults set
 #
 # Optionally, exact memory values can be set using the `ES_JAVA_OPTS`. Note that
@@ -22,7 +22,7 @@ parse_jvm_options() {
   fi
 }
 
-ES_JVM_OPTIONS="$CONF_DIR"/jvm.options
+ES_JVM_OPTIONS="$ES_PATH_CONF"/jvm.options
 
 ES_JAVA_OPTS="`parse_jvm_options "$ES_JVM_OPTIONS"` $ES_JAVA_OPTS"
 
@@ -32,7 +32,7 @@ if ! echo $* | grep -E '(^-d |-d$| -d |--daemonize$|--daemonize )' > /dev/null;
     "$JAVA" \
     $ES_JAVA_OPTS \
     -Des.path.home="$ES_HOME" \
-    -Des.path.conf="$CONF_DIR" \
+    -Des.path.conf="$ES_PATH_CONF" \
     -cp "$ES_CLASSPATH" \
     org.elasticsearch.bootstrap.Elasticsearch \
     "$@"
@@ -41,7 +41,7 @@ else
     "$JAVA" \
     $ES_JAVA_OPTS \
     -Des.path.home="$ES_HOME" \
-    -Des.path.conf="$CONF_DIR" \
+    -Des.path.conf="$ES_PATH_CONF" \
     -cp "$ES_CLASSPATH" \
     org.elasticsearch.bootstrap.Elasticsearch \
     "$@" \

+ 2 - 2
distribution/src/main/resources/bin/elasticsearch-env

@@ -67,7 +67,7 @@ fi
 
 ${source.path.env}
 
-if [ -z "$CONF_DIR" ]; then
-  echo "CONF_DIR must be set to the configuration path"
+if [ -z "$ES_PATH_CONF" ]; then
+  echo "ES_PATH_CONF must be set to the configuration path"
   exit 1
 fi

+ 2 - 2
distribution/src/main/resources/bin/elasticsearch-env.bat

@@ -44,6 +44,6 @@ if not "%JAVA_OPTS%" == "" (
 rem check the Java version
 %JAVA% -cp "%ES_CLASSPATH%" "org.elasticsearch.tools.JavaVersionChecker" || exit /b 1
 
-if "%CONF_DIR%" == "" (
-  set CONF_DIR=!ES_HOME!\config
+if "%ES_PATH_CONF%" == "" (
+  set ES_PATH_CONF=!ES_HOME!\config
 )

+ 1 - 1
distribution/src/main/resources/bin/elasticsearch-keystore

@@ -6,7 +6,7 @@ exec \
   "$JAVA" \
   $ES_JAVA_OPTS \
   -Des.path.home="$ES_HOME" \
-  -Des.path.conf="$CONF_DIR" \
+  -Des.path.conf="$ES_PATH_CONF" \
   -cp "$ES_CLASSPATH" \
   org.elasticsearch.common.settings.KeyStoreCli \
   "$@"

+ 1 - 1
distribution/src/main/resources/bin/elasticsearch-keystore.bat

@@ -7,7 +7,7 @@ call "%~dp0elasticsearch-env.bat" || exit /b 1
 %JAVA% ^
   %ES_JAVA_OPTS% ^
   -Des.path.home="%ES_HOME%" ^
-  -Des.path.conf="%CONF_DIR%" ^
+  -Des.path.conf="%ES_PATH_CONF%" ^
   -cp "%ES_CLASSPATH%" ^
   org.elasticsearch.common.settings.KeyStoreCli ^
   %*

+ 1 - 1
distribution/src/main/resources/bin/elasticsearch-plugin

@@ -6,7 +6,7 @@ exec \
   "$JAVA" \
   $ES_JAVA_OPTS \
   -Des.path.home="$ES_HOME" \
-  -Des.path.conf="$CONF_DIR" \
+  -Des.path.conf="$ES_PATH_CONF" \
   -cp "$ES_CLASSPATH" \
   org.elasticsearch.plugins.PluginCli \
   "$@"

+ 1 - 1
distribution/src/main/resources/bin/elasticsearch-plugin.bat

@@ -7,7 +7,7 @@ call "%~dp0elasticsearch-env.bat" || exit /b 1
 %JAVA% ^
   %ES_JAVA_OPTS% ^
   -Des.path.home="%ES_HOME%" ^
-  -Des.path.conf="%CONF_DIR%" ^
+  -Des.path.conf="%ES_PATH_CONF%" ^
   -cp "%ES_CLASSPATH%" ^
   org.elasticsearch.plugins.PluginCli ^
   %*

+ 2 - 2
distribution/src/main/resources/bin/elasticsearch-service.bat

@@ -97,7 +97,7 @@ if exist "%JAVA_HOME%\bin\server\jvm.dll" (
 )
 
 :foundJVM
-set ES_JVM_OPTIONS=%CONF_DIR%\jvm.options
+set ES_JVM_OPTIONS=%ES_PATH_CONF%\jvm.options
 
 if not "%ES_JAVA_OPTS%" == "" set ES_JAVA_OPTS=%ES_JAVA_OPTS: =;%
 
@@ -174,7 +174,7 @@ if "%JVM_SS%" == "" (
   goto:eof
 )
 
-set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%CONF_DIR%"
+set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%"
 
 if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual
 if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0

+ 1 - 1
distribution/src/main/resources/bin/elasticsearch-translog

@@ -6,7 +6,7 @@ exec \
   "$JAVA" \
   $ES_JAVA_OPTS \
   -Des.path.home="$ES_HOME" \
-  -Des.path.conf="$CONF_DIR" \
+  -Des.path.conf="$ES_PATH_CONF" \
   -cp "$ES_CLASSPATH" \
   org.elasticsearch.index.translog.TranslogToolCli \
   "$@"

+ 1 - 1
distribution/src/main/resources/bin/elasticsearch-translog.bat

@@ -7,7 +7,7 @@ call "%~dp0elasticsearch-env.bat" || exit /b 1
 %JAVA% ^
   %ES_JAVA_OPTS% ^
   -Des.path.home="%ES_HOME%" ^
-  -Des.path.conf="%CONF_DIR%" ^
+  -Des.path.conf="%ES_PATH_CONF%" ^
   -cp "%ES_CLASSPATH%" ^
   org.elasticsearch.index.translog.TranslogToolCli ^
   %*

+ 2 - 2
distribution/src/main/resources/bin/elasticsearch.bat

@@ -40,7 +40,7 @@ IF ERRORLEVEL 1 (
 	EXIT /B %ERRORLEVEL%
 )
 
-set "ES_JVM_OPTIONS=%CONF_DIR%\jvm.options"
+set "ES_JVM_OPTIONS=%ES_PATH_CONF%\jvm.options"
 
 @setlocal
 rem extract the options from the JVM options file %ES_JVM_OPTIONS%
@@ -48,6 +48,6 @@ rem such options are the lines beginning with '-', thus "findstr /b"
 for /F "usebackq delims=" %%a in (`findstr /b \- "%ES_JVM_OPTIONS%"`) do set JVM_OPTIONS=!JVM_OPTIONS! %%a
 @endlocal & set ES_JAVA_OPTS=%JVM_OPTIONS% %ES_JAVA_OPTS%
 
-%JAVA% %ES_JAVA_OPTS% -Delasticsearch -Des.path.home="%ES_HOME%" -Des.path.conf="%CONF_DIR%" -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams!
+%JAVA% %ES_JAVA_OPTS% -Delasticsearch -Des.path.home="%ES_HOME%" -Des.path.conf="%ES_PATH_CONF%" -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams!
 
 endlocal

+ 1 - 1
docs/plugins/plugin-script.asciidoc

@@ -172,7 +172,7 @@ can do this as follows:
 
 [source,sh]
 ---------------------
-sudo CONF_DIR=/path/to/conf/dir bin/elasticsearch-plugin install <plugin name>
+sudo ES_PATH_CONF=/path/to/conf/dir bin/elasticsearch-plugin install <plugin name>
 ---------------------
 
 [float]

+ 11 - 2
docs/reference/migration/migrate_6_0/packaging.asciidoc

@@ -16,9 +16,18 @@ Previous versions of Elasticsearch enabled setting `path.conf` as a
 setting. This was rather convoluted as it meant that you could start
 Elasticsearch with a config file that specified via `path.conf` that
 Elasticsearch should use another config file. Instead, to configure a custom
-config directory, use the <<config-files-location,`CONF_DIR` environment
+config directory, use the <<config-files-location,`ES_PATH_CONF` environment
 variable>>.
 
+==== `CONF_DIR` is no longer supported
+
+Previous versions of Elasticsearch enabled using the `CONF_DIR` environment
+variable to specify a custom configuration directory for some configuration
+files and some scripts (it was used inconsistently). Starting in Elasticsearch
+6.0.0, the usage of this environment variable has been superceded by
+`ES_PATH_CONF`, and this new environment variable is consistently used for all
+configuration files and scripts.
+
 ==== Default path settings are removed
 
 Previous versions of Elasticsearch enabled setting `default.path.data` and
@@ -56,7 +65,7 @@ are no longer maintaining this attempt.
 
 The environment variable `ES_JVM_OPTIONS` that enabled a custom location for the
 `jvm.options` file has been removed in favor of using the environment variable
-`CONF_DIR`. This environment variable is already used in the packaging to
+`ES_PATH_CONF`. This environment variable is already used in the packaging to
 support relocating the configuration files so this change merely aligns the
 other configuration files with the location of the `jvm.options` file.
 

+ 6 - 6
docs/reference/setup/configuration.asciidoc

@@ -25,24 +25,24 @@ on whether or not the installation is from an archive distribution (`tar.gz` or
 
 For the archive distributions, the config directory location defaults to
 `$ES_HOME/config`. The location of the config directory can be changed via the
-`CONF_DIR` environment variable as follows:
+`ES_PATH_CONF` environment variable as follows:
 
 [source,sh]
 -------------------------------
-CONF_DIR=/path/to/my/config ./bin/elasticsearch
+ES_PATH_CONF=/path/to/my/config ./bin/elasticsearch
 -------------------------------
 
-Alternatively, you can `export` the `CONF_DIR` environment variable via the
+Alternatively, you can `export` the `ES_PATH_CONF` environment variable via the
 command line or via your shell profile.
 
 For the package distributions, the config directory location defaults to
 `/etc/elasticsearch`. The location of the config directory can also be changed
-via the `CONF_DIR` environment variable, but note that setting this in your
+via the `ES_PATH_CONF` environment variable, but note that setting this in your
 shell is not sufficient. Instead, this variabled is sourced from
 `/etc/default/elasticsearch` (for the Debian package) and
 `/etc/sysconfig/elasticsearch` (for the RPM package). You will need to edit the
-`CONF_DIR=/etc/elasticsearch` entry in one of these files accordingly to change
-the config directory location.
+`ES_PATH_CONF=/etc/elasticsearch` entry in one of these files accordingly to
+change the config directory location.
 
 
 [float]

+ 1 - 1
docs/reference/setup/install/deb.asciidoc

@@ -197,7 +197,7 @@ locations for a Debian-based system:
 | conf
   | Configuration files including `elasticsearch.yml`
   | /etc/elasticsearch
-  | <<config-files-location,CONF_DIR>>
+  | <<config-files-location,ES_PATH_CONF>>
 
 | conf
   | Environment variables including heap size, file descriptors.

+ 1 - 1
docs/reference/setup/install/rpm.asciidoc

@@ -185,7 +185,7 @@ locations for an RPM-based system:
 | conf
   | Configuration files including `elasticsearch.yml`
   | /etc/elasticsearch
-  | <<config-files-location,CONF_DIR>>
+  | <<config-files-location,ES_PATH_CONF>>
 
 | conf
   | Environment variables including heap size, file descriptors.

+ 4 - 3
docs/reference/setup/install/sysconfig-file.asciidoc

@@ -21,10 +21,11 @@
     about `max_map_count`. This is set via `sysctl` before starting
     elasticsearch. Defaults to `262144`.
 
-`CONF_DIR`::
+`ES_PATH_CONF`::
 
-    Configuration file directory (which needs to include `elasticsearch.yml`
-    and `log4j2.properties` files), defaults to `/etc/elasticsearch`.
+    Configuration file directory (which needs to include `elasticsearch.yml`,
+    `jvm.options`, and `log4j2.properties` files); defaults to
+    `/etc/elasticsearch`.
 
 `ES_JAVA_OPTS`::
 

+ 1 - 1
docs/reference/setup/install/zip-targz.asciidoc

@@ -164,7 +164,7 @@ directory so that you do not delete important data later on.
 | conf
   | Configuration files including `elasticsearch.yml`
   | $ES_HOME/config
-  | <<config-files-location,CONF_DIR>>
+  | <<config-files-location,ES_PATH_CONF>>
 
 | data
   | The location of the data files of each index / shard allocated

+ 5 - 4
docs/reference/setup/install/zip-windows.asciidoc

@@ -169,10 +169,11 @@ The Elasticsearch service can be configured prior to installation by setting the
     via the setting `path.logs` in the `elasticsearch.yml` configuration file,
     or on the command line.
 
-`CONF_DIR`::
+`ES_PATH_CONF`::
 
-    Configuration file directory (which needs to include `elasticsearch.yml`
-    and `log4j2.properties` files), defaults to `%ES_HOME%\conf`.
+    Configuration file directory (which needs to include `elasticsearch.yml`,
+    `jvm.options`, and `log4j2.properties` files), defaults to
+    `%ES_HOME%\config`.
 
 `ES_JAVA_OPTS`::
 
@@ -234,7 +235,7 @@ directory so that you do not delete important data later on.
 | conf
   | Configuration files including `elasticsearch.yml`
   | %ES_HOME%\config
-  | <<config-files-location,CONF_DIR>>
+  | <<config-files-location,ES_PATH_CONF>>
 
 | data
   | The location of the data files of each index / shard allocated

+ 3 - 2
docs/reference/setup/rolling_upgrade.asciidoc

@@ -68,7 +68,7 @@ default.
 
 It is a good idea to place these directories in a different location so that
 there is no chance of deleting them when upgrading Elasticsearch.  These custom
-paths can be <<path-settings,configured>> with the `CONF_DIR` environment
+paths can be <<path-settings,configured>> with the `ES_PATH_CONF` environment
 variable, and the `path.logs`, and `path.data` settings.
 
 The <<deb,Debian>> and <<rpm,RPM>> packages place these directories in the
@@ -89,7 +89,8 @@ To upgrade using a zip or compressed tarball:
 
 *   Either copy the files in the `config` directory from your old installation
     to your new installation, or set the environment variable
-    <<config-files-location,`CONF_DIR`>> to point to a custom config directory.
+    <<config-files-location,`ES_PATH_CONF`>> to point to a custom config
+    directory.
 
 *   Either copy the files in the `data` directory from your old installation
     to your new installation, or configure the location of the data directory

+ 3 - 3
qa/vagrant/src/test/resources/packaging/tests/20_tar_package.bats

@@ -111,7 +111,7 @@ setup() {
 
 @test "[TAR] start Elasticsearch with custom JVM options" {
     local es_java_opts=$ES_JAVA_OPTS
-    local conf_dir=$CONF_DIR
+    local es_path_conf=$ES_PATH_CONF
     local temp=`mktemp -d`
     cp "$ESCONFIG"/elasticsearch.yml "$temp"
     cp "$ESCONFIG"/log4j2.properties "$temp"
@@ -123,13 +123,13 @@ setup() {
     # manager exception before we have configured logging; this will fail
     # startup since we detect usages of logging before it is configured
     echo "-Dlog4j2.disable.jmx=true" >> "$temp/jvm.options"
-    export CONF_DIR="$temp"
+    export ES_PATH_CONF="$temp"
     export ES_JAVA_OPTS="-XX:-UseCompressedOops"
     start_elasticsearch_service
     curl -s -XGET localhost:9200/_nodes | fgrep '"heap_init_in_bytes":536870912'
     curl -s -XGET localhost:9200/_nodes | fgrep '"using_compressed_ordinary_object_pointers":"false"'
     stop_elasticsearch_service
-    export CONF_DIR=$CONF_DIR
+    export ES_PATH_CONF=$es_path_conf
     export ES_JAVA_OPTS=$es_java_opts
 }
 

+ 1 - 1
qa/vagrant/src/test/resources/packaging/tests/60_systemd.bats

@@ -201,7 +201,7 @@ setup() {
     # startup since we detect usages of logging before it is configured
     echo "-Dlog4j2.disable.jmx=true" >> "$temp/jvm.options"
     cp $ESENVFILE "$temp/elasticsearch"
-    echo "CONF_DIR=\"$temp\"" >> $ESENVFILE
+    echo "ES_PATH_CONF=\"$temp\"" >> $ESENVFILE
     echo "ES_JAVA_OPTS=\"-XX:-UseCompressedOops\"" >> $ESENVFILE
     service elasticsearch start
     wait_for_elasticsearch_status

+ 1 - 1
qa/vagrant/src/test/resources/packaging/tests/70_sysv_initd.bats

@@ -132,7 +132,7 @@ setup() {
     # startup since we detect usages of logging before it is configured
     echo "-Dlog4j2.disable.jmx=true" >> "$temp/jvm.options"
     cp $ESENVFILE "$temp/elasticsearch"
-    echo "CONF_DIR=\"$temp\"" >> $ESENVFILE
+    echo "ES_PATH_CONF=\"$temp\"" >> $ESENVFILE
     echo "ES_JAVA_OPTS=\"-XX:-UseCompressedOops\"" >> $ESENVFILE
     service elasticsearch start
     wait_for_elasticsearch_status

+ 3 - 3
qa/vagrant/src/test/resources/packaging/tests/module_and_plugin_test_cases.bash

@@ -117,11 +117,11 @@ fi
 
     move_config
 
-    CONF_DIR="$ESCONFIG" install_jvm_example
-    CONF_DIR="$ESCONFIG" start_elasticsearch_service
+    ES_PATH_CONF="$ESCONFIG" install_jvm_example
+    ES_PATH_CONF="$ESCONFIG" start_elasticsearch_service
     diff  <(curl -s localhost:9200/_cat/configured_example | sed 's/ //g') <(echo "foo")
     stop_elasticsearch_service
-    CONF_DIR="$ESCONFIG" remove_jvm_example
+    ES_PATH_CONF="$ESCONFIG" remove_jvm_example
 }
 
 @test "[$GROUP] install jvm-example plugin from a directory with a space" {

+ 3 - 3
qa/vagrant/src/test/resources/packaging/utils/plugins.bash

@@ -38,11 +38,11 @@ install_plugin() {
 
     assert_file_exist "$path"
 
-    if [ ! -z "$CONF_DIR" ] ; then
+    if [ ! -z "$ES_PATH_CONF" ] ; then
         if is_dpkg; then
-            echo "CONF_DIR=$CONF_DIR" >> /etc/default/elasticsearch;
+            echo "ES_PATH_CONF=$ES_PATH_CONF" >> /etc/default/elasticsearch;
         elif is_rpm; then
-            echo "CONF_DIR=$CONF_DIR" >> /etc/sysconfig/elasticsearch;
+            echo "ES_PATH_CONF=$ES_PATH_CONF" >> /etc/sysconfig/elasticsearch;
         fi
     fi
 

+ 5 - 5
qa/vagrant/src/test/resources/packaging/utils/utils.bash

@@ -335,12 +335,12 @@ start_elasticsearch_service() {
 run_elasticsearch_service() {
     local expectedStatus=$1
     local commandLineArgs=$2
-    # Set the CONF_DIR setting in case we start as a service
-    if [ ! -z "$CONF_DIR" ] ; then
+    # Set the ES_PATH_CONF setting in case we start as a service
+    if [ ! -z "$ES_PATH_CONF" ] ; then
         if is_dpkg; then
-            echo "CONF_DIR=$CONF_DIR" >> /etc/default/elasticsearch;
+            echo "ES_PATH_CONF=$ES_PATH_CONF" >> /etc/default/elasticsearch;
         elif is_rpm; then
-            echo "CONF_DIR=$CONF_DIR" >> /etc/sysconfig/elasticsearch;
+            echo "ES_PATH_CONF=$ES_PATH_CONF" >> /etc/sysconfig/elasticsearch;
         fi
     fi
 
@@ -362,7 +362,7 @@ run_elasticsearch_service() {
 # This line is attempting to emulate the on login behavior of /usr/share/upstart/sessions/jayatana.conf
 [ -f /usr/share/java/jayatanaag.jar ] && export JAVA_TOOL_OPTIONS="-javaagent:/usr/share/java/jayatanaag.jar"
 # And now we can start Elasticsearch normally, in the background (-d) and with a pidfile (-p).
-export CONF_DIR=$CONF_DIR
+export ES_PATH_CONF=$ES_PATH_CONF
 export ES_JAVA_OPTS=$ES_JAVA_OPTS
 $timeoutCommand/tmp/elasticsearch/bin/elasticsearch $background -p /tmp/elasticsearch/elasticsearch.pid $commandLineArgs
 BASH