ES学习
1 优势
1.1 简单
1.1.1 相比Solor配置部署等非常简单
1.2 高效
1.2.1 ES使用Netty作为内部RPC框架,Solor使用Jetty
1.3 插件化
1.3.1 ES易扩展,编写插件即可
1.4 Clients丰富
1.4.1 Java、Python、Rest等各种客户端
1.5 http://www.cnblogs.com/chowmin/articles/4629220.html
1.6 架构
1.6.1
1.6.1.1
1.7 基础视频
1.7.1 https://www.douban.com/group/topic/94477155/
1.8 深入视频
1.8.1 http://www.roncoo.com/course/view/03b0916b225f4feb995586ab3e975c8f#boxTwo
1.8.2 http://www.roncoo.com/course/view/f6c7d5f0eef34b20b280621e42facbcf
1.9 ES中文文档
1.9.1 https://www.elastic.co/guide/cn/elasticsearch/guide/current/index.html
1.9.2 http://www.jianshu.com/p/2c7b0c76fa04
1.9.3 https://github.com/dzharii/awesome-elasticsearch
1.9.4 Subthttps://www.zhihu.com/topic/19899427/hotopic
1.10 与SPark等技术对比
1.10.1 https://www.zhihu.com/question/35214783
1.10.2 https://www.zhihu.com/topic/19899427/hot
1.10.3 https://www.zhihu.com/question/41109030
1.10.4 https://www.zhihu.com/question/35351352
1.10.5 https://github.com/chenryn/ELKstack-guide-cn/blob/master/SUMMARY.md
1.10.6 http://www.weixinnu.com/tag/article/1542492037
1.10.7 http://blog.csdn.net/u010022051/article/details/54342174
1.10.8 https://www.ibm.com/developerworks/cn/analytics/library/ba-1512-elkstack-logprocessing/index.html
2 核心概念
2.1 准实时、集群、节点
2.2 Index索引-DB、Type类型-Table、Document文档-Row-JSON
2.3 Shard分片、Replicas多副本
2.3.1 http://www.cnblogs.com/huangfox/p/3543351.html
2.3.2 分片数量索引创建之前指定,指定之后不可修改
2.3.2.1 文档存储到分片可以指定路由方法
2.3.3 多副本既可以容灾备份,也可以负载均衡提高查询效率
2.4 recovery再分配
2.4.1 集群增加删除节点会触发分片、副本的重新分配/数据平衡
2.5 Gateway
2.5.1 数据持久化方式
2.5.2 es支持多种类型gateway,本地文件系统、分布式文件系统、HDFS、S3等各种持久化方式
2.6 Transport
2.6.1 内部节点交互协议可定制,默认TCP,可以定制为http、thrift等
2.7 river
2.7.1 数据迁移,支持Redis、MySQL、Kafka、Rabbit等
2.8 beats
2.8.1 收据收集器-文件、监控数据等
2.9 辅助组件
2.9.1 防数据丢失、提高性能
2.9.2 shipper-->haproxy-->logstash-->redis/kafka-->logstash-->nginx-->es-->kibana
2.9.3 Master节点与DataNode分离
2.9.4 logstash、nginx参数调优,线程数、批量操作、吞吐率提高等方面rushou
2.9.5 推荐文章
2.9.5.1 http://www.jianshu.com/p/fa31f38d241e
2.9.5.2 https://zhuanlan.zhihu.com/p/22604199
3 部署
3.1 JDK
3.1.1 http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
3.2 版本5.6
3.2.1 https://www.elastic.co/guide/en/elasticsearch/reference/5.6/index.html
3.2.2 https://www.elastic.co/downloads
3.2.3 新版本优势何在?
3.2.3.1 http://weishiym.iteye.com/blog/2313992
3.3 启动问题
3.3.1 参考资料
3.3.1.1 http://blog.csdn.net/wang_zhenwei/article/details/53785048
3.3.1.2 http://blog.csdn.net/dream_flying_bj/article/details/67632448
3.3.1.3 http://blog.csdn.net/feifantiyan/article/details/54614614
3.3.2 unable to install syscall filter
3.3.2.1 升级内核
3.3.3 资源限制问题
3.3.3.1 文件描述符问题 &线程数限制问题
3.3.3.1.1 http://linux.vbird.org/linux_basic/0320bash.php#variable_ulimit
3.3.3.1.2 http://blog.csdn.net/jk0803_wantao/article/details/18614447
3.3.3.1.3 vi /etc/security/limits.conf
3.3.3.1.3.1 * soft nofile 65536 * hard nofile 131072 * soft nproc 2048 * hard nproc 4096 * soft memlock unlimited * hard memlock unlimited
3.3.3.2 线程数限制问题
3.3.3.2.1 vi /etc/security/limits.d/90-nproc.conf
3.3.3.2.1.1 * soft nproc 1024 #修改为 * soft nproc 2048
3.3.3.3 虚拟地址空间
3.3.3.3.1 vi /etc/sysctl.conf
3.3.3.3.1.1 vm.max_map_count=655360 sysctl -p
3.4 ansible部署ES参考
3.4.1 https://gitee.com/jiemo/ansible-elasticsearch/
3.4.2 https://www.digitalocean.com/community/tutorials/how-to-use-ansible-to-set-up-a-production-elasticsearch-cluster
3.4.3 https://github.com/thisismitch/ansible-tinc-elasticsearch-example
3.4.4 性能优化参数配置
3.4.4.1 http://zhaoyanblog.com/archives/826.html
3.4.4.2 http://www.bigdata1024.com/?p=109
3.4.4.3 http://1358440610-qq-com.iteye.com/blog/2336072
3.4.4.4 http://www.infoq.com/cn/news/2017/01/ElasticSearch-9
3.4.4.5 https://zhidao.baidu.com/question/691603793297721724.html
3.4.5 脑裂问题
3.4.5.1 https://zhidao.baidu.com/question/433342225658620604.html
3.4.5.2 http://blog.csdn.net/a19860903/article/details/72467996
3.4.6 Gateway Recover缓慢问题
3.4.6.1 http://blog.csdn.net/asia_kobe/article/details/51453034
3.5 集群部署
3.5.1 主机规划
3.5.1.1 10.20.0.11 node-01 10.20.0.12 node-02 10.20.0.13 node-03 10.20.0.14 node-04
3.6 基本操作
3.6.1 详见: README
3.6.2 如何支持JOIN
3.6.2.1 https://stackoverflow.com/questions/22611049/join-query-in-elasticsearch
3.6.2.2 https://segmentfault.com/a/1190000004468130
3.6.3 ElasticSearch提供了易用但功能强大的RESTful API以用于与集群进行交互,这些API大体可分为如下四类: (1)检查集群、节点、索引等健康与否,以及获取其相关状态与统计信息; (2)管理集群、节点、索引数据及元数据; (3)执行CRUD操作及搜索操作; (4)执行高级搜索操作,例如paging、filtering、scripting、faceting、aggregations及其它操作;
3.6.4 文档中,域的数据存储时支持“string”、“numbers”、“Booleans”和“dates”几种类型,不同类型的数据在索引时是略有区别的。 在创建文档时,Elasticsearch会通过检查域的值来动态为其创建mapping,可通过Mapping API来查看type的mapping,其访问端点是_mapping。
3.7 安装head插件
3.7.1 wget -O- https://raw.githubusercontent.com/aliyun-node/tnvm/master/install.sh | bash source ~/.bashrc tnvm install node-v8.6.0 tnvm use node-v8.6.0 tnvm current # 设置淘宝npm源 npm config set registry https://registry.npm.taobao.org --global npm config set disturl https://npm.taobao.org/dist --global vi ~/.npmrc registry = https://registry.npm.taobao.org disturl = https://npm.taobao.org/dist echo "registry = https://registry.npm.taobao.org > disturl = https://npm.taobao.org/dist > " >> ~/.npmrc # 验证设置成功 npm config get registry npm config get disturl sudo yum install zip unzip -y # https://github.com/mobz/elasticsearch-head unzip elasticsearch-head-1.x.zip cd elasticsearch-head-1.x 修改Gruntfile.js启动hostname npm install # npm install -g grunt-cli # grunt server npm run start # nohup npm run start >/dev/null 2>&1 &
3.7.1.1
3.8 安装Kibana
3.8.1 vi config/kibana.yml #server.host: "localhost" #elasticsearch.url: "http://localhost:9200" bin/kibana # nohup bin/kibana >/dev/null 2>&1 &
4 视频资料
4.1 https://www.douban.com/group/topic/94477155/
4.1.1 偏重实践
4.2 http://www.roncoo.com/course/view/03b0916b225f4feb995586ab3e975c8f
4.2.1 偏重核心原理
4.3 内部原理剖析
4.3.1 http://blog.csdn.net/zlh3955649/article/details/53169617
5 分词器
5.1 IK分词器
5.1.1 https://github.com/medcl/elasticsearch-analysis-ik
5.1.2 ES自带标准分词器对中文支持不友好,IK支持智能切词
5.1.3 ik_max_word:会将文本做最细粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,中华人民, 中华,华人,人民共和国,人民,人,民,共和国,共和,和,国国,国歌”,会穷尽各种可能的组合; ik_smart: 会做最粗粒度的拆分,比如会将“中华人民共和国国歌”拆分为“中华人民共和国,国歌”。
6 mapping
6.1 数据类型定义
6.1.1 示例
6.1.1.1
6.1.2 可以像mysql一样修改吗
6.2 新建文档
6.2.1
7 客户端
7.1 Java客户端
7.1.1 太麻烦
7.1.2 与spring、springdata、springboot等整合
7.1.3 与Netty、gRPC、Thrift等整合,提供RPC接口
7.2 Rest客户端
7.2.1 推荐方式、更加灵活
8 生产环境部署建议
8.1 硬件
8.1.1 内存
8.1.1.1 64G左右
8.1.2 CPU
8.1.2.1 多核
8.1.3 硬盘
8.1.3.1 RAID0,即不需要RAID级别的数据冗余
8.1.3.2 SSD,IO调度程序更改,显著影响性能
8.1.4 网络
8.1.4.1 不要跨数据中心,不要搞NAS之类存储
8.1.5 机器
8.1.5.1 中高配机器,而不是很多小机器
8.2 JVM
8.2.1 最新版本JVM,Java8
8.2.2 不要调整默认的JVM配置
8.3 有用配置
8.3.1 集群、节点名字
8.3.2 日志、数据路径
8.3.3 最小节点数防止脑裂
8.3.4 集群恢复最小节点数、等待时间防止频繁数据平衡
8.3.5 单播代替组播
8.3.6 不要修改垃圾回收器、不要修改线程数
8.3.7 设置堆内存为系统内存的一半,并设置Xms、Xmx一致,不要超过32G,可以调试得到最佳内存临界值, 不要使用内存交换: bootstrap.mlockall: true
8.3.8 文件描述符设置,MMap设置等
8.3.9 ES提高插入速度
8.3.9.1 https://www.zhihu.com/question/44976788
8.4 部署之后
8.4.1 监控健康状态、任务状态等信息
8.4.2 日志
8.4.2.1 慢日志记录
8.4.3 https://www.elastic.co/guide/cn/elasticsearch/guide/current/indexing-performance.html
8.4.4 批量请求
 
 

【ES】elasticsearch学习笔记的更多相关文章

  1. Elasticsearch学习笔记一

    Elasticsearch Elasticsearch(以下简称ES)是一款Java语言开发的基于Lucene的高效全文搜索引擎.它提供了一个分布式多用户能力的基于RESTful web接口的全文搜索 ...

  2. elasticsearch学习笔记——相关插件和使用场景

    logstash-input-jdbc学习 ES(elasticsearch缩写)的一大优点就是开源,插件众多.所以扩展起来非常的方便,这也造成了它的生态系统越来越强大.这种开源分享的思想真是与天朝格 ...

  3. ElasticSearch学习笔记(超详细)

    文章目录 初识ElasticSearch 什么是ElasticSearch ElasticSearch特点 ElasticSearch用途 ElasticSearch底层实现 ElasticSearc ...

  4. ElasticSearch学习笔记--2、ES相关配置

    1.配置文件 ES的配置文件位置:config/elasticsearch.yml可以直接搜索elasticsearch.yml 2.配置远程api访问 network.host: 192.168.1 ...

  5. 【原】无脑操作:ElasticSearch学习笔记(01)

    开篇来自于经典的“保安的哲学三问”(你是谁,在哪儿,要干嘛) 问题一.ElasticSearch是什么?有什么用处? 答:截至2018年12月28日,从ElasticSearch官网(https:// ...

  6. ElasticSearch学习笔记-01 简介、安装、配置与核心概念

    一.简介 ElasticSearch是一个基于Lucene构建的开源,分布式,RESTful搜索引擎.设计用于云计算中,能够达到实时搜索,稳定,可靠,快速,安装使用方便.支持通过HTTP使用JSON进 ...

  7. Elasticsearch学习笔记 一

    本文版权归博客园和作者吴双本人共同所有 转载和爬虫请注明原文地址 www.cnblogs.com/tdws. 本文参考和学习资料 <ES权威指南> 一.基本概念 存储数据到ES中的行为叫做 ...

  8. 2018/2/13 ElasticSearch学习笔记三 自动映射以及创建自动映射模版,ElasticSearch聚合查询

    终于把这些命令全敲了一遍,话说ELK技术栈L和K我今天花了一下午全部搞定,学完后还都是花式玩那种...E却学了四天(当然主要是因为之前上班一直没时间学,还有安装服务时出现的各种error真是让我扎心了 ...

  9. 2018/2/11 ELK技术栈之ElasticSearch学习笔记二

    终于有时间记录一下最近学习的知识了,其实除了写下的这些还有很多很多,但懒得一一写下了: ElasticSearch添加修改删除原理:ElasticSearch的倒排索引和文档一旦生成就不允许修改(其实 ...

随机推荐

  1. 【SQL】180. Consecutive Numbers

    Write a SQL query to find all numbers that appear at least three times consecutively. +----+-----+ | ...

  2. iOS Sprite Kit教程之编写程序以及Xcode的介绍

    iOS Sprite Kit教程之编写程序以及Xcode的介绍 Xcode界面介绍 一个Xcode项目由很多的文件组成,例如代码文件.资源文件等.Xcode会帮助开发者对这些文件进行管理.所以,Xco ...

  3. 鸟哥的私房菜:Bash shell(一)-Bash shell功能简介

    Bash shell系列里,由变量谈起,先讲到环境变量的功能与修改的问题, 然后会继续提到历史指令的运用.接下来,就会谈一下『数据流重导向』这个重要概念, 最后就是管线命令的利用! 一  Bash s ...

  4. 安装第三方jar包的两种方式

    由于部分第三放jar包没有放到maven中央仓库,而项目中又依赖了这些jar包,那么如何安装?我实践了两种,特做记录. 一.安装到 nexus 私有库: 在 3rd party 仓库下有个 Artif ...

  5. Express应用程序目录结构

    1.Node安装与使用 网上有很多Node的安装教程,可以做参考 2.MongoDB的安装与使用 MongoDB安装也有很多教程,可以去网上找找 3.初始化一个express项目 使用express框 ...

  6. BZOJ5217: [Lydsy2017省队十连测]航海舰队 FFT

    被FFT的空间卡了半天 后来发现根本不用开那么大... 首先可以把包含舰艇的那个小矩形找出来 将它一行一行连接成一个串T 其中舰艇位置为1其他位置为0 将大矩形也连成串S 其中礁石为1其他为0 两个串 ...

  7. ASP.NET MVC HttpVerbs.Delete/Put Routes not firing

    原文地址: https://weblog.west-wind.com/posts/2015/Apr/09/ASPNET-MVC-HttpVerbsDeletePut-Routes-not-firing ...

  8. [Linux] VIM Practical Note

    Practical Vim 文件 1.1. 管理多个文件 1.1.1. 缓冲区 • :ls • 查看缓冲区列表 • :bprev • 前一项 • :bnext • 后一项 • :bfirst • 第一 ...

  9. 图之Dijkstra算法

    Dijkstra算法是一种求单源最短路的算法,即从一个点开始到所有其他点的最短路.其步骤如下: c语言实现如下:(使用邻接矩阵存储) #include <stdio.h> #include ...

  10. Thinkpad T440p安装Linux的种种问题(by quqi99)

    作者:张华  发表于:2014-05-08 版权声明:能够随意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明 (http://blog.csdn.net/quqi99 ) Thi ...