您尝试使用的插件与您的 elasticsearch 版本 5.x 不兼容。
此外,插件 uri“lmenezes/elasticsearch-kopf/2.1.1”没有兼容的依赖关系,这会导致您已经提到的错误“未知插件 lmenezes/elasticsearch-kopf/2.1.1”。其他插件 uri 依赖项是未知的,并且生产者未提交。
我试图在elasticsearch的插件空间之外使用localy kopf插件,但如果没有配置,那将无法正常工作。
替代插件 Head 也不适用于 es 版本 5.1,这使情况变得更糟。
如果有人知道除了对这些插件进行自定义修改之外的一些不错的选择,我会很高兴。
解决方案 1:
使用此处描述的独立头插件:
https ://github.com/mobz/elasticsearch-head#running-with-built-in-server
重要的部分是为您的 es-5.x 启用 cors
解决方案 2:
从此处使用独立的 kopf 插件:https ://github.com/lmenezes/elasticsearch-kopf/blob/master/README.md
- 克隆或下载源代码
- 通过 elasticsearch.yml 修改为 es-5.x 启用 cors
- 修改/自定义 kopf 源
步骤1
git clone git://github.com/lmenezes/elasticsearch-kopf.git
第2步
修改 elasticsearch.yml
#enable cors for standalone plugins
http.cors.enabled: true
http.cors.allow-origin: "*"
步骤 3 在 中添加弹性搜索端口的属性_site/kopf_external_settings.json
。样本
{
"elasticsearch_root_path": "",
"elasticsearch_port": 9200,
"with_credentials": false,
"theme": "dark",
"refresh_rate": 5000
}
修改_site/dist/kopf.js的javascript
1-为从行开始的端口值添加一个常量5562
var ES_PORT = 'elasticsearch_port';
2-为从行开始的属性添加一个吸气剂5615
this.getElasticsearchPort = function () {
return this.getSettings()[ES_PORT];
};
3-替换$location.port();
为ExternalSettingsService.getElasticsearchPort();
在线1269
4-避免从在线1215
示例开始的版本兼容性警报的紧张数量可能是不同的版本,尽管抛出警报一次
$scope.version = '2.1.2';
$scope.modal = new ModalControls();
var alertedOnce = false;
$scope.$watch(
function () {
return ElasticService.cluster;
},
function (newValue, oldValue) {
var version = ElasticService.getVersion();
if (version && version.isValid()) {
var major = version.getMajor();
if (major != parseInt($scope.version.charAt(0)) && !alertedOnce) {
AlertService.warn(
'This version of kopf is not compatible with your ES version',
'Upgrading to newest supported version is recommeded'
);
alertedOnce = true;
}
}
}
);