Elasticsearch plugin.window.search is red怎么解决

问题对人有帮助,内容完整,我也想知道答案
问题没有实际价值,缺少关键内容,没有改进余地
1.系统环境: ubuntu12.04
elasticsearch5.11 node 7.2.1 npm 4.05 2.安装elasticsearch之后,可以启动,能够访问返回代码:{
"name" : "D7ff-uK",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "bl9WuKWVQ6m0TAxHM3UhgA",
"version" : {
"number" : "5.1.1",
"build_hash" : "5395e21",
"build_date" : "T12:36:15.409Z",
"build_snapshot" : false,
"lucene_version" : "6.3.0"
"tagline" : "You Know, for Search"}
只在一台主机上安装,只有一个节点。
但是安装完插件head之后,elasticsearch不能启动出现报错.
3.head插件安装,启动之后能够启动,能够使用网址访问到相应的界面。
4.报错内容为:T07:51:20,581[o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: Property [elasticsearch.version] is missing for plugin [head]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.cli.SettingCommand.execute(SettingCommand.java:54) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.mand.mainWithoutErrorHandling(Command.java:96) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.mand.main(Command.java:62) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:89) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:82) ~[elasticsearch-5.1.1.jar:5.1.1]
Caused by: java.lang.IllegalArgumentException: Property [elasticsearch.version] is missing for plugin [head]
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:104) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.plugins.PluginsService.getPluginBundles(PluginsService.java:292) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.plugins.PluginsService.&init&(PluginsService.java:131) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.node.Node.&init&(Node.java:294) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.node.Node.&init&(Node.java:229) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Bootstrap$6.&init&(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:306) ~[elasticsearch-5.1.1.jar:5.1.1]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-5.1.1.jar:5.1.1]
... 6 more
这是什么原因造成的呢?求大神们答疑解惑!
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
遇到同样问题,mark
该答案已被忽略,原因:无意义的内容 - 赞、顶、同问等毫无意义的内容
答案对人有帮助,有参考价值
答案没帮助,是错误的答案,答非所问
5.1中,elasticsearch-head
不能放在elasticsearch的 plugins、modules 目录下
不能使用 elasticsearch-plugin install
直接启动elasticsearch即可
安装 elasticsearch-head
修改 elasticsearch/config/elasticsearch.yml
http.cors.enabled: true
http.cors.allow-origin: "*"
下载 elasticsearch-head 或者
到随便一个文件夹
安装nodejs
cd /path/to/elasticsearch-head
npm install -g grunt-cli
npm install
grunt server
http://localhost:9100/
分享到微博?
关闭理由:
删除理由:
忽略理由:
推广(招聘、广告、SEO 等)方面的内容
与已有问题重复(请编辑该提问指向已有相同问题)
答非所问,不符合答题要求
宜作评论而非答案
带有人身攻击、辱骂、仇恨等违反条款的内容
无法获得确切结果的问题
非开发直接相关的问题
非技术提问的讨论型问题
其他原因(请补充说明)
我要该,理由是:Elasticsearch几个问题的解决
今天惯例看统计报表, 才发现es集群悲剧了......昨天下午到今天早上, 持续报错, 写了1G的错误日志&_&#(暂无监控....)
当前状态: 单台机器, 单节点(空集群), 200W 数据, 500+shrads,
以下是几个问题的处理过程
大量unassigned shards
其实刚搭完运行时就是status: yellow(所有主分片可用,但存在不可用的从分片), 只有一个节点, 主分片启动并运行正常, 可以成功处理请求, 但是存在unassigned_shards, 即存在没有被分配到节点的从分片.(只有一个节点.....)
.当时数据量小, 就暂时没关注. 然后, 随着时间推移,
出现了大量unassigned shards
curl -XGET http://localhost:9200/_cluster/health\?pretty
"cluster_name" : "elasticsearch",
"status" : "yellow",
"timed_out" : false,
"number_of_nodes" : 2,
"number_of_data_nodes" : 1,
"active_primary_shards" : 538,
"active_shards" : 538,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 558,
"number_of_pending_tasks" : 0
找了台内网机器, 部署另一个节点(保证一致即可, 自动发现, 赞一个). 当然, 如果你资源有限只有一台机器,
使用相同命令再启动一个es实例也行. 再次检查集群健康, 发现unassigned_shards减少, active_shards增多.
操作完后, 集群健康从yellow恢复到 green
status: red
集群健康恶化了......
这次检查发现是status: red(存在不可用的主要分片)
curl -XGET http://localhost:9200/_cluster/health\?pretty
"cluster_name" : "elasticsearch",
"status" : "red",
// missing some primary shards
"timed_out" : false,
"number_of_nodes" : 4,
"number_of_data_nodes" : 2,
"active_primary_shards" : 538,
"active_shards" : 1076,
"relocating_shards" : 0,
"initializing_shards" : 0,
"unassigned_shards" : 20,
// where your lost primary shards are.
"number_of_pending_tasks" : 0
fix unassigned shards
开始着手修复
查看所有分片状态
curl -XGET http://localhost:9200/_cat/shards
找出UNASSIGNED分片
curl -s "http://localhost:9200/_cat/shards" | grep UNASSIGNED
3 p UNASSIGNED
3 r UNASSIGNED
1 p UNASSIGNED
1 r UNASSIGNED
查询得到master节点的唯一标识
curl 'localhost:9200/_nodes/process?pretty'
"cluster_name" : "elasticsearch",
"nodes" : {
"AfUyuXmGTESHXpwi4OExxx" : {
"name" : "Master",
"attributes" : {
"master" : "true"
执行reroute(分多次, 变更shard的值为UNASSIGNED查询结果中编号, 上一步查询结果是1和3)
curl -XPOST 'localhost:9200/_cluster/reroute' -d '{
"commands" : [ {
"allocate" : {
"index" : "pv-",
"shard" : 1,
"node" : "AfUyuXmGTESHXpwi4OExxx",
"allow_primary" : true
批量处理的脚本(当数量很多的话, 注意替换node的名字)
#!/bin/bash
for index in $(curl
-s 'http://localhost:9200/_cat/shards' | grep UNASSIGNED | awk '{print $1}' | sort | uniq); do
for shard in $(curl
-s 'http://localhost:9200/_cat/shards' | grep UNASSIGNED | grep $index | awk '{print $2}' | sort | uniq); do
$index $shard
curl -XPOST 'localhost:9200/_cluster/reroute' -d "{
'commands' : [ {
'allocate' : {
'index' : $index,
'shard' : $shard,
'node' : 'Master',
'allow_primary' : true
&Too many open files&
发现日志中大量出现这个错误
curl http://localhost:9200/_nodes/process\?pretty
"max_file_descriptors" : 4096,
官方文档中
Make sure to increase the number of open files descriptors on the machine (or for the user running elasticsearch). Setting it to 32k or even 64k is recommended.
而此时, 可以在系统级做修改, 然后全局生效
最简单的做法, 在bin/elasticsearch文件开始的位置加入
ulimit -n 64000
然后重启es, 再次查询看到
"max_file_descriptors" : 64000,
待续, 目测还有很多坑, 而且随着数据量上来, 会遇到越来越多的坑......
Copyright (C) 2015 wklken
Hosted on . Powered by . Social Icons by .相关文章推荐
第一个错误是:Exception in thread "main" ception: property [elasticsearch.version] is missing for plugin [h...
先 安装JDK
我这已安装
[root@iZ258cho4sfZ home]# java -version
java version "1.8.0_77"
Java(TM) SE Runtim...
一、elasticsearch-head插件介绍elasticsearch-head是一个用来浏览、与Elastic Search簇进行交互的web前端展示插件。elasticsearch-head插...
Elasticsearch is a highly scalable open-source full-text search and analytics engine. It allows you ...
今天在项目中集成hbase1.0.0-cdh5.5.2和ElasticSearch2.2.0时出现了问题,原先在集成hbase时,引入了架包com.google.guava(16.0版本),后来在集成...
这篇文章我们介绍一个非常好的工具:elasticsearch-head,从简单介绍,到安装,最后使用。...
elasticsearch-head是一个elasticsearch的集群管理工具,它是完全由html5编写的独立网页程序,你可以通过插件把它集成到es
插件安装方法1:
安装步骤:
elasticsearch-5.6.0
解压 到任意文件夹即可
2、安装部署head插件
2.1 (用git)下载插件:git clone git://gi...
elasticsearch5.0以下版本可以直接在elasticsearch目录下执行对应的命令安装head插件,但是5.0以上不支持直接安装,所以需要借助其他方法安装head插件,本篇介绍5.0以上...
他的最新文章
讲师:董晓杰
讲师:姚远
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)自由、创新、研究、探索
Linux/Windows Mono/DotNet [ Open Source .NET Development/ 使用开源工具进行DotNet软件开发]锐意进取,志存高远.成就梦想,只争朝夕.从你开始,创新世界.【That I exist is a perpetual supprise which is life. Focus on eCommerce】
  今天接着《》一文来给大家分享后续的学习,在《》中给大家介绍一个日志监控平台的架构方案,接下来给大家分享如何去搭建部署这样一个平台,给大家做一个入门介绍。下面是今天的分享目录:
搭建部署 Elastic 套件
  下面开始今天的内容分享。
2.搭建部署 Elastic 套件
  搭建 Elastic 套件较为简单,下面我们开始去搭建部署相关套件,首先我们准备必要的环境。
2.1 基础软件
  大家可以 Elastic 的官方网站下载对应的安装包,地址如下所示:
  另外,一个基础环境就是需要用到 JDK,ES 集群依赖 JDK,地址如下所示:
2.2&Logstash 部署
  这里我们将 Logstash 的服务部署在中心节点中,其核心配置文件如下所示:
central.conf
host =& "10.211.55.18"
port =& 6379
type =& "redis-input"
data_type =& "list"
key =& "key_count"
match =& ["message", "%{IPORHOST:client} (%{USER:ident}|-) (%{USER:auth}|-) \[%{HTTPDATE:timestamp}\] \"(?:%{WORD:verb} %{NOTSPACE:request}(?: HTTP/%{NUMBER:http_version})?|-)\" %{NUMBER:response} %{NUMBER:bytes} \"(%{QS:referrer}|-)\" \"(%{QS:agent}|-)\""]
source =& "request"
field_split =& "&?"
value_split =& "="
urldecode {
all_fields =& true
elasticsearch {
cluster =& "elasticsearch"
codec =& "json"
protocol =& "http"
  其代理节点,分别部署在日志生产节点之上,核心配置文件如下所示:
shipper.conf
type =& "type_count"
path =& ["/home/hadoop/dir/portal/t_customer_access.log"]
exclude =& ["*.gz", "access.log"]
host =& "10.211.55.18"
port =& 6379
data_type =& "list"
key =& "key_count"
2.3&Elasticsearch 部署
  接着,我们部署 ES 集群,配置较为简单,其配置内容如下所示:
elasticsearch.yml
node.name: "node1"
  这里我只配置了其节点名称信息,集群名称使用默认的,若大家需要配置其他信息可自行处理,需要注意的是,这里在实用 scp 命令分发到其他节点时,需要修改其属性值,保持每个节点的 node.name 值不一样即可。
  另外,在安装插件 ES 集群的相关插件时,可以使用以下命令:
sudo elasticsearch/bin/plugin -install mobz/elasticsearch-head
bigdesk 插件
sudo elasticsearch/bin/plugin -install lukas-vlcek/bigdesk
  其对应的 Web UI 界面如下图所示:
head插件的界面
bigdesk的界面
  关于其他的 ES 集群的插件,搭建可以根据实际业务需求进行选择性的安装,这里就不多赘述了。
2.4&Kibana 部署
  这里我们需要安装一个能够去可视化 ES 集群数据的工具,这里我们选择 Kibana 工具去可视化我们的数据,其安装较为简单,只需配置对应的核心文件即可,配置如下:
kibana.yml
elasticsearch_url: "http://10.211.55.18:9200"
  这里去可视化 node1 节点 ES 集群中数据。
3.运行集群
  接着,我们启动整个系统,启动步骤如下所示:
启动 Redis
[hadoop@dn1 ~]$ redis-server &
启动代理节点(分别在其代理节点启动shipper)
bin/logstash agent --verbose --config conf/shipper.conf --log logs/stdout.log &
启动中心服务
bin/logstash agent --verbose --config conf/central.conf --log logs/stdout.log &
启动 ES 集群(分别在 ES 节点启动)
bin/elasticsearch start
启动 Kibana 服务
bin/kibana
4.预览截图
  这里,我们可以预览收集的日志,日志信息我只抽取了几条,截图如下:
  我们还可以使用筛选功能,选取我们需要观察的数据结果,这里我们筛选了 IP 和 AppName 属性进行观察,如下图所示:
  这里需要注意的是,若是我们首次启动 Kibana 服务,收集日志信息为空的情况下,在我们创建索引时,Settings 模块下的界面中 Create 按钮会是灰色状态,导致无法创建,这里大家在创建的时候需要保证我们有日志已被收集存储到 ES 集群。如下图,由于我已收集存储日志到 ES 集群,所以按钮呈现绿色状态,供点击创建。如下图所示:
  这篇博客就和大家分享到这里,如果大家在研究学习的过程当中有什么问题,可以加群进行讨论或发送邮件给我,我会尽我所能为您解答,与君共勉!
联系方式:&邮箱:&QQ群(董的博客):&温馨提示:请大家加群的时候写上加群理由(姓名+公司/学校),方便管理员审核,谢谢!&
热爱生活,享受编程,与君共勉!
阅读(...) 评论()
随笔 - 16242
评论 - 1445powered by
Writing an Elasticsearch Plugin: Getting Started
UPDATE: This article refers to our hosted Elasticsearch offering by an older name, Found. Please note that Found is now known as Elastic Cloud.WARNING: This article contains outdated information. We no longer recommend taking its advice.Using plugins, it's possible to add new functionality to Elasticsearch without having to create a fork of Elasticsearch itself. In this article, we will go through the steps required to create a new Elasticsearch plugin from the ground up.
The only requirements to build Elasticsearch plugins are:
installation
a Java compiler
A packaged plugin is simply a Zip file that contains one or more Java Jar files with compiled code and resources. Once a plugin is written and packaged, it can easily be added to any Elasticsearch installation in a single command.
We start by creating the necessary plugin structure for our example plugin:
$ mkdir example-plugin
$ cd example-plugin
$ mkdir -p src/main/{java,resources,assemblies}
$ mkdir -p src/main/java/org/elasticsearch/plugin/example
Next, we need a Maven configuration file, which by convention goes into pom.xml:
&modelVersion&4.0.0&/modelVersion&
&groupId&org.elasticsearch.plugin.example&/groupId&
&artifactId&example-plugin&/artifactId&
&version&1.0-SNAPSHOT&/version&
&packaging&jar&/packaging&
&properties&
&elasticsearch.version&0.90.3&/elasticsearch.version&
&/properties&
&dependencies&
&dependency&
&groupId&org.elasticsearch&/groupId&
&artifactId&elasticsearch&/artifactId&
&version&${elasticsearch.version}&/version&
&scope&compile&/scope&
&/dependency&
&/dependencies&
&artifactId&maven-assembly-plugin&/artifactId&
&version&2.3&/version&
&configuration&
&appendAssemblyId&false&/appendAssemblyId&
&outputDirectory&${project.build.directory}/releases/&/outputDirectory&
&descriptors&
&descriptor&${basedir}/src/main/assemblies/plugin.xml&/descriptor&
&/descriptors&
&/configuration&
&executions&
&execution&
&phase&package&/phase&
&goal&single&/goal&
&/execution&
&/executions&
&/plugins&
While most parts of the Maven configuration file above is boilerplate, defining some required properties and configuring dependencies, the interesting part in this case is the reference to src/main/assemblies/plugin.xml, which we use to configure the packaging of the plugin:
&?xml version="1.0"?&
&assembly&
&id&plugin&/id&
&format&zip&/format&
&/formats&
&includeBaseDirectory&false&/includeBaseDirectory&
&dependencySets&
&dependencySet&
&outputDirectory&/&/outputDirectory&
&useProjectArtifact&true&/useProjectArtifact&
&useTransitiveFiltering&true&/useTransitiveFiltering&
&excludes&
&exclude&org.elasticsearch:elasticsearch&/exclude&
&/excludes&
&/dependencySet&
&/dependencySets&
&/assembly&
The four files we just created are actually sufficient to create an Elasticsearch plugin. If you followed the above steps, your directory tree should look something like this:
├── pom.xml
├── src
└── main
├── assemblies
└── plugin.xml
├── java
└── org
└── elasticsearch
└── plugin
└── example
├── ExamplePlugin.java
└── resources
└── es-plugin.properties
Being Maven-based, most Java IDEs such as
are able to read the project definition from the pom.xml-file and automatically configure a project and download the required dependencies.
In the next section we will show how to build the plugin from the command line and how to get it installed.
Before distributing and using the plugin, it has to be assembled, which is done via Maven:
$ mvn package
The above command assembles our plugin package into a single Zip file that can be installed using the Elasticsearch plugin command:
$ bin/plugin --url file:///PATH-TO-EXAMPLE-PLUGIN/target/releases/example-plugin-1.0-SNAPSHOT.zip --install example-plugin
Note that we use the --url option for the plugin command in order to inform it to get the file locally instead of trying to download it from an online repository.
We can now start Elasticsearch and see that our plugin gets loaded:
$ bin/elasticsearch -f
[ 17:33:27,443][INFO ][node
] [Andrew Chord] version[0.90.3], pid[67218], build[5c38d60/T13:18:31Z]
[ 17:33:27,443][INFO ][node
] [Andrew Chord] initializing ...
[ 17:33:27,455][INFO ][plugins
] [Andrew Chord] loaded [example-plugin], sites []
However, since our plugin doesn’t actually do anything, there’s very little proof that we’ve accomplished something. The next section demonstrates how to return a simple HTTP response to the built-in HTTP server.
Plugins can add functionality to Elasticsearch in many different ways. In this section we’ll show how to use
to add a Module to Elasticsearch. Guice is used in Elasticsearch to wire together all the components of the server and to provide well-documented entry points into the server. Describing Guice is out of scope for this article and interested readers should have no problem finding multiple tutorials and introductions to the .
To add a new Module Elasticsearch, we override the abstract modules() method on AbstractPlugin, which allows us to add multiple Modules by returning a reference to their class in a collection. We start by adding a new Module to our ExamplePlugin:
package org.elasticsearch.plugin.
import mon.collect.L import mon.inject.M import org.elasticsearch.plugins.AbstractP
import java.util.C
public class ExamplePlugin extends AbstractPlugin { @Override public String name() { return "example-plugin"; }
@Override public String description() { return "Example Plugin Description"; } @Override public Collection&Class&? extends Module&& modules() { Collection&Class&? extends Module&& modules = Lists.newArrayList(); modules.add(ExampleRestModule.class); }
These modules are instantiated by Elasticsearch during initialization, and their configure() method is invoked. In this method, we have to make sure our RestHandler gets added to the list of classes to instantiate:
package org.elasticsearch.plugin.
import mon.inject.AbstractM
public class ExampleRestModule extends AbstractModule { @Override protected void configure() { bind(HelloRestHandler.class).asEagerSingleton(); } }
By binding the class to itself as an eager singleton, we inform the framework that we would like it to instantiate just a single instance of the HelloRestHandler class. The class is instantiated by invoking the constructor annotated with @Inject once all its constructor arguments have been instantiated.
In Elasticsearch, all
requests are handled by a org.elasticsearch.rest.RestController instance, which maintains an internal routing of paths to org.elasticsearch.rest.RestHandler instances, which in turn handle the requests.
Adding support for a new HTTP request is as simple as obtaining a reference to the RestController via Guice and registering the handler with the controller.
Our HelloRestHandler should look like this:
package org.elasticsearch.plugin.
import org.elasticsearch.rest.*;
import mon.inject.I
import static org.elasticsearch.rest.RestRequest.Method.GET; import static org.elasticsearch.rest.RestStatus.OK;
public class HelloRestHandler implements RestHandler { @Inject public HelloRestHandler(RestController restController) { restController.registerHandler(GET, "/_hello", this); }
@Override public void handleRequest(final RestRequest request, final RestChannel channel) { String who = request.param("who"); String whoSafe = (who!=null) ? who : "world"; channel.sendResponse(new StringRestResponse(OK, "Hello, " + whoSafe + "!")); }
In this article, we’ve shown how to create a new Elasticsearch plugin from scratch. While it’s relatively easy to get started writing plugins for Elasticsearch, writing more sophisticated plugins usually requires some insight into the current .
Update: Added &appendAssemblyId&false&/appendAssemblyId& in pom.xml to exclude -plugin suffix in file name. This works better when publishing the plugin to a Maven repository.
Thanks for subscribing! We'll keep you updated with new releases.

我要回帖

更多关于 redfire plugin.jar 的文章

 

随机推荐