Unable install any plugin to elastic

[root@elastic01 ~]# /usr/share/elasticsearch/bin/plugin
Error: Could not find or load main class org.elasticsearch.plugins.PluginManagerCliParser

early i was change /etc/sysconfig/elasticsearch:

ES_HOME=/home/elasticsearch
CONF_DIR=/etc/elasticsearch
DATA_DIR=/home/elasticsearch/lib

This may be the reason?

Hey,

I assume that setting ES_HOME to /home/elasticsearch/ is the culprit. This means you are expecting your installation to be there, including the libraries.

You can verify by setting set -x in /usr/share/elasticsearch/bin/plugin in the second line and see which paths are being used when before the plugin manager is executed.

--Alex

Thank you!
i change

CONF_DIR=/etc/elasticsearch
DATA_DIR=/home/elasticsearch/lib

ES_HOME default

all ok now