So I'm running Elasticsearch on Windows and I am separating the Elasticsearch node configuration from Elasticsearch itself with the following structure:
- This is where Elasticsearch lives and we utilize the \plugins directory since they're version-specific.
- Within here, we use \config, \data, \logs, and \work
I am configuring the following environment variables on the server:
setx JAVA_HOME "D:\java\jre8" setx DATA_DIR "D:\elasticsearch-node\data" setx LOG_DIR "D:\elasticsearch-node\logs" setx CONF_DIR "D:\elasticsearch-node\config" setx ES_MIN_MEM "8g" setx ES_MAX_MEM "8g"
When installing Shield, it is tossing the /shield configuration folder within D:\elasticsearch\elasticsearch-2.3.0\config rather than my defined D:\elasticsearch-node\config as overridden with the environment variable.
It appears that Elasticsearch itself is looking for the Shield configuration within %CONF_DIR%, but when running esusers to add an initial admin, it is getting written to D:\elasticsearch\elasticsearch-2.3.0\config
I believe to correct this, you would just need to check for the environment variable and add an additional value to the ES_PARAMS within .in.bat for Shield.
if "%CONF_DIR%" == "" set CONF_DIR=%ES_HOME%\config
set ES_PARAMS=-Des.path.home="%ES_HOME%" -Des.default.path.conf="%CONF_DIR%"