本文主要介绍elasticsearch5.0安装及head插件安装。确保系统已经安装好jdk1.8以上,操作系统CentOS6以上。

一、elasticsearch安装配置

1.官网下载源码包

下载不同版本技巧:

复制下载链接修改版本号!

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.3.0.zip

2.解压安装

useradd elasticsearch

tar xf elasticsearch-6.3.0.tar.gz -C /usr/local

cd /usr/local

ln -sv elasticsearch-6.3.0 elasticsearch

mkdir -pv /data/elasticsearch/{data,logs}

chown -R elasticsearch.elasticsearch /data/elasticsearch

  

3.修改配置文件

cat /usr/local/elasticsearch/config/elasticsearch.yml

path.data:/data/elasticsearch/data

path.logs:/data/elasticsearch/logs

network.host:192.168.1.12

http.cors.enabled:true

http.cors.allow-origin:"*"

  

4.修改系统参数

cat /etc/security/limits.conf

*              soft    nproc          65536

*              hard    nproc          65536

*              soft    nofile          65536

*              hard    nofile          65536

cat /etc/sysctl.conf

vm.max_map_count= 262144

sysctl -p

  

5.启动服务

su - elasticsearch -c "/usr/local/elasticsearch/bin/elasticsearch &"

  

浏览器访问:http://192.168.1.12:9200/

二、head插件的安装

在5.0版本中不支持直接安装head插件,需要启动一个服务

1.下载插件安装

先安装node 自带一个npm。

git clone git://github.com/mobz/elasticsearch-head.git

cd elasticsearch-head

npm install

  

在elasticsearch-head目录下node_modules/grunt下如果没有grunt二进制程序,需要执行

cd elasticsearch-head

npm install grunt --save

2.修改配置

修改elasticsearch-head下Gruntfile.js文件,默认监听在127.0.0.1下9200端口

3.启动服务

/usr/local//node-v4.4.7-linux-x64/bin/npm start

  

浏览器访问 http://123.56.154.68:9100/

IK分词器安装:

1. 下载

下载对应的版本: https://github.com/medcl/elasticsearch-analysis-ik

2. 编译

配置前关闭elasticsearch,安装完成后再启动。

下载后,进入elasticsearch-analysis-pinyin-master目录,mvn打包(未下载maven的自行下载安装)。

3. 配置

打包成功后,在 elasticsearch-analysis-ik-master\target\releases会有一个elasticsearch-analysis-ik-6.3.0.zip。

把压缩包复制到 \elasticsearch-6.3.0\plugins\ik中, 没有文件夹就创建。

然后重启elasticsearch。

到此安装完成了!

附:

elasticsearch 安装过程中遇到了一些问题,这是在网上找的一些资料

警告提示
[2016-11-06T16:27:21,712][WARN ][o.e.b.JNANatives ] unable to install syscall filter:
java.lang.UnsupportedOperationException: seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP and CONFIG_SECCOMP_FILTER compiled in
at org.elasticsearch.bootstrap.Seccomp.linuxImpl(Seccomp.java:349) ~[elasticsearch-5.0.0.jar:5.0.0]
at org.elasticsearch.bootstrap.Seccomp.init(Seccomp.java:630) ~[elasticsearch-5.0.0.jar:5.0.0]

报了一大串错误,其实只是一个警告。使用心得linux版本,就不会出现此类问题了。

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]
max virtual memory areas vm.max_map_count [65530] likely too low,
increase to at least [262144]

解决:切换到root用户,编辑limits.conf 添加类似如下内容

vi /etc/security/limits.conf

添加如下内容:

* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096

对于第二条错误同意需要切换到root用户,进入limits.d目录下修改配置文件。

vi /etc/security/limits.d/90-nproc.conf

修改如下内容:

* soft nproc 1024
#修改为
* soft nproc 2048

第三条错误需要切换到root用户修改配置sysctl.conf

vi /etc/sysctl.conf

添加下面配置:

vm.max_map_count=655360

并执行命令:

sysctl -p

然后,重新启动elasticsearch,即可启动成功。

启动问题
**1、Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 2060255232, 0) failed; error='Cannot allocate memory' (errno=12)**

由于elasticsearch5.0默认分配jvm空间大小为2g,修改jvm空间分配

# vim config/jvm.options
-Xms2g
-Xmx2g
修改为
-Xms512m
-Xmx512m

2、max number of threads [1024] for user [elasticsearch] is too low, increase to at least [2048]修改 /etc/security/limits.d/90-nproc.conf

*          soft    nproc     1024
* soft nproc 2048

3、max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
修改/etc/sysctl.conf配置文件,

cat /etc/sysctl.conf | grep vm.max_map_countvm.max_map_count=262144

如果不存在则添加

echo "vm.max_map_count=262144" >>/etc/sysctl.conf

4、max file descriptors [65535] for elasticsearch process likely too low, increase to at least [65536]
需要执行下面的命令

ulimit -n 65536

可以通过ulimit命令设置当前session的limits值:
ulimit -n 10000
对应的参数关系和ulimit -a相关
-a      显示所有限制
-c      core文件大小的上限
-d      进程数据段大小的上限
-f      shell所能创建的文件大小的上限
-m     驻留内存大小的上限
-s      堆栈大小的上限
-t      每秒可占用的CPU时间上限
-p     管道大小
-n     打开文件数的上限
-u     进程数的上限
-v     虚拟内存的上限

ElasticSearch安装和head插件安装的更多相关文章

  1. 【windows环境下】RabbitMq的安装和监控插件安装

    RabbitMq的安装: RabbitMQ是基于Erlang的,所以必须先配置Erlang环境. 下载Erlang,地址:http://www.erlang.org/download/otp_win3 ...

  2. Android模拟器genymotion安装与eclipse 插件安装

    推荐一款Android模拟器"Genymotion",有点速度快,占用资源少,可整合eclipse.闲话少谈,看安装步骤. 1.下载地址:https://www.genymotio ...

  3. Sublime Text3安装及常用插件安装

    为了使用强大好用的代码编辑器来进行selenium3+Python3的自动化测试. 使用Sublime Text 3非常适合. 1.下载安装 首先到http://www.sublimetext.com ...

  4. VScode安装后的插件安装

    杭州SEO:Chinese(Simplified) Language Pack for Visual Stidio Code 中文汉化包 对于一些英文不太好的小伙伴,上来第一件事肯定是要切换成中文语言 ...

  5. jmeter在Windows下安装(含插件安装)

    [准备环境] jdk1.8 jmeter的安装包下载 [步骤] 1 把下载下来的压缩包解压,点击jmeter.bat 启动,启动后是英文界面 2 修改默认的英文界面,打开jmeter.properti ...

  6. gulp的安装以及less插件安装与使用

    1.安装node.js 下载地址:http://nodejs.cn/download/ 这时我们输入 node -v  以及  npm -v  检查是否安装成功. 2.为了提高后续使用的快速,我们安装 ...

  7. ElasticSearch 6.x head插件安装

    一.下载node.js yum install -y nodejs 二.安装npm npm install -g cnpm --registry=https://registry.npm.taobao ...

  8. 18-10-15 服务器删除数据的方法【Elasticsearch 数据删除 (delete_by_query 插件安装使用)】方法二没有成功

    rpa 都是5.xx  ueba 分为2.0 或者5.0 上海吴工删除数据的方法 在许多项目中,用户提供的数据存储盘大小有限,在运行一段时间后,大小不够就需要删除历史的 Elasticsearch 数 ...

  9. Elasticsearch学习之head插件安装

    通过elasticseach自带的plugin命令 elasticsearch/bin/plugin -install mobz/elasticsearch-head 如下图:  2. zip包安装 ...

随机推荐

  1. CSS Spritec下载,精灵图,雪碧图,初探之原理、使用

    CSS Spritec下载,精灵图,雪碧图,初探之原理.使用 关于CSS Sprite CSSSprites在国内很多人叫css精灵雪碧图,是一种网页图片应用处理方式.它允许你将一个页面涉及到的所有零 ...

  2. php最全基础,数组,函数,超全局变量,时间,回话,文件,php操作mysql

    共享一份学习php最全基础语法知识的笔记 原文链接:http://www.cnblogs.com/oscn/p/3607757.html:略有修改   http://www.cnblogs.com/l ...

  3. 前端程序员:月薪 5K 到 5 万

    入行行头:5 大硬件 请准备好以下东西 一颗人类的大脑:智商在平均水平线以上即可 一份强烈的渴望:我的代码要可以运行在任何一个有浏览器的设备上. 一台笔记本电脑:不需要花费很多钱得那种,只要它可以运行 ...

  4. uchome 全局变量

    $_SC: Array ( [dbhost] => localhost [dbuser] => root [dbpw] => root [dbcharset] => utf8 ...

  5. CCScene,CCLayer,CCSprite,CCDirector

    一.CCScene : 游戏中不同的画面可以用不同的场景展示出来,大致的可以分为以下的几类场景: 1. 展示类场景.游戏开场画面,游戏简介,胜利以及失败提示,帮助. 2. 选择类场景.主菜单,游戏设置 ...

  6. mysql 数据操作 多表查询 子查询 带比较运算符的子查询

    带比较运算符的子查询 #比较运算符:=.!=.>.>=.<.<=.<> #查询大于所有人平均年龄的员工名与年龄 思路 先拿到所有人的平均年龄然后 再用另外一条sql ...

  7. Openstack(八)部署镜像服务glance

    8.1glance镜像服务介绍 Glance是OpenStack镜像服务组件,glance服务默认监听在9292端口,其接收REST API请求,然后通过其他模块(glance-registry及im ...

  8. 博客迁移至新平台ixirong.com

    很久没有在博客园上写文章了,一是时间有些忙,更重要的是自己还是没有抽出时间来坚持写下去,由于15年后自己的一些打算,在前一段时间的时候,建立了自己的个人博客站点,http://www.ixirong. ...

  9. php5.6安装gd库

    rpm -Uvh http://ftp.iij.ad.jp/pub/linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh ht ...

  10. git相关使用技巧和问题

    本地有修改和提交,如何强制用远程的库更新更新.我尝试过用git pull -f,总是提示 You have not concluded your merge. (MERGE_HEAD exists). ...