Elasticsearch Getting Started Basic Concepts

本文深入解析Elasticsearch的核心概念,包括近实时搜索、集群、节点、索引、文档、分片和副本等,帮助读者理解其工作原理及如何进行有效配置。
Basic Concepts

There are a few concepts that are core to Elasticsearch. Understanding these concepts from the outset will tremendously help ease the learning process.
Elasticsearch 的核心概念,从一开始就理解这些概念将极大地帮助简化学习过程。

Near Realtime (NRT)

近实时
Elasticsearch is a near-realtime search platform. What this means is there is a slight latency (normally one second) from the time you index a document until the time it becomes searchable.
Elasticsearch 是一个近实时的搜索平台,这意味着从搜索文档到可搜索文档的时间有一点延迟(通常是1s)。

Cluster

集群
A cluster is a collection of one or more nodes (servers) that together holds your entire data and provides federated indexing and search capabilities across all nodes. A cluster is identified by a unique name which by default is “elasticsearch”. This name is important because a node can only be part of a cluster if the node is set up to join the cluster by its name.
集群是一个或更多节点(服务器)的集合,它们共同保存你的整个数据,并通过所有节点提供联合索引和搜索功能。集群由唯一名称标识,默认情况下为"elasticsearch"。这个名称很重要,因为如果节点设置为按名称加入集群,则该节点只能是集群的一部分。

Make sure that you don’t reuse the same cluster names in different environments, otherwise you might end up with nodes joining the wrong cluster. For instance you could use logging-dev, logging-stage, and logging-prod for the development, staging, and production clusters.
确保你没有在不同环境重用相同集群名称,否则你可能将节点加入错误的集群。例如,你可以使用logging-dev、logging-stage 和 logging-prod 用于开发、stage和生产集群。

Note that it is valid and perfectly fine to have a cluster with only a single node in it. Furthermore, you may also have multiple independent clusters each with its own unique cluster name.
注意,一个集群只有一个节点是完全正常的。此外,你还可以有多个独立的集群,每个集群有自己唯一的集群名称。

Node

节点
A node is a single server that is part of your cluster, stores your data, and participates in the cluster’s indexing and search capabilities. Just like a cluster, a node is identified by a name which by default is a random Universally Unique IDentifier (UUID) that is assigned to the node at startup. You can define any node name you want if you do not want the default. This name is important for administration purposes where you want to identify which servers in your network correspond to which nodes in your Elasticsearch cluster.
一个节点是作为集群一部分的单个服务器,存储数据,并且参与集群索引和搜索功能。像集群一样,一个节点是通过名称唯一标识,默认是一个随机的UUID,在节点启动的时候分配给节点。如果你不想使用默认的,你可以定义你需要的的任何节点名称。
这个名称对于管理目的很重要,你可以识别网络中的哪些服务器与Elasticsearch 集群中的哪些节点相对应。

A node can be configured to join a specific cluster by the cluster name. By default, each node is set up to join a cluster named elasticsearch which means that if you start up a number of nodes on your network and—​assuming they can discover each other—​they will all automatically form and join a single cluster named elasticsearch.
一个节点可以通过配置集群名称加入到一个指定的集群。默认情况下,每个节点设置为加入集群名为elasticsearch 的集群,这意味着如果启动了多个网络上的节点-假设它们可以发现彼此-他们将自动完成组成并加入名为elasticsearch 的单个集群。

In a single cluster, you can have as many nodes as you want. Furthermore, if there are no other Elasticsearch nodes currently running on your network, starting a single node will by default form a new single-node cluster named elasticsearch.
在单个集群,你可以有任意多的节点。此外,如果当前运行在你的网络中没有其他Elasticsearch 节点,默认情况下,启动一个单节点将形成一个名为elasticsearch 的新单节点集群。

Index

索引
An index is a collection of documents that have somewhat similar characteristics. For example, you can have an index for customer data, another index for a product catalog, and yet another index for order data. An index is identified by a name (that must be all lowercase) and this name is used to refer to the index when performing indexing, search, update, and delete operations against the documents in it.
索引是具有某些相似特征的文档(document)集合。例如,你可以有客户数据的索引,产品目录的索引,还有另一个订单数据的索引。一个索引通过名称(必须全部小写)唯一标识。并且这个名称是用于在对其中的文档执行索引、搜索、更新和删除操作时引用索引。

In a single cluster, you can define as many indexes as you want.
在单个集群中,你可以定义任意多的索引。

Type

类型
Warning
Deprecated in 6.0.0.
See Removal of mapping types
在6.0.0中被废弃。

A type used to be a logical category/partition of your index to allow you to store different types of documents in the same index, e.g. one type for users, another type for blog posts. It is no longer possible to create multiple types in an index,
and the whole concept of types will be removed in a later version. See Removal of mapping types for more.
一个类型(type)曾经是索引的一个逻辑类别/分区,允许你在同一个索引(index)中存储不同类型的文档(document),例如,一个用户类型,另一个博客文章类型。在一个索引中不能创建多个类型,并且在以后的版本中类型概念将被移除。

Document

文档
A document is a basic unit of information that can be indexed. For example, you can have a document for a single customer, another document for a single product, and yet another for a single order. This document is expressed in JSON (JavaScript Object Notation) which is a ubiquitous internet data interchange format.
文档是可以建立索引的基本信息单元。例如,你可以为单个客户创建一个文档(document),为单个产品创建一个文档(document),还有单个订单。这个文档(document)用JSON表示(这是一种无处不在的互联网数据交换格式)。

Within an index/type, you can store as many documents as you want. Note that although a document physically resides in an index, a document actually must be indexed/assigned to a type inside an index.
在索引/类型中,可以存储任意类型的文档。注意,尽管文档实际上位于索引中,文档实际上必须被索引/分配 给索引中的类型。

Shards & Replicas

分片和副本
An index can potentially store a large amount of data that can exceed the hardware limits of a single node. For example, a single index of a billion documents taking up 1TB of disk space may not fit on the disk of a single node or may be too slow to serve search requests from a single node alone.
索引可能存储大量的数据,可能超过单节点的硬盘限制。例如,占用1TB磁盘空间的十亿文档的单索引可能不适合在单节点的磁盘,或者可能对于单节点服务搜索请求会太慢。

To solve this problem, Elasticsearch provides the ability to subdivide your index into multiple pieces called shards. When you create an index, you can simply define the number of shards that you want. Each shard is in itself a fully-functional and independent “index” that can be hosted on any node in the cluster.
为了解决这个问题,Elasticsearch 提供了拆分索引成多个片的功能叫作分片(shards)。当你创建一个索引的时候,你可以定义你想要的分片数量。每个分片本身都是功能齐全且独立的索引,可以托管在集群中的任何节点上。

Sharding is important for two primary reasons:
分片之所以重要,主要有两个原因:

  • It allows you to horizontally split/scale your content volume
  • It allows you to distribute and parallelize operations across shards (potentially on multiple nodes) thus increasing performance/throughput
    允许你水平拆分/扩展你的数据
    允许你跨分片(可能在多个节点)分布和并行操作,从而提升性能/吞吐量

The mechanics of how a shard is distributed and also how its documents are aggregated back into search requests are completely managed by Elasticsearch and is transparent to you as the user.
分片如何分布以及如何将其文档聚合回搜索请求的机制完全由Elasticsearch 管理,对用户来说是透明的。

In a network/cloud environment where failures can be expected anytime, it is very useful and highly recommended to have a failover mechanism in case a shard/node somehow goes offline or disappears for whatever reason. To this end, Elasticsearch allows you to make one or more copies of your index’s shards into what are called replica shards, or replicas for short.
在一个网络/云环境中可能随时出现故障,这是非常有用并且强烈推荐有一个失败转移机制,以防一个分片/节点由于某种原因离线或消失。为此,Elasticsearch 允许你创建一个或多个复制索引分片,被称作副本分片,或简称副本。

Replication is important for two primary reasons:
副本之所以重要,主要有两个原因:

  • It provides high availability in case a shard/node fails. For this reason, it is important to note that a replica shard is never allocated on the same node as the original/primary shard that it was copied from.
  • It allows you to scale out your search volume/throughput since searches can be executed on all replicas in parallel.
    它在一个分片/节点出现故障时提供高可用,为此原因,请务必注意,一个副本分片从不与它复制的源/主分配(original/primary shard)分配在同一节点上。
    它允许你扩展搜索量/吞吐量,因为可以在所有副本上并行执行搜索。

To summarize, each index can be split into multiple shards. An index can also be replicated zero (meaning no replicas) or more times. Once replicated, each index will have primary shards (the original shards that were replicated from) and replica shards (the copies of the primary shards).
总结,每个索引可以被拆分成多个分片,一个索引可以被复制零(意味着没有副本)或多次。复制后,每个索引将具有主分片(primary shards,从中复制的原始分片)和副本分片(replica shards,主分片的副本)。

The number of shards and replicas can be defined per index at the time the index is created. After the index is created, you may also change the number of replicas dynamically anytime. You can change the number of shards for an existing index using the _shrink and _split APIs, however this is not a trivial task and pre-planning for the correct number of shards is the optimal approach.
在创建索引的时候,分片和副本的数量可以自定义。索引被创建之后,你也可以在任何时候动态的改变副本数量。对于已存在的索引,你可以使用_shrink 和 _split API改变分片数量,然而,这不是一个微不足道的任务,预先规划正确数量的分片是最佳方法。

By default, each index in Elasticsearch is allocated 5 primary shards and 1 replica which means that if you have at least two nodes in your cluster, your index will have 5 primary shards and another 5 replica shards (1 complete replica) for a total of 10 shards per index.
默认情况下,Elasticsearch 中的每个索引分配了5个主分片和1个副本,这意味着如果在你的集群中至少2个节点,你的索引将有5个主分片和另外5个副本分片(1个完整副本),每个索引总共有10个分片。

Each Elasticsearch shard is a Lucene index. There is a maximum number of documents you can have in a single Lucene index. As of LUCENE-5843, the limit is 2,147,483,519 (= Integer.MAX_VALUE - 128) documents. You can monitor shard sizes using the _cat/shards API.
每个Elasticsearch 分片都是Lucene 索引。在单个Lucene 索引上包含最多文档,在LUCENE-5843中,限制为2,147,483,519 (= Integer.MAX_VALUE - 128) 个文档。 你可以使用_cat/shards API 监控分片大小。

With that out of the way, let’s get started with the fun part…​
有了这个,让我们开始有趣的部分…

内容概要:本文是一篇关于使用RandLANet模型对SensatUrban数据集进行点云语义分割的实战教程,系统介绍了从环境搭建、数据准备、模型训练与测试到精度评估的完整流程。文章详细说明了在Ubuntu系统下配置TensorFlow 2.2、CUDA及cuDNN等深度学习环境的方法,并指导用户下载和预处理SensatUrban数据集。随后,逐步讲解RandLANet代码的获取与运行方式,包括训练、测试命令的执行与参数含义,以及如何监控训练过程中的关键指标。最后,教程涵盖测试结果分析、向官方平台提交结果、解读评估报告及可视化效果等内容,并针对常见问题提供解决方案。; 适合人群:具备一定深度学习基础,熟悉Python编程和深度学习框架,从事计算机视觉或三维点云相关研究的学生、研究人员及工程师;适合希望动手实践点云语义分割项目的初学者与进阶者。; 使用场景及目标:①掌握RandLANet网络结构及其在点云语义分割任务中的应用;②学会完整部署一个点云分割项目,包括数据处理、模型训练、测试与性能评估;③为参与相关竞赛或科研项目提供技术支撑。; 阅读建议:建议读者结合提供的代码链接和密码访问完整资料,在本地或云端环境中边操作边学习,重点关注数据格式要求与训练参数设置,遇到问题时参考“常见问题与解决技巧”部分及时排查。
内容概要:本文详细介绍了三相异步电机SVPWM-DTC(空间矢量脉宽调制-直接转矩控制)的Simulink仿真实现方法,结合DTC响应快与SVPWM谐波小的优点,构建高性能电机控制系统。文章系统阐述了控制原理,包括定子磁链观测、转矩与磁链误差滞环比较、扇区判断及电压矢量选择,并通过SVPWM技术生成固定频率PWM信号,提升系统稳态性能。同时提供了完整的Simulink建模流程,涵盖电机本体、磁链观测器、误差比较、矢量选择、SVPWM调制、逆变器驱动等模块的搭建与参数设置,给出了仿真调试要点与预期结果,如电流正弦性、转矩响应快、磁链轨迹趋圆等,并提出了模型优化与扩展方向,如改进观测器、自适应滞环、弱磁控制和转速闭环等。; 适合人群:电气工程、自动化及相关专业本科生、研究生,从事电机控制算法开发的工程师,具备一定MATLAB/Simulink和电机控制理论基础的技术人员。; 使用场景及目标:①掌握SVPWM-DTC控制策略的核心原理与实现方式;②在Simulink中独立完成三相异步电机高性能控制系统的建模与仿真;③通过仿真验证控制算法有效性,为实际工程应用提供设计依据。; 阅读建议:学习过程中应结合文中提供的电机参数和模块配置逐步搭建模型,重点关注磁链观测、矢量选择表和SVPWM调制的实现细节,仿真时注意滞环宽度与开关频率的调试,建议配合MATLAB官方工具箱文档进行参数校准与结果分析。
已经博主授权,源码转载自 https://pan.quark.cn/s/bf1e0d5b9490 本文重点阐述了Vue2.0多Tab切换组件的封装实践,详细说明了通过封装Tab切换组件达成多Tab切换功能,从而满足日常应用需求。 知识点1:Vue2.0多Tab切换组件的封装* 借助封装Tab切换组件,达成多Tab切换功能* 支持tab切换、tab定位、tab自动化仿React多Tab实现知识点2:TabItems组件的应用* 在index.vue文件中应用TabItems组件,借助name属性设定tab的标题* 通过:isContTab属性来设定tab的内容* 能够采用子组件作为tab的内容知识点3:TabItems组件的样式* 借助index.less文件来设定TabItems组件的样式* 设定tab的标题样式、背景色彩、边框样式等* 使用animation达成tab的切换动画知识点4:Vue2.0多Tab切换组件的构建* 借助运用Vue2.0框架,达成多Tab切换组件的封装* 使用Vue2.0的组件化理念,达成TabItems组件的封装* 通过运用Vue2.0的指令和绑定机制,达成tab的切换功能知识点5:Vue2.0多Tab切换组件的优势* 达成多Tab切换功能,满足日常应用需求* 支持tab切换、tab定位、tab自动化仿React多Tab实现* 能够满足多样的业务需求,具备良好的扩展性知识点6:Vue2.0多Tab切换组件的应用场景* 能够应用于多样的业务场景,例如:管理系统、电商平台、社交媒体等* 能够满足不同的业务需求,例如:多Tab切换、数据展示、交互式操作等* 能够与其它Vue2.0组件结合运用,达成复杂的业务逻辑Vue2.0多Tab切换组件的封装实例提供了...
代码下载地址: https://pan.quark.cn/s/41cd695ddf65 `htmldiff` 是一个以 Ruby 语言为基础构建的库,其主要功能是在 HTML 文档中展示文本之间的差异。 该库的一个显著特点在于它不仅能够识别出不同之处,还会借助 HTML 标签来呈现这些差异,从而让用户能够直观地观察到文本的变化情况。 这种特性使得 `htmldiff` 在版本控制、文档对比或任何需要展示文本变动场景的应用中显得尤为有用。 `htmldiff` 的核心作用是对比两个字符串,并生成一个 HTML 输出结果,这个结果会明确地指出哪些部分被添加、哪些部分被删除以及哪些部分被修改。 此外,通过运用 CSS,用户可以进一步调整差异展示的样式,使其与项目或网站的现有设计风格相协调。 在使用 `htmldiff` 之前,需要先完成该库的安装。 如果项目已经配置了 Ruby 环境和 Gemfile,可以在 Gemfile 文件中添加 `gem htmldiff` 语句,随后执行 `bundle install` 命令进行安装。 如果没有 Gemfile 文件,也可以直接采用 `gem install htmldiff` 命令来进行全局安装。 在编程实现时,可以通过调用 `Htmldiff.diff` 方法来对比两个字符串,并获取相应的 HTML 输出。 例如:```rubyrequire htmldiffstr1 = "这是一个示例文本。 "str2 = "这是一个示例文本,现在有更多内容。 "diff_html = Htmldiff.diff(str1, str2)puts diff_html```上述代码将会输出两个字符串之间的差异,其中新增的内容会被 `<ins>` 标签所包围,而...
源码地址: https://pan.quark.cn/s/4b03c5611266 依据所提供的资料,可以判定这份资料是关于《电子技术基础模拟部分》第五版教科书第七章节的习题解析,由湖南人文科技学院通信与控制工程系的田汉平教师提供。 尽管具体内容未予展示,但能够围绕模拟电子技术的基础理论、第七章节所涉及的核心概念以及潜在的习题种类等方面来展开相关知识点的阐述。 ### 模拟电子技术概述模拟电子技术是电子工程学科中的一个关键领域,主要探讨模拟信号的产生、转换、传输和处理等议题。 模拟信号是指时间与幅度上均呈现连续变化的电信号。 模拟电路的设计与剖析是模拟电子技术的核心,它涵盖了放大器、振荡器、滤波器等电路的设计原理及其应用。 ### 第七章核心知识点猜测#### 1. 放大电路分析与设计- **基本放大电路**:共射极、共基极和共集电极放大电路的特性及其应用场景。 - **多级放大电路**:掌握如何将多个放大电路串联,以提升增益或优化频率响应。 - **差分放大电路**:用于抑制共模信号,放大差模信号,是精密仪器和测量设备中的关键构成部分。 #### 2. 反馈电路与稳定性- **反馈的基本概念**:正反馈与负反馈的区分,以及它们在电路中的应用场景。 - **深度负反馈**:解析深度负反馈状态下的放大器性能改进,包括增益稳定性和带宽的拓宽。 - **振荡电路**:理解LC振荡器、RC振荡器的工作机制及应用领域。 #### 3. 功率放大器- **A类、B类、AB类功率放大器**:熟练掌握不同类型功率放大器的特性、效率及其适用环境。 - **热效应与保护措施**:讨论在功率放大器设计过程中需要关注的散热问题及相应的防护措施。 #### 4. 集成运算放大器的应用- **理想运放模型**:熟...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值