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
This commit is contained in:
parent
62021147ea
commit
e9687622bd
|
@ -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')
|
||||
}
|
||||
|
|
|
@ -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':
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
|
|
@ -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 \
|
||||
"$@" \
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
)
|
||||
|
|
|
@ -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 \
|
||||
"$@"
|
||||
|
|
|
@ -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 ^
|
||||
%*
|
||||
|
|
|
@ -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 \
|
||||
"$@"
|
||||
|
|
|
@ -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 ^
|
||||
%*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
"$@"
|
||||
|
|
|
@ -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 ^
|
||||
%*
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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`::
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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" {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue