Failed to resolve config path [“/usr/share/elasticsearch/config/elasticsearch.yml”]

Al finalizar la instalación de elasticsearch decidí instalar los plugins:

  • mobz/elasticsearch-head
  • royrusso/elasticsearch-HQ

Pero por alguna razon, el comando no se ejecutaba correctamente y me arrojaba el siguiente error:

root@srvhadoopt3:~# /usr/share/elasticsearch/bin/plugin install -DproxyPort=8080 -DproxyHost=proxgue.garba.com.ar royrusso/elasticsearch-HQ
Error: Could not find or load main class "-DproxyPort=8080"
root@srvhadoopt3:~# /usr/share/elasticsearch/bin/plugin install DproxyPort=8080 DproxyHost=proxgue.garba.com.ar royrusso/elasticsearch-HQ
Exception in thread "main" org.elasticsearch.env.FailedToResolveConfigException: Failed to resolve config path ["/usr/share/elasticsearch/config/elasticsearch.yml"], tried file path ["/usr/share/elasticsearch/config/elasticsearch.yml"], path file ["/usr/share/elasticsearch/config"/"/usr/share/elasticsearch/config/elasticsearch.yml"], and classpath
at org.elasticsearch.env.Environment.resolveConfig(Environment.java:291)
at org.elasticsearch.node.internal.InternalSettingsPreparer.prepareSettings(InternalSettingsPreparer.java:95)
at org.elasticsearch.plugins.PluginManager.main(PluginManager.java:396)

Análisis

Investigando y analizando la salida de la ejecución del comando, con bash -x por delante, mas los concejos de gente de la comunidad, decidimos cambiar en el script el comando exec y reemplazarlo con el comando echo.

Ese cambio,  me retorno la sentencia para ser ejecutada.

Resolución

Editamos el archivo de configuración /usr/share/elasticsearch/bin/plugin, y vamos al final del mismo y realizamos el cambio del comando exec por comando echo

root@srvhadoopt3:~# vi /usr/share/elasticsearch/bin/plugin

Modificación

export HOSTNAME=`hostname -s`

exec "$JAVA" $JAVA_OPTS $ES_JAVA_OPTS -Xmx64m -Xms16m -Delasticsearch -Des.path.home=\""$ES_HOME"\" $properties -cp \""$ES_CLASSPATH"\" org.elasticsearch.plugins.PluginManager $args

Veamos los resultados:

  1. Ejecutamos el comando , con el echo incorporado.
  2. Nos deja en el output el comando a ejecutar, una gran linea.
  3. Ejecutamos esa linea.
root@srvhadoopt3:~# /usr/share/elasticsearch/bin/plugin install -DproxyHost=proxgue.garba.com.ar -DproxyPort=8080 royrusso/elasticsearch-HQ

/usr/lib/jvm/java-8-oracle/bin/java -Xmx64m -Xms16m -Delasticsearch -Des.path.home="/usr/share/elasticsearch" "-
DproxyHost=proxgue.garba.com.ar" "-DproxyPort=8080" -Des.default.path.conf="/usr/share/elasticsearch/config" -
Des.default.config="/usr/share/elasticsearch/config/elasticsearch.yml" -cp ":/usr/share/java/lucene-misc-4.10.4.jar:/usr/share/java/lucene-
test-framework-4.10.4.jar:/usr/share/java/groovy-all-2.x.jar:/usr/share/java/lucene-suggest-4.10.4.jar:/usr/share/java/lucene-memory-
4.10.4.jar:/usr/share/java/lucene-facet-4.10.4.jar:/usr/share/java/lucene-classification-4.10.4.jar:/usr/share/java/lucene-highlighter-
4.10.4.jar:/usr/share/java/lucene-codecs-4.10.4.jar:/usr/share/java/lucene-queries-4.10.4.jar:/usr/share/java/lucene-sandbox-
4.10.4.jar:/usr/share/java/lucene-analyzers-smartcn-4.10.4.jar:/usr/share/java/jts.jar:/usr/share/java/lucene-benchmark-
4.10.4.jar:/usr/share/java/lucene-queryparser-4.10.4.jar:/usr/share/java/lucene-analyzers-uima-4.10.4.jar:/usr/share/java/lucene-join-
4.10.4.jar:/usr/share/java/lucene-analyzers-stempel-4.10.4.jar:/usr/share/java/apache-log4j-extras-1.2.17.jar:/usr/share/java/spatial4j-
0.4.1.jar:/usr/share/java/log4j-1.2-1.2.17.jar:/usr/share/java/lucene-analyzers-common-
4.10.4.jar:/usr/share/java/jna.jar:/usr/share/java/lucene-spatial-4.10.4.jar:/usr/share/java/lucene-core-4.10.4.jar:/usr/share/java/lucene-
analyzers-morfologik-4.10.4.jar:/usr/share/java/lucene-grouping-4.10.4.jar:/usr/share/java/lucene-analyzers-kuromoji-
4.10.4.jar:/usr/share/java/elasticsearch-1.7.3.jar:/usr/share/java/lucene-analyzers-phonetic-4.10.4.jar:/usr/share/java/lucene-analyzers-
icu-4.10.4.jar:/usr/share/java/lucene-replicator-4.10.4.jar:/usr/share/java/lucene-expressions-4.10.4.jar:/usr/share/java/lucene-demo-
4.10.4.jar:/usr/share/java/sigar.jar:" org.elasticsearch.plugins.PluginManager "install" "royrusso/elasticsearch-HQ"

Aplicamos el output del comando

Al aplicar la salida del comando que obtuvimos anteriormente, pudimos observar que se ejecuto sin problemas.

root@srvhadoopt3:~# /usr/lib/jvm/java-8-oracle/bin/java -Xmx64m -Xms16m -Delasticsearch -Des.path.home="/usr/share/elasticsearch" "-
DproxyHost=proxgue.garba.com.ar" "-DproxyPort=8080" -Des.default.path.conf="/usr/share/elasticsearch/config" -
Des.default.config="/usr/share/elasticsearch/config/elasticsearch.yml" -cp ":/usr/share/java/lucene-misc-4.10.4.jar:/usr/share/java/lucene-
test-framework-4.10.4.jar:/usr/share/java/groovy-all-2.x.jar:/usr/share/java/lucene-suggest-4.10.4.jar:/usr/share/java/lucene-memory-
4.10.4.jar:/usr/share/java/lucene-facet-4.10.4.jar:/usr/share/java/lucene-classification-4.10.4.jar:/usr/share/java/lucene-highlighter-
4.10.4.jar:/usr/share/java/lucene-codecs-4.10.4.jar:/usr/share/java/lucene-queries-4.10.4.jar:/usr/share/java/lucene-sandbox-
4.10.4.jar:/usr/share/java/lucene-analyzers-smartcn-4.10.4.jar:/usr/share/java/jts.jar:/usr/share/java/lucene-benchmark-
4.10.4.jar:/usr/share/java/lucene-queryparser-4.10.4.jar:/usr/share/java/lucene-analyzers-uima-4.10.4.jar:/usr/share/java/lucene-join-
4.10.4.jar:/usr/share/java/lucene-analyzers-stempel-4.10.4.jar:/usr/share/java/apache-log4j-extras-1.2.17.jar:/usr/share/java/spatial4j-
0.4.1.jar:/usr/share/java/log4j-1.2-1.2.17.jar:/usr/share/java/lucene-analyzers-common-
4.10.4.jar:/usr/share/java/jna.jar:/usr/share/java/lucene-spatial-4.10.4.jar:/usr/share/java/lucene-core-4.10.4.jar:/usr/share/java/lucene-
analyzers-morfologik-4.10.4.jar:/usr/share/java/lucene-grouping-4.10.4.jar:/usr/share/java/lucene-analyzers-kuromoji-
4.10.4.jar:/usr/share/java/elasticsearch-1.7.3.jar:/usr/share/java/lucene-analyzers-phonetic-4.10.4.jar:/usr/share/java/lucene-analyzers-
icu-4.10.4.jar:/usr/share/java/lucene-replicator-4.10.4.jar:/usr/share/java/lucene-expressions-4.10.4.jar:/usr/share/java/lucene-demo-
4.10.4.jar:/usr/share/java/sigar.jar:" org.elasticsearch.plugins.PluginManager "install" "royrusso/elasticsearch-HQ"
-> Installing royrusso/elasticsearch-HQ...
Trying https://github.com/royrusso/elasticsearch-HQ/archive/master.zip...
Downloading 
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................................................................................................................
...........................................DONE

Installed royrusso/elasticsearch-HQ into /usr/share/elasticsearch/plugins/HQ
Identified as a _site plugin, moving to _site structure ...
root@srvhadoopt3:~#

Así es como pude instalar los plugins necesarios.

Acerca de Juan Andres Mercado

Big Data Enthusiast, DBA & Exadata Manager | Consultant | Father | Musician | Farmer | Environmentalist Argentina | juanmercadoit.com
Esta entrada fue publicada en BI, Big Data, Linux, Oracle 12c y etiquetada , , , . Guarda el enlace permanente.