Elasticsearch Plugins2

2022-02-11 16:24:36 浏览数 (1)

plugin的目录

plugin默认地址为安装目录的 ./plugins

代码语言:javascript复制
[root@h102 elasticsearch]# rpm -ql elasticsearch-2.1.1-1.noarch | grep plugin
/usr/share/elasticsearch/bin/plugin
/usr/share/elasticsearch/plugins
[root@h102 elasticsearch]# ll  /usr/share/elasticsearch/plugins
total 0
[root@h102 elasticsearch]# 

Tip: 由于没有插件,所以是空的

但是可以在 elasticsearch.yml 中进行修改

代码语言:javascript复制
path.plugins: /path/to/custom/plugins/dir

可以在 elasticsearch.yml 中设定强制要求的plugins

代码语言:javascript复制
plugin.mandatory: mapper-attachments,lang-python

设定之后,如果缺少指定的plugin,ES是不会启动的


安装plugin

详细的安装方法可以使用下面命令进行查看,也可以参考 plugin安装方法

代码语言:javascript复制
[root@h102 elasticsearch]# /usr/share/elasticsearch/bin/plugin install -h

安装head插件

代码语言:javascript复制
[root@h102 elasticsearch]# /usr/share/elasticsearch/bin/plugin install mobz/elasticsearch-head 
-> Installing mobz/elasticsearch-head...
Trying https://github.com/mobz/elasticsearch-head/archive/master.zip ...
Downloading ..................................................................................................................................................................................................................................................................................DONE
Verifying https://github.com/mobz/elasticsearch-head/archive/master.zip checksums if available ...
NOTE: Unable to verify checksum for downloaded plugin (unable to find .sha1 or .md5 file to verify)
Installed head into /usr/share/elasticsearch/plugins/head
[root@h102 elasticsearch]# echo $?
0
[root@h102 elasticsearch]# /usr/share/elasticsearch/bin/plugin list
Installed plugins in /usr/share/elasticsearch/plugins:
    - head
[root@h102 elasticsearch]# ll  /usr/share/elasticsearch/plugins
total 4
drwxr-xr-x 5 root root 4096 Dec 30 22:04 head
[root@h102 elasticsearch]#

于是使用网页浏览 http://localhost:9200/_plugin/head/ 就可以看到下列界面

通过点击不同选项卡,和不同分片,可以看到相关信息

目前只能使用localhost进行访问,下面打开外部的访问

0 人点赞