windows 下安装elasticsearch 及其插件head,ik,marvel
2016-10-18 14:26
821 查看
1.首先下载elasticsearch for windows
官网地址:https://www.elastic.co/downloads/elasticsearch,这里我下载的是2.4.0版本。
2.安装jdk,jdk版本最好在1.7以上,否则无法启动elasticsearch服务
官方建议:
We recommend installing the Java 8 update 20 or later, or Java 7 update 55 or later.Previous versions of Java 7 are known to have bugs that can cause index corruption and data loss. Elasticsearch will refuse to start if a known-bad version
of Java is used.
3.解压下载包到某个目录,例如:解压到D:\大数据软件安装包\elasticsearch-2.4.0\elasticsearch-2.4.0。
4.开始安装启动:这里有2种方法:
方法一:
进入解压文件的bin目录,双击执行elasticsearch.bat 如图,
进入
http://localhost:9200 ,出现以下页面,说明安装成功。
如果要停止服务: ctrl+c 即可。
方法二
(1)进入解压文件的bin目录下,执行以下命令:
service install
service start
如下图所示:
(2)同样打开
http://localhost:9200 浏览查看,如果要停止elasticsearch服务,则执行 service stop 即可关闭elasticsearch。
打开cmd命令窗口,进入解压文件的bin目录,然后执行命令:
plugin install mobz/elasticsearch-head
如下图所示:
浏览http://localhost:9200/_plugin/head/,出现如下界面,则安装成功:
bin/plugin install license
bin/plugin install marvel-agent
进入kibana的bin目录(首先下载kibana):
bin/kibana plugin --install elasticsearch/marvel/latest
如果机器没有连网,则上述命令无法执行,需要首先下载安装文件包,下载地址:
· https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/license/2.4.0/license-2.4.0.zip (sha1)
· https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/marvel-agent/2.4.0/marvel-agent-2.4.0.zip (sha1)
· https://download.elasticsearch.org/elasticsearch/marvel/marvel-2.4.0.tar.gz (sha1)
然后分别执行命令:
进入es的bin目录:
plugin install file:///D:/大数据软件安装包/elasticsearch-2.4.0/license-2.4.0.zip
plugin install file:///D:/大数据软件安装包/elasticsearch-2.4.0/marvel-agent-2.4.0.zip
进入kibana的bin目录:
kibana plugin --install marvel --url
file:///path/to/file/marvel-2.4.0.tar.gz
最后访问:http://localhost:5601/app/marvel
https://github.com/medcl/elasticsearch-analysis-ik/releases
然后把文件解压放在es的plugins的analysis-ik目录下,如果没有此目录,则新建。
最后在es的conf中elasticsearch.yml文件末尾中加入 index.analysis.analyzer.ik.type: "ik"
测试分词插件是否可以分词:
在浏览器输入:
http://localhost:9200/_analyze?analyzer=ik&pretty=true&text=中华人民共和国国歌
结果:
{ "tokens" : [ { "token" : "中华人民共和国", "start_offset" : 0, "end_offset" : 7, "type" : "CN_WORD", "position" : 0 },
{ "token" : "中华人民", "start_offset" : 0, "end_offset" : 4, "type" : "CN_WORD", "position" : 1 },
{ "token" : "中华", "start_offset" : 0, "end_offset" : 2, "type" : "CN_WORD", "position" : 2 },
{ "token" : "华人", "start_offset" : 1, "end_offset" : 3, "type" : "CN_WORD", "position" : 3 },
{ "token" : "人民共和国", "start_offset" : 2, "end_offset" : 7, "type" : "CN_WORD", "position" : 4 },
{ "token" : "人民", "start_offset" : 2, "end_offset" : 4, "type" : "CN_WORD", "position" : 5 },
{ "token" : "共和国", "start_offset" : 4, "end_offset" : 7, "type" : "CN_WORD", "position" : 6 },
{ "token" : "共和", "start_offset" : 4, "end_offset" : 6, "type" : "CN_WORD", "position" : 7 }, {
"token" : "国", "start_offset" : 6, "end_offset" : 7, "type" : "CN_CHAR", "position" : 8 },
{ "token" : "国歌", "start_offset" : 7, "end_offset" : 9, "type" : "CN_WORD", "position" : 9 } ]}
如果想要粗粒度的分词:则把analyzer的属性换成ik_smart即可
http://localhost:9200/_analyze?analyzer=ik_smart&pretty=true&text=中华人民共和国国歌
结果:
{ "tokens" : [ { "token" : "中华人民共和国", "start_offset" : 0, "end_offset" : 7, "type" : "CN_WORD", "position" : 0 },
{ "token" : "国歌", "start_offset" : 7, "end_offset" : 9, "type" : "CN_WORD", "position" : 1 } ]}
官网地址:https://www.elastic.co/downloads/elasticsearch,这里我下载的是2.4.0版本。
2.安装jdk,jdk版本最好在1.7以上,否则无法启动elasticsearch服务
官方建议:
We recommend installing the Java 8 update 20 or later, or Java 7 update 55 or later.Previous versions of Java 7 are known to have bugs that can cause index corruption and data loss. Elasticsearch will refuse to start if a known-bad version
of Java is used.
3.解压下载包到某个目录,例如:解压到D:\大数据软件安装包\elasticsearch-2.4.0\elasticsearch-2.4.0。
4.开始安装启动:这里有2种方法:
方法一:
进入解压文件的bin目录,双击执行elasticsearch.bat 如图,
进入
http://localhost:9200 ,出现以下页面,说明安装成功。
如果要停止服务: ctrl+c 即可。
方法二
(1)进入解压文件的bin目录下,执行以下命令:
service install
service start
如下图所示:
(2)同样打开
http://localhost:9200 浏览查看,如果要停止elasticsearch服务,则执行 service stop 即可关闭elasticsearch。
插件安装
1.安装head插件
安装head插件,在网页上管理、监视集群的状态。打开cmd命令窗口,进入解压文件的bin目录,然后执行命令:
plugin install mobz/elasticsearch-head
如下图所示:
浏览http://localhost:9200/_plugin/head/,出现如下界面,则安装成功:
2.安装marvel插件
进入es安装目录的bin目录,执行命令:bin/plugin install license
bin/plugin install marvel-agent
进入kibana的bin目录(首先下载kibana):
bin/kibana plugin --install elasticsearch/marvel/latest
如果机器没有连网,则上述命令无法执行,需要首先下载安装文件包,下载地址:
· https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/license/2.4.0/license-2.4.0.zip (sha1)
· https://download.elastic.co/elasticsearch/release/org/elasticsearch/plugin/marvel-agent/2.4.0/marvel-agent-2.4.0.zip (sha1)
· https://download.elasticsearch.org/elasticsearch/marvel/marvel-2.4.0.tar.gz (sha1)
然后分别执行命令:
进入es的bin目录:
plugin install file:///D:/大数据软件安装包/elasticsearch-2.4.0/license-2.4.0.zip
plugin install file:///D:/大数据软件安装包/elasticsearch-2.4.0/marvel-agent-2.4.0.zip
进入kibana的bin目录:
kibana plugin --install marvel --url
file:///path/to/file/marvel-2.4.0.tar.gz
最后访问:http://localhost:5601/app/marvel
3.安装ik分词插件
首先在git上下载已经编译好的代码,一定要选择和自己的es版本对应,否则无法启动服务,git下载地址如下:https://github.com/medcl/elasticsearch-analysis-ik/releases
然后把文件解压放在es的plugins的analysis-ik目录下,如果没有此目录,则新建。
最后在es的conf中elasticsearch.yml文件末尾中加入 index.analysis.analyzer.ik.type: "ik"
测试分词插件是否可以分词:
在浏览器输入:
http://localhost:9200/_analyze?analyzer=ik&pretty=true&text=中华人民共和国国歌
结果:
{ "tokens" : [ { "token" : "中华人民共和国", "start_offset" : 0, "end_offset" : 7, "type" : "CN_WORD", "position" : 0 },
{ "token" : "中华人民", "start_offset" : 0, "end_offset" : 4, "type" : "CN_WORD", "position" : 1 },
{ "token" : "中华", "start_offset" : 0, "end_offset" : 2, "type" : "CN_WORD", "position" : 2 },
{ "token" : "华人", "start_offset" : 1, "end_offset" : 3, "type" : "CN_WORD", "position" : 3 },
{ "token" : "人民共和国", "start_offset" : 2, "end_offset" : 7, "type" : "CN_WORD", "position" : 4 },
{ "token" : "人民", "start_offset" : 2, "end_offset" : 4, "type" : "CN_WORD", "position" : 5 },
{ "token" : "共和国", "start_offset" : 4, "end_offset" : 7, "type" : "CN_WORD", "position" : 6 },
{ "token" : "共和", "start_offset" : 4, "end_offset" : 6, "type" : "CN_WORD", "position" : 7 }, {
"token" : "国", "start_offset" : 6, "end_offset" : 7, "type" : "CN_CHAR", "position" : 8 },
{ "token" : "国歌", "start_offset" : 7, "end_offset" : 9, "type" : "CN_WORD", "position" : 9 } ]}
如果想要粗粒度的分词:则把analyzer的属性换成ik_smart即可
http://localhost:9200/_analyze?analyzer=ik_smart&pretty=true&text=中华人民共和国国歌
结果:
{ "tokens" : [ { "token" : "中华人民共和国", "start_offset" : 0, "end_offset" : 7, "type" : "CN_WORD", "position" : 0 },
{ "token" : "国歌", "start_offset" : 7, "end_offset" : 9, "type" : "CN_WORD", "position" : 1 } ]}
相关文章推荐
- Windows下ElasticSearch(5.5.2)及head,ik,pinyin插件的安装
- windows-elasticsearch5.1.1及head, ik, pinyin插件安装
- windows环境下ElasticSearch5以上版本安装head插件
- Elasticsearch6.0及其head插件安装
- Elasticsearch-2.4.3的3节点安装(图文详解)(含 head、kopf、marvel、shield和watcher插件安装和使用)
- 基于本地开发windows环境安装Elasticsearch6.0版本、head插件、ik以及pinyin插件全教程
- windows环境下ElasticSearch5以上版本安装head插件
- 14-win10下ElasticSearch.6.1.0与head、Kibana、X-Pack、SQL、IK、PINYIN插件的配置安装
- elasticsearch6.0.1之安装head插件(windows)
- windows下安装ElasticSearch的Head插件
- windows环境下ElasticSearch5以上版本安装head插件
- Elasticsearch安装与Elasticsearch-Head插件安装(windows环境)------Elasticsearch学习(一)
- elasticsearch-2.1.0 及其插件head的安装
- windows 安装elasticsearch-head插件
- windows下安装 Elasticsearch的head插件(不用命令)
- ElasticSearch5.x踩坑记录(一):windows系统下的ElasticSearch5.6.3及head插件安装
- windows 下安装 elasticsearch 以及 head 管理插件
- 4000 Windows环境下ElasticSearch5以上版本安装head插件
- windows环境下ElasticSearch5以上版本安装head插件
- Elasticsearch6.0及其head插件安装