elasticsearch及head插件安装与配置
1. 环境软件版本说明
- 系统:ubuntu14.04.1
- JDK:1.8
- elasticsearch:5.5.2
- node:9.11.1
- elasticsearch:5.X
2. 环境软件下载说明
1). 软件地址
- 系统:这个嘛。。。
- JDK:非重点,请自行解决
- elasticsearch:https://www.elastic.co/downloads/elasticsearch
- elasticsearch-5.5.2:https://www.elastic.co/downloads/past-releases/elasticsearch-5-5-2
- node:https://nodejs.org/dist/v9.11.1/node-v9.11.1-linux-x64.tar.xz
- elasticsearch-head:https://github.com/mobz/elasticsearch-head/archive/master.zip
2). 软件下载
- 下载elasticsearch-5.5.2
# wget https://www.elastic.co/downloads/past-releases/elasticsearch-5-5-2
- 下载node
`
# wget https://nodejs.org/dist/v9.11.1/node-v9.11.1-linux-x64.tar.xz
- 下载head插件
# wget https://github.com/mobz/elasticsearch-head/archive/master.zip
3. elasticsearch安装
elasticsearch解压即能用,当然为了更方便的使用,还是要简单配置一下。
1). 解压
`
# tar -zxvf elasticsearch-5.5.2.tar.gz
2). 配置
# cd elasticsearch-5.5.2/config/
# vim elasticsearch.yml
network.host: 0.0.0.0
# 跨域访问设置
http.cors.enabled: true
http.cors.allow-origin: "*"
3). 配置elasticsearch启动用户
在启动elasticsearch之前还要创建一个非root用户,elasticsearch不允许使用root用户启动。当使用非root用户时,要配置一下用户的文件打开数和用户最大处理数。
会出现如下错误:
ERROR: bootstrap checks failed
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
ERROR: bootstrap checks failed max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
解决centos系统执行一下如下脚本
#!/bin/bash
echo "* soft nofile 65536" >> /etc/security/limits.conf
echo "* hard nofile 65536" >> /etc/security/limits.conf
echo "* soft memlock unlimited" >> /etc/security/limits.conf
echo "* hard memlock unlimited" >> /etc/security/limits.conf
echo "vm.max_map_count = 262144" >> /etc/sysctl.conf
echo "* soft nproc 4096" >> /etc/security/limits.d/90-nproc.conf
echo "root soft nproc unlimited" >> /etc/security/limits.d/90-nproc.conf
sysctl -p
ulimit -l unlimited
解决ubuntu系统
(1). 在 /etc/security/limits.conf 中添加
* hard nofile 2037581
* soft nofile 2037581
root hard nofile 2037581
root soft nofile 2037581
(2). 在 /etc/pam.d/su 添加
session required pam_limits.so
(3)在 /etc/pam.d/common-session 添加
session required pam_limits.so
(4). 在 /etc/sysctl.conf 中添加
vm.max_map_count = 262144
4). 启动
- 前台启动
# bin/elasticsearch
- 后台启动
# bin/elasticsearch -d
- 方式 一查看端口是否启动
# lsof -i:9200
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 24738 kevin 117u IPv4 32165101 0t0 TCP *:wap-wsp (LISTEN)
- 方式二用curl
返回如下信息说明启动功能。
# curl localhost:9200
{
"name" : "kevin-node-01",
"cluster_name" : "kevin-dev",
"cluster_uuid" : "Sq62mKiaQiGGYOQR-Dmq6Q",
"version" : {
"number" : "6.2.4",
"build_hash" : "ccec39f",
"build_date" : "2018-04-12T20:37:28.497551Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}
4. elasticsearch-head插件安装
elasticsearch依赖node环境,所以要想安装head插件就要先安装node环境。
1). node环境安装
* 解压
先把tar.xz解压出tar.gz,然后再解压tar.gz文件
# tar -xvf node-v9.11.1-linux-x64.tar.xz
# tar -zxvf node-v9.11.1-linux-x64.tar.gz
设置软连接
# ln -s /opt/node-v9.11.1/bin/npm /usr/local/bin/
# ln -s /opt/node-v9.11.1/bin/node /usr/local/bin/
检测是否安装成功,如果不成功重新开启一个session对话再试一下。
# node -v
# npm -v
2). head安装
* 解压
# unzip master.zip
配置
- vim Gruntfile.js
添加 hostname: '0.0.0.0'
90 connect: {
91 server: {
92 options: {
93 port: 9100,
94 base: '.',
95 keepalive: true,
96 hostname:'0.0.0.0'
97 }
安装
进入到node的根目录下
# cd /opt/elasticsearch-head-master/
npm install
我的报如下错误
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-08-04T02_49_32_733Z-debug.log
root@lee-ubuntu:/opt/elasticsearch-head-master#
root@lee-ubuntu:/opt/elasticsearch-head-master#
root@lee-ubuntu:/opt/elasticsearch-head-master#
root@lee-ubuntu:/opt/elasticsearch-head-master# npm install phantomjs-prebuilt@2.1.14--ignore-scripts
npm ERR! code ETARGET
npm ERR! notarget No matching version found for phantomjs-prebuilt@2.1.14--ignore-scripts
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-08-04T02_51_00_390Z-debug.log
解决:把不能安装的script路过去,要注意你报错信息中@后台的版本号
npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
启动head
- 启动
npm run start
然后就可以访问head插件了,head插件的端口默认是9100。

如果head不能识别es的地址,就去head中配置一下es的地址信息。

vim _site/app.js 把4354行的localhost改ip地址即可。
4342 (function( app, i18n ) {
4343
4344 var ui = app.ns("ui");
4345 var services = app.ns("services");
4346
4347 app.App = ui.AbstractWidget.extend({
4348 defaults: {
4349 base_uri: null
4350 },
4351 init: function(parent) {
4352 this._super();
4353 this.prefs = services.Preferences.instance();
4354 this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://192.168.161.103:9200";
4355 if( this.base_uri.charAt( this.base_uri.length - 1 ) !== "/" ) {
4356 // XHR request fails if the URL is not ending with a "/"
4357 this.base_uri += "/";
4358 }
4359 if( this.config.auth_user ) {
4360 var credentials = window.btoa( this.config.auth_user + ":" + this.config.auth_password );
4361 $.ajaxSetup({
4362 headers: {
4363 "Authorization": "Basic " + credentials
4364 }
4365 });
4366 }
4367 this.cluster = new services.Cluster({ base_uri: this.base_uri });
elasticsearch及head插件安装与配置的更多相关文章
- ElasticSearch 2 (6) - 插件安装Head、Kopf与Bigdesk
ElasticSearch 2 (6) - 插件安装Head.Kopf与Bigdesk 摘要 安装Elasticsearch插件Head.Kopf与Bigdesk 版本 elasticsearch版本 ...
- MyEclipse TestNG插件安装与配置
MyEclipse TestNG插件安装与配置 by:授客 QQ:1033553122 测试环境 jdk1.8.0_121 myeclipse-10.0-offline-installer-win ...
- nodejs安装及npm模块插件安装路径配置
在学习完js后,我们就要进入nodejs的学习,因此就必须配置nodejs和npm的属性了. 我相信,个别人在安装时会遇到这样那样的问题,看着同学都已装好,难免会焦虑起来.于是就开始上网查找解决方案, ...
- ElasticSearch之常用插件安装命令
#head监控安装,推荐 bin/plugin -install mobz/elasticsearch-head #bigdesk集群状态,推荐 bin/plugin -install lukas-v ...
- Elasticsearch 6.3.1、Head插件 安装及配置
安装Elasticsearch Elasticsearch下载地址:https://www.elastic.co/cn/downloads/elasticsearch 也可以直接使用wget下载到某目 ...
- ElasticSearch head插件安装与配置
下载 下载地址:https://github.com/mobz/elasticsearch-head 安装 1. 下载到本地 git clone 2. 安装 grunt npm install -g ...
- 分布式搜索引擎ElasticSearch+Kibana (Marvel插件安装详解)
在安装插件的过程中,尤其是安装Marvel插件遇到了很多问题,要下载license.Marvel-agent,又要下载安装Kibana 版本需求 Java 7 or later Elasticsear ...
- 【ElasticSearch】 elasticsearch-head插件安装
本章介绍elasticsearch-head插件安装,elasticsearch安装参考:[ElasticSearch] 安装 elasticsearch-head安装和学习可参照官方文档: http ...
- eclipse maven plugin 插件 安装 和 配置
离线插件 点击下载离线安装包:eclipse-maven-plugin.zip ( for eclipse helios or higher ) .解压缩到任意目录(如这里的plugins目录): ...
随机推荐
- visual Studio 2017 扩展开发(三)《绑定快捷键到菜单项》
如何将键盘快捷方式映射到自定义按钮,怎么使用快捷键启动自己创建的菜单,刚开始做的时候迷糊了,找了很久.可能也是因为刚开始做不是很明白,后面慢慢就懂了.其实非常简单的. 很多快捷键已经在Visual s ...
- 向上造型中让我入坑的地方 (><)
今天周六,闲着蛋疼就报名参加了公司的一个java比赛,比赛地点某某大厦11楼会议室,想象中应该是能容纳上百人的超大会议室.没成想,到地方一看,只是一个能容纳六七人的有圆形会议桌的小会议室.不过这仍然不 ...
- MaskRCNN-Keypoints
这个月先写一篇吧,后面要复习数学考试了,可能到时候就忘了.今天写一个比较有意思的东西,关于人体的分割与姿态估计.如下图所示: 图片选自mask rcnn的论文,这里由于时间的关系,就不多叙述技术细节了 ...
- VS Code 安装 C++ 调试环境
在 VS CODE 中安装 C/C++ 插件 安装编译.调试环境 这里安装的是 MinGW, 官网如下:http://mingw.org/ 下载后,双击进行安装安装路径可以根据需要来修改: 然后选择需 ...
- ES6躬行记(7)——代码模块化
在ES6之前,由于ECMAScript不具备模块化管理的能力,因此往往需要借助第三方类库(例如遵守AMD规范的RequireJS或遵循CMD规范的SeaJS等)才能实现模块加载.而自从ES6引入了模块 ...
- Disruptor 为什么这么快?
为什么Disruptor不使用队列来实现RingBuffer 队列有两个指针,一个指向队头,一个指向队尾.如果有超过一个生产者想要往队列里放东西,尾指针就将成为一个冲突点,因为有多个线程要更新它. ...
- Apache-httpd.conf详解
## Apache服务器主配置文件. 包括服务器指令的目录设置.# 详见 <URL:http://www.apache.org/docs/> ## 请在理解用途的基础上阅读各指令.## ...
- zabbix实现百台服务器的自动化监控--技术流ken
前言 最近有小伙伴通过Q联系到我说:公司现在有百多台服务器,想要部署zabbix进行监控,怎么实现自动化全网监控? 本篇博客将讲解一个我工作时做的一个实际项目,现在写出来供大家以后参考使用. 实现自动 ...
- WebSocket+Java 私聊、群聊实例
前言 之前写毕业设计的时候就想加上聊天系统,当时已经用ajax长轮询实现了一个(还不懂什么是轮询机制的,猛戳这里:https://www.cnblogs.com/hoojo/p/longPolling ...
- 行为型---命令模式(Command Pattern)
命令模式的定义 命令模式属于对象的行为型模式.命令模式是把一个操作或者行为抽象为一个对象中,通过对命令的抽象化来使得发出命令的责任和执行命令的责任分隔开.命令模式的实现可以提供命令的撤销和恢复功能. ...