ElasticSearch及其插件的安装(二)
来源:互联网 发布:linux 修改密码文件 编辑:程序博客网 时间:2024/05/16 06:51
ElasticSearch安装
1.http://www.elasticsearch.org/下载所需的ElastiSearch版本。
2.移动下载的压缩包到安装目录 我的目录是/usr/local/
sudo mv elasticsearch-x-x-x /usr/local/
3.进入/usr/local/解压下载文
sudo tar -zxvf elasticsearch-x-x-x
4.cd到/usr/local/elasticsearchx-x-x/bin/,执行elasticsearch启动。
./elasticsearch
5.此时打开网页http:// localhost:9200 出现一下内容为安装成功
{ "status" : 200, "name" : "node_yang", "cluster_name" : "elasticsearch", "version" : { "number" : "1.7.2", "build_hash" : "e43676b1385b8125d647f593f7202acbd816e8ec", "build_timestamp" : "2015-09-14T09:49:53Z", "build_snapshot" : false, "lucene_version" : "4.10.4" }, "tagline" : "You Know, for Search" }
6.使用curl -XPOST localhost:9200/_shutdown关闭ES。
7.或者使用ctrl + c 关闭
ElasticSearch的基本配置(这部分配置可以不理会,取默认值)
1.编辑文件/usr/local/elasticsearchx-x-x/conf/elasticsearcy.yml
2.cluster.name:集群名称,es可以自我发现,拥有相同集群名字的es会构成集群。
3 node.name:节点名称,当前节点的名字。唯一。
4.node.master:是否允许当前节点成为master。
5.node.data:是否允许当前节点存储数据。
6.index.number_of_shards:一个索引默认的shard数量。
7.index.number_of_replicas:一个索引默认的副本数量。
8.path.data:数据存储.
9.path.log:日志存储。
10.bootstrap.mlockall:是否只使用内存(不使用swap)。
11.network.bind_host:设置绑定的ip地址,用于访问es。
12.network.publish_host:与其他node通信的地址,用于cluster间数据传输。
插件安装(head、bigdesk、ik-analyzer)
head,一款H5的数据查看客户端:
1 在cd /usr/local/elasticsearchx-x-x/bin/下执行
./plugin -install mobz/elasticsearch-head
bigdesk,状态查看客户端:
2 在cd /usr/local/elasticsearchx-x-x/bin/下执行
./plugin -install lukas-vlcek/bigdesk/<bigdesk_version>
3 如果不确定版本号可写为
./plugin -install lukas-vlcek/bigdesk/
ik-analyzer,中文分词器:
1.git clone https://github.com/medcl/elasticsearch-analysis-ik.git (下载的时候要注意版本号。不同版本的elasticsearch 对应不同的ik版本 如果版本不对就会报错。然后head 中集群安全会报红)
2.mvn clean install(前提是配置了maven)。
3.将target中的elasticsearch-analysis-ik-xxx.zip 或elasticsearch-analysis-ik-xxx.jar或复制到/usr/local/elasticsearchx-x-x/plugins/ik/。
并解压目录如下
4.复制elasticsearch-analysis-ik(git repository)中config目录下ik内容到/usr/local/elasticsearchx-x-x/config。目录如下
5.配置/usr/local/elasticsearchx-x-x/conf/elasticsearch.yml,在最下方加入:
################################## Analyzer ##yang############################index: analysis: analyzer: ik: alias: [ik_analyzer] type: org.elasticsearch.index.analysis.IkAnalyzerProvider ik_max_word: type: ik use_smart: false ik_smart: type: ik use_smart: true
head 测试
http://localhost:9200/_plugin/head/
bigdesk测试
http://localhost:9200/_plugin/bigdesk/
ik分词测试
1、创建一个索引,名为index。
curl -XPUT http://localhost:9200/index
2、为索引index创建mapping。
curl -XPOST http://localhost:9200/index/fulltext/_mapping -d'{ "fulltext": { "_all": { "analyzer": "ik" }, "properties": { "content": { "type" : "string", "boost" : 8.0, "term_vector" : "with_positions_offsets", "analyzer" : "ik", "include_in_all" : true } } }}'
3、测试
curl 'http://localhost:9200/index/_analyze?analyzer=ik&pretty=true' -d '{"text":"世界如此之大"}'
显示结果如下:
{ "tokens" : [ { "token" : "text", "start_offset" : 4, "end_offset" : 8, "type" : "ENGLISH", "position" : 1 }, { "token" : "世界", "start_offset" : 11, "end_offset" : 13, "type" : "CN_WORD", "position" : 2 }, { "token" : "如此", "start_offset" : 13, "end_offset" : 15, "type" : "CN_WORD", "position" : 3 }, { "token" : "之大", "start_offset" : 15, "end_offset" : 17, "type" : "CN_WORD", "position" : 4 } ]}
- ElasticSearch及其插件的安装(二)
- Elasticsearch安装及其插件安装
- elasticsearch-2.1.0 及其插件head的安装
- elk安装及使用二(elasticsearch的简单使用及插件的安装)
- windows 下安装elasticsearch 及其插件head,ik,marvel
- ElasticSearch 菜鸟笔记(二)ElasticSearch 安装
- elasticsearch插件二—— kibana插件安装详解
- grunt学习(二)——安装grunt及其插件
- grunt学习(二)——安装grunt及其插件
- ElasticSearch的安装以及插件安装
- (二)ElasticSearch 分布式安装
- ElasticSearch教程(二)——ElasticSearch基本插件head
- elasticsearch marvel插件安装失败的解决方法
- Elasticsearch中文分词插件ik的安装
- Elasticsearch之插件head的安装问题
- elasticsearch的IK分词插件安装
- Elasticsearch插件head的安装(有坑)
- 在Linux安装elasticsearch的head插件
- MySQL数据文件介绍及存放位置
- UIScrollView(循环滚动图片)
- 调用startActivityForResult,onActivityResult无响应的问题
- Lookup Transformation(3) changes in informatica version 9
- 新手上路——jsp中jar包的调用 + 表单(form)的创建与提交
- ElasticSearch及其插件的安装(二)
- 输入框【动感光波】特效【输入字的时候出烟花】高大上
- 向量范数+不同范数之间的关系
- SSH免密码登录
- 提高网页加载速度最简单的5种方式
- DELPHI中记录的存储方式
- IE登陆局域网,记住错误密码的解决方法
- POJ 2888 Magic Bracelet(polya+矩阵快速幂)
- oracle 字符串截取