Elasticsearch 5常见问题解决方案

 
 

安装运行

1、前置安装java8

jdk-8u112-linux-x64.rpm

下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html

2、下载

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.1.zip

3、解压

unzip elasticsearch-5.1.1.zip

4、运行

./bin/elasticsearch

./bin/elasticsearch -d          #后台运行

tail -f logs/elasticsearch.log           #查看日志

注:ES有执行脚本的能力,因安全因素,不能在root用户下运行,强行运行会报如下错误:

org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root

解决方案:

groupadd es          #增加es组

useradd es -g es -p pwd          #增加es用户并附加到es组

chown -R es:es elasticsearch-5.1.1          #给目录权限

su es          #使用es用户

./bin/elasticsearch -d          #后台运行es

外网访问

vi conf/elasticsearch.yml

修改network.host: 0.0.0.0

再次启动linux可能出现如下类似错误 

bootstrap checks failed

max file descriptors [65535] for elasticsearch process is too low, increase to at least [65536]

解决方案

1、vi /etc/sysctl.conf

设置fs.file-max=655350

保存之后sysctl -p使设置生效

2、vi /etc/security/limits.conf 新增

* soft nofile 655350

* hard nofile 655350

3、重新使用SSH登录,再次启动elasticsearch即可。

外网访问:serverip:9200/

安装elasticsearch-head插件

elasticsearch 5以后的版本比较新,不支持直接安装head插件,以下是github上提供的安装方法,如下图示

以下为我自己整理的方法,参考来源:http://blog.csdn.net/qq942477618/article/details/53637817

1、下载head插件

wget https://codeload.github.com/mobz/elasticsearch-head/zip/master

2、下载nodejs

nodejs官网下载地址https://nodejs.org/dist/

wget https://nodejs.org/dist/v6.9.2/node-v6.9.2-linux-x64.tar.xz

3、配置node环境变量

xz –d node-v6.9.2-linux-x64.tar.xz
tar –xvf node-v6.9.2-linux-x64.tar
mv node-v6.9.2-linux-x64 /alidata/app/node

vim /etc/profile
export NODE_HOME=/alidata/app/node
export PATH=$PATH:$NODE_HOME/bin
source /etc/profile

# node –v
v6.9.2
# npm –v
3.10.9

4、安装grunt

cd elasticsearch-head-master
npm install -g grunt --registry=https://registry.npm.taobao.org

5、测试一下

cd elasticsearch-head-master
grunt

出现以下提示,为Gruntfile.js引用的,缺少以下包

>> Local Npm module "grunt-contrib-clean" not found. Is it installed?
>> Local Npm module "grunt-contrib-concat" not found. Is it installed?
>> Local Npm module "grunt-contrib-watch" not found. Is it installed?
>> Local Npm module "grunt-contrib-connect" not found. Is it installed?
>> Local Npm module "grunt-contrib-copy" not found. Is it installed?
>> Local Npm module "grunt-contrib-jasmine" not found. Is it installed?
Warning: Task "connect:server" not found. Use --force to continue.

Aborted due to warnings.

安装

npm install grunt-contrib-clean --registry=https://registry.npm.taobao.org

npm install grunt-contrib-concat --registry=https://registry.npm.taobao.org

npm install grunt-contrib-watch --registry=https://registry.npm.taobao.org
npm install grunt-contrib-connect --registry=https://registry.npm.taobao.org
npm install grunt-contrib-copy --registry=https://registry.npm.taobao.org
npm install grunt-contrib-jasmine --registry=https://registry.npm.taobao.org

6、运行

grunt server

7、测试

http://serverip:9100/

修改head目录下的Gruntfile.js配置,head默认监听127.0.0.1

vm Gruntfile.js

hostname: '0.0.0.0',

8、为es设置跨域访问

vi config/elasticsearch.yml         #新增两行

http.cors.enabled: true

http.cors.allow-origin: "*"

9、启动es,启动head插件

Elasticsearch 5的更多相关文章

  1. Elasticsearch之java的基本操作一

    摘要   接触ElasticSearch已经有一段了.在这期间,遇到很多问题,但在最后自己的不断探索下解决了这些问题.看到网上或多或少的都有一些介绍ElasticSearch相关知识的文档,但个人觉得 ...

  2. Elasticsearch 5.0 中term 查询和match 查询的认识

    Elasticsearch 5.0 关于term query和match query的认识 一.基本情况 前言:term query和match query牵扯的东西比较多,例如分词器.mapping ...

  3. 以bank account 数据为例,认识elasticsearch query 和 filter

    Elasticsearch 查询语言(Query DSL)认识(一) 一.基本认识 查询子句的行为取决于 query context filter context 也就是执行的是查询(query)还是 ...

  4. Ubuntu 14.04中Elasticsearch集群配置

    Ubuntu 14.04中Elasticsearch集群配置 前言:本文可用于elasticsearch集群搭建参考.细分为elasticsearch.yml配置和系统配置 达到的目的:各台机器配置成 ...

  5. ElasticSearch 5学习(10)——结构化查询(包括新特性)

    之前我们所有的查询都属于命令行查询,但是不利于复杂的查询,而且一般在项目开发中不使用命令行查询方式,只有在调试测试时使用简单命令行查询,但是,如果想要善用搜索,我们必须使用请求体查询(request ...

  6. ElasticSearch 5学习(9)——映射和分析(string类型废弃)

    在ElasticSearch中,存入文档的内容类似于传统数据每个字段一样,都会有一个指定的属性,为了能够把日期字段处理成日期,把数字字段处理成数字,把字符串字段处理成字符串值,Elasticsearc ...

  7. .net Elasticsearch 学习入门笔记

    一. es安装相关1.elasticsearch安装  运行http://localhost:9200/2.head插件3.bigdesk插件安装(安装细节百度:windows elasticsear ...

  8. 自己写的数据交换工具——从Oracle到Elasticsearch

    先说说需求的背景,由于业务数据都在Oracle数据库中,想要对它进行数据的分析会非常非常慢,用传统的数据仓库-->数据集市这种方式,集市层表会非常大,查询的时候如果再做一些group的操作,一个 ...

  9. 如何在Elasticsearch中安装中文分词器(IK+pinyin)

    如果直接使用Elasticsearch的朋友在处理中文内容的搜索时,肯定会遇到很尴尬的问题--中文词语被分成了一个一个的汉字,当用Kibana作图的时候,按照term来分组,结果一个汉字被分成了一组. ...

  10. jar hell & elasticsearch ik 版本问题

    想给es 安装一个ik 的插件, 我的es 是 2.4.0, 下载了一个版本是 1.9.5, [2016-10-09 16:56:26,248][INFO ][node ] [node-2] init ...

随机推荐

  1. 更改 pandas dataframe 中两列的位置

    更改 pandas dataframe 中两列的位置: 把其中的某列移到第一列的位置. 原来的 df 是: df = pd.read_csv('I:/Papers/consumer/codeandpa ...

  2. UltraEdit加入到右键菜单中

    http://www.cppblog.com/prayer/archive/2009/02/20/74429.htmlUltraEdit安装好之后,拷贝到其它机器就可以直接使用而无需注册,但少了一个功 ...

  3. ASP.NET CORE 学习之自定义异常处理

    为什么异常处理选择中间件? 传统的ASP.NET可以采用异常过滤器的方式处理异常,在ASP.NET CORE中,是以多个中间件连接而成的管道形式处理请求的,不过常用的五大过滤器得以保留,同样可以采用异 ...

  4. 关闭VS的实时调试器

    今天要安装一个水晶报表.安装过程有几个文件有错误.结果这个vs的实时调试器老是调出来.而且还是5次跳出来等你取消5次之后,才到默认的忽略的界面.你知道有多烦的,还得看这他,点完一次还要等几秒钟.差点崩 ...

  5. Python2 unichr() 函数

    描述 unichr() 函数 和 chr()函数功能基本一样, 只不过是返回 unicode 的字符. 语法 以下是 unichr() 方法的语法: unichr(i) 参数 i -- 可以是10进制 ...

  6. BPMN2.0 规范

    1 启动事件 每个流程总是以启动事件作为入口,启动事件在BPMN2.0 中以细线圆圈表示.分为三种类型 空启动事件 定时启动事件 异常启动事件 消息启动事件 启动事件都是等待第三方触发才可以启动. 定 ...

  7. Android开发8——利用pull解析器读写XML文件

    一.基本介绍 对XML解析有SAX和DOM等多种方式,Android中极力推荐xmlpull方式解析xml.xmlpull不仅可用在Android上同样也适用于javase,但在javase环境中需自 ...

  8. AngularJS 使用 UI Router 实现表单向导

    Today we will be using AngularJS and the great UI Router and the Angular ngAnimate module to create ...

  9. 【Android】3.7 UI控制功能

    分类:C#.Android.VS2015.百度地图应用: 创建日期:2016-02-04 一.简介 简介:介绍开关手势功能和显示隐藏UI控件 详述: (1)地图操作开关:平移.缩放.双击放大.双指操作 ...

  10. 腾讯云数据库团队:MySQL5.7 JSON实现简单介绍

    作者介绍:吴双桥 腾讯云project师 阅读原文.很多其它技术干货.请訪问fromSource=gwzcw.57435.57435.57435">腾云阁. 本文主要介绍在MySQL ...