- 浏览: 146376 次
文章分类
最新评论
-
x_looking:
Client client = new TransportCl ...
ELASTICSEARCH常见问题 -
辣de冷wmyes:
ElasticSearch视频教程百度网盘地址:http:// ...
一、Elasticsearch安装使用教程
elasticsearch说明
- 博客分类:
- elasticsearch
官网地址:http://www.elasticsearch.org/
1、下载:http://www.elasticsearch.org/downloads/ 解压无须修改即可运行。
2、使用elasticsearch-servicewrapper这个es插件,它支持通过参数,指定是在后台或前台运行es,并且支持启动,停止,重启es服务(默认es脚本只能通过ctrl+c关闭es)。使用方法是到https://github.com/elasticsearch/elasticsearch-servicewrapper下载service文件夹,放到es的bin目录下。下面是命令集合:
bin/service/elasticsearch +
console 在前台运行es
start 在后台运行es
stop 停止es
install 使es作为服务在服务器启动时自动启动
remove 取消启动时自动启动
例子:elasticsearch start
3、插件安装:(这些插件单机也可以使用)
集群管理插件(集群状态、查询数据、RESTful api的调用等)
安装命令:bin/plugin -install mobz/elasticsearch-head
使用:http://localhost:9200/_plugin/head/
源代码地址:https://github.com/Aconex/elasticsearch-head
集群监控插件(集群状态、cpu、内存等)
安装命令:plugin -install lukas-vlcek/bigdesk
使用:http://localhost:9200/_plugin/bigdesk/
源代码地址:https://github.com/lukas-vlcek/bigdesk
集群监控(感觉是上面两个的综合体,但是功能没有那么齐全,但是界面美观一些)
安装命令:plugin -install royrusso/elasticsearch-HQ
使用:http://localhost:9200/_plugin/HQ/
源代码地址:https://github.com/royrusso/elasticsearch-HQ
搜索建议
安装命令:bin/plugin -install de.spinscale/elasticsearch-plugin-suggest/0.90.5-0.9
源代码地址:https://github.com/spinscale/elasticsearch-suggest-plugin
4、配置中文分词
mmseg 为例:
下载https://github.com/medcl/elasticsearch-analysis-mmseg 这是源代码
可以到https://github.com/medcl/elasticsearch-rtf 下载下来,复制pugin/analysis-mmseg、
config/ mmseg 到自己es对于的目录 中。在config/elasticsearch.yml 文件中添加如下内容:
index:
analysis:
tokenizer:
mmseg_maxword:
type: mmseg
seg_type: "max_word"
mmseg_complex:
type: mmseg
seg_type: "complex"
mmseg_simple:
type: mmseg
seg_type: "simple"
到此中文分词配置好了,在新建mapping的时候,设置运用该分词就可以了,如果新建mapping 的时候需要分词但是没有指定分词器就会运用默认的分词器,可以在elasticsearch.yml配置默认分词器:
index.analysis.analyzer.default.type : "mmseg"
5、安装集群
es 不需要任何配置就可以搭建一个集群,它是通过elasticsearch.yml中的 cluster.name (集群名称) 来区分的,新启动一个es会根据cluster.name 加入到对应的集群中去,所以我们在一个局域网中可以配置不同的cluster.name 来建立多个集群。
完成上面所有的配置,复制到多台机子上启动即可。
单机也可做集群,也是复制多个启动即可。(端口会自动递增的)
ElasticSearch 的基本概念。
Index
可以把 ElasticSearch 的 Index 理解为 MySQL 的一个数据库。
Type
可以理解为 MySQL 中的一个表
Document
ElasticSearch 中的一个 document 相当于 MySQL 某个表中的一条记录。它是 JSON 结构。
它存储在某个 index(数据库)的某个 type(表)中。
每个 document 都有一个唯一的 id,有不同的字段(field),简直和 MySQL 一模一样。
>> index >> type >> document
Mapping
可以理解为 MySQL 的表结构(table schema)
Cluster
很多个 ElasticSearch 的节点(node)可以构成一个分布式的集群(cluster)。
Shard
每个 index 的数据默认切分到 5 个 shards 中。
有点像 MongoDB,也有点像 MySQL 表的水平分割。
1、下载:http://www.elasticsearch.org/downloads/ 解压无须修改即可运行。
2、使用elasticsearch-servicewrapper这个es插件,它支持通过参数,指定是在后台或前台运行es,并且支持启动,停止,重启es服务(默认es脚本只能通过ctrl+c关闭es)。使用方法是到https://github.com/elasticsearch/elasticsearch-servicewrapper下载service文件夹,放到es的bin目录下。下面是命令集合:
bin/service/elasticsearch +
console 在前台运行es
start 在后台运行es
stop 停止es
install 使es作为服务在服务器启动时自动启动
remove 取消启动时自动启动
例子:elasticsearch start
3、插件安装:(这些插件单机也可以使用)
集群管理插件(集群状态、查询数据、RESTful api的调用等)
安装命令:bin/plugin -install mobz/elasticsearch-head
使用:http://localhost:9200/_plugin/head/
源代码地址:https://github.com/Aconex/elasticsearch-head
集群监控插件(集群状态、cpu、内存等)
安装命令:plugin -install lukas-vlcek/bigdesk
使用:http://localhost:9200/_plugin/bigdesk/
源代码地址:https://github.com/lukas-vlcek/bigdesk
集群监控(感觉是上面两个的综合体,但是功能没有那么齐全,但是界面美观一些)
安装命令:plugin -install royrusso/elasticsearch-HQ
使用:http://localhost:9200/_plugin/HQ/
源代码地址:https://github.com/royrusso/elasticsearch-HQ
搜索建议
安装命令:bin/plugin -install de.spinscale/elasticsearch-plugin-suggest/0.90.5-0.9
源代码地址:https://github.com/spinscale/elasticsearch-suggest-plugin
4、配置中文分词
mmseg 为例:
下载https://github.com/medcl/elasticsearch-analysis-mmseg 这是源代码
可以到https://github.com/medcl/elasticsearch-rtf 下载下来,复制pugin/analysis-mmseg、
config/ mmseg 到自己es对于的目录 中。在config/elasticsearch.yml 文件中添加如下内容:
index:
analysis:
tokenizer:
mmseg_maxword:
type: mmseg
seg_type: "max_word"
mmseg_complex:
type: mmseg
seg_type: "complex"
mmseg_simple:
type: mmseg
seg_type: "simple"
到此中文分词配置好了,在新建mapping的时候,设置运用该分词就可以了,如果新建mapping 的时候需要分词但是没有指定分词器就会运用默认的分词器,可以在elasticsearch.yml配置默认分词器:
index.analysis.analyzer.default.type : "mmseg"
5、安装集群
es 不需要任何配置就可以搭建一个集群,它是通过elasticsearch.yml中的 cluster.name (集群名称) 来区分的,新启动一个es会根据cluster.name 加入到对应的集群中去,所以我们在一个局域网中可以配置不同的cluster.name 来建立多个集群。
完成上面所有的配置,复制到多台机子上启动即可。
单机也可做集群,也是复制多个启动即可。(端口会自动递增的)
ElasticSearch 的基本概念。
Index
可以把 ElasticSearch 的 Index 理解为 MySQL 的一个数据库。
Type
可以理解为 MySQL 中的一个表
Document
ElasticSearch 中的一个 document 相当于 MySQL 某个表中的一条记录。它是 JSON 结构。
它存储在某个 index(数据库)的某个 type(表)中。
每个 document 都有一个唯一的 id,有不同的字段(field),简直和 MySQL 一模一样。
>> index >> type >> document
Mapping
可以理解为 MySQL 的表结构(table schema)
Cluster
很多个 ElasticSearch 的节点(node)可以构成一个分布式的集群(cluster)。
Shard
每个 index 的数据默认切分到 5 个 shards 中。
有点像 MongoDB,也有点像 MySQL 表的水平分割。
发表评论
-
使用 Scripted Metric Aggregation 遇到的问题
2016-02-19 14:12 2412使用Scripted Metric Aggregation进行 ... -
ElasticSearch性能优化策略
2016-02-17 19:42 3494ElasticSearch性能优化主要分为4个方面的优化。 一 ... -
Elasticsearch 数据建模 - 处理关联关系
2016-02-17 14:40 1028数据建模(Modeling Your Data ... -
数据类型转换错误
2016-02-15 18:28 1560异常: Invalid shift value (64) in ... -
elasticsearch 排序异常,关键字冲突
2016-02-03 12:35 5815org.elasticsearch.action.search ... -
ElasticSearch不同类型下同名字段排序错误
2016-02-03 11:18 1900虽然之前知道elasticsearch不同类型下同名字段要慎用 ... -
ElasticSearch immense term错误
2016-02-02 19:07 2574在使用ElasticSearch的过程中遇到了一个immens ... -
ELASTICSEARCH常见问题
2015-09-22 15:39 31631. ELASTICSEARCH建索引过程中崩溃问题追查 by ... -
routing实例1
2015-09-21 18:51 0package com.eg.part1; import j ... -
routing实例
2015-09-21 18:49 0创建索引: PUT /useraudit_v1 创建索引别名: ... -
elasticsearch 精确,模糊查询实例
2015-09-19 23:55 62527实例 http://www.bubuko.com/infode ... -
elasticsearch java调用实例
2015-09-19 23:55 3503http://outofmemory.cn/code-snip ... -
[维护]Elasticsearch零停机时间更新索引配置或迁移索引
2015-09-18 10:16 754另外一篇文章:http://blog.csdn.net/dm_ ... -
elasticsearch 的mapping定义
2015-09-18 10:16 1168elasticsearch 的mapping 例子一: 订单 ... -
ElasticSearch基础杂烩-配置-索引-优化
2015-09-19 23:56 604http://blog.csdn.net/huwei2003/ ... -
Elasticsearch安装中文分词插件ik
2015-09-18 10:15 1995安装步骤: 1、到github ... -
ElasticSearch的各种服务的URL
2015-09-18 10:15 494前言 elasticsearch 将各种功能、配置、服务都以A ... -
ElasticSearch集群搭建
2015-09-19 23:56 543http://www.linuxidc.com/Linux/2 ... -
elasticsearch 配置
2015-09-18 10:16 670elasticsearch.conf 主要是设置一些java运 ... -
elasticsearch中文分词集成
2015-09-17 09:35 570elasticsearch官方只提供smartcn这个中文分词 ...
相关推荐
casio计算器fx-991ES说明书 原版清晰 强大的casio计算器说明书,帮你解一元三次方程,解各类复杂数学运算的好助手 欢迎下载
Haier海尔冰箱BC-50ES说明书使用安装手册参数图解图示pdf电子版下载.pdf
卡西欧科学计算器fx-991ES说明书,中文版
卡西欧fx-82ES、fx-83ES、fx-85ES、fx-300ES、fx-350ES说明书
得力函数型计算器D991ES使用说明书.pdf
台达可编程控制器(PLC)DVP32ES2-C安装说明pdf,台达可编程控制器(PLC)DVP32ES2-C安装说明:此主机提供32 点数输入/输出(16 点数字量输入、16 点数字量输出及内建CANopen 网络),含主机最大输入/输出扩展最多可...
Deli得力D82ES函数计算器说明书.pdf
DELTA_PLC_ES2说明书.pdf
赠送jar包:elasticsearch-6.8.3.jar; 赠送原API文档:elasticsearch-6.8.3-javadoc.jar; 赠送源代码:elasticsearch-6.8.3-sources.jar; 赠送Maven依赖信息文件:elasticsearch-6.8.3.pom; 包含翻译后的API文档...
赠送jar包:elasticsearch-6.3.0.jar; 赠送原API文档:elasticsearch-6.3.0-javadoc.jar; 赠送源代码:elasticsearch-6.3.0-sources.jar; 赠送Maven依赖信息文件:elasticsearch-6.3.0.pom; 包含翻译后的API文档...
台达可编程控制器(PLC)DVP-ES2安装说明pdf,台达可编程控制器(PLC)DVP-ES2安装说明
赠送jar包:elasticsearch-6.8.3.jar; 赠送原API文档:elasticsearch-6.8.3-javadoc.jar; 赠送源代码:elasticsearch-6.8.3-sources.jar; 赠送Maven依赖信息文件:elasticsearch-6.8.3.pom; 包含翻译后的API文档...
casio计算器-fx991ES-简体中文使用说明书.pdf casio计算器-fx991ES-简体中文使用说明书.pdf
雷克萨斯ES200 260 300h车型手册汽车说明书pdf电子版下载
赠送jar包:elasticsearch-6.2.3.jar; 赠送原API文档:elasticsearch-6.2.3-javadoc.jar; 赠送源代码:elasticsearch-6.2.3-sources.jar; 赠送Maven依赖信息文件:elasticsearch-6.2.3.pom; 包含翻译后的API文档...
可以编一些比较复杂的小计算程序!也要以用作使用说明
赠送jar包:elasticsearch-x-content-6.3.0.jar; 赠送原API文档:elasticsearch-x-content-6.3.0-javadoc.jar; 赠送源代码:elasticsearch-x-content-6.3.0-sources.jar; 赠送Maven依赖信息文件:elasticsearch-x...
赠送jar包:elasticsearch-rest-client-6.8.3.jar; 赠送原API文档:elasticsearch-rest-client-6.8.3-javadoc.jar; 赠送源代码:elasticsearch-rest-client-6.8.3-sources.jar; 赠送Maven依赖信息文件:elastic...
ElasticSearch部署操作说明