IT数码 购物 网址 头条 软件 日历 阅读 图书馆
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
图片批量下载器
↓批量下载图片,美女图库↓
图片自动播放器
↓图片自动播放器↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁
 
   -> 大数据 -> 【ES实战】ES-Hadoop中的配置项说明 -> 正文阅读

[大数据]【ES实战】ES-Hadoop中的配置项说明

Configuration 配置

elasticsearch-hadoop 行为可以通过以下属性进行自定义,通常通过在目标作业的 Hadoop 配置中设置它们。 但是,其中一些可以通过其他方式指定,具体取决于所使用的库(请参阅相关部分)。

elasticsearch-hadoop 使用与 Elasticsearch 相同的约定和合理的默认值,因此您可以尝试它而无需打扰配置。 大多数情况下,这些默认值对于运行生产集群来说已经足够了。 如果您正在微调您的集群或想知道某些配置选项的效果,请询问更多信息。

所有配置属性都以 es 前缀开头。 命名空间 es.internal 由库保留供其内部使用,用户在任何时候都不应使用。

必要配置

es.resource

Elasticsearch 资源位置,读取和写入数据的位置。 需要 / 格式(相对于 Elasticsearch 主机/端口(见下文))。

es.resource = twitter/tweet 

es.resource.read(defaults to es.resource)

用于读取(但不写入)数据的 Elasticsearch 资源。 在同一作业中向不同的 Elasticsearch 索引读取和写入数据时很有用。 通常自动设置(需要手动配置的 Map/Reduce 模块除外)。

es.resource.write(defaults to es.resource)

用于写入(但不读取)数据的 Elasticsearch 资源。 通常用于动态资源写入或将数据写入和读取同一作业中的不同 Elasticsearch 索引时。 通常自动设置(需要手动配置的 Map/Reduce 模块除外)。

请注意,在上述资源设置中指定多个索引 and/or 类型仅允许读取。 仅通过使用动态资源(如下所述)支持为写入指定多个索引。 使用_all/types搜索所有索引中的类型或使用index/搜索index中的所有types。 请注意,读取多个索引/类型通常仅在它们具有相同结构且仅适用于某些库时才有效。 需要强类型映射(例如 Hive 或 SparkSQL 之类的表)的集成可能会失败。

Dynamic/multi resource writes

在使用动态资源写入时,需要config [action.auto_create_index] to [true]

对于写入,elasticsearch-hadoop 允许在运行时使用模式(通过使用 {<field-name>} 格式)解析目标资源,在运行时根据流式传输到 Elasticsearch 的数据进行解析。 也就是说,可以根据从要保存的文档中解析出的一个或多个字段将文档保存到特定的indextype

例如,假设以下文档集(为了便于阅读,此处以 JSON 格式描述 - 随意将其转换为实际的 Java 对象):

{
    "media_type":"game",
    "title":"Final Fantasy VI",
    "year":"1994"
},
{
    "media_type":"book",
    "title":"Harry Potter",
    "year":"2010"
},
{
    "media_type":"music",
    "title":"Surfing With The Alien",
    "year":"1987"
}

要根据它们的media_type对它们中的每一个进行索引,将使用以下模式:

# index the documents based on their type
es.resource.write = my-collection/{media_type}

这将导致Final Fantasy VImy-collection/game下被索引,Harry Pottermy-collection/book下和与Surfing With The Alienmy-collection/music下。 有关详细信息,请参阅专用集成部分。

Formatting dynamic/multi resource writes

使用动态/多写入时,还可以指定字段返回值的格式。 开箱即用,elasticsearch-hadoop 为日期/时间戳字段提供格式,这对于在同一索引下的特定时间范围内自动分组基于时间的数据(例如日志)很有用。 通过使用 Java SimpleDataFormat 语法,可以以一种区域设置敏感的方式格式化和解析日期。

例如,假设数据包含 @timestamp 字段,可以使用以下配置将文档分组到每日索引中:

# index the documents based on their date
es.resource.write = my-collection/{@timestamp|yyyy.MM.dd} 

基本配置

Network

es.nodes (default localhost)

要连接的 Elasticsearch 节点列表。 远程使用 Elasticsearch 时,请务必设置此选项。 请注意,该列表不必包含 Elasticsearch 集群中的每个节点; 默认情况下,这些是由 elasticsearch-hadoop 自动发现的(见下文)。 每个节点还可以单独指定其 HTTP/REST 端口(例如 mynode:9600)。

192.168.1.1,192.168.1.2192.168.1.1:9200,192.168.1.2:9200

es.port (default 9200)

2.2版本之后新增的配置项

用于连接到 Elasticsearch 的默认 HTTP/REST 端口 - 此设置应用于 es.nodes 中未指定任何端口的节点。

es.nodes.path.prefix (default empty)

添加到对 Elasticsearch 发出的所有请求的前缀。 在集群在特定路径下代理/路由的环境中很有用。 例如,如果集群位于someaddress:someport/custom/path/prefix,可以将es.nodes.path.prefix设置为/custom/path/prefix

Querying

es.query (default none)

保存用于从指定es.resource读取数据的查询。 默认情况下它不是设置/空的,这意味着返回指定索引/类型下的全部数据。 es.query可以有三种形式:

  • uri query

    使用 ?uri_query 形式,可以指定查询字符串。 注意前导?

  • query dsl

    使用表单 query_dsl - 请注意查询 dsl 需要以 { 开头并以 } 结尾,如此处所述

  • external resource

    如果以上两者都不匹配,elasticsearch-hadoop 将尝试将参数解释为 HDFS 文件系统中的路径。 如果不是这种情况,它将尝试从类路径加载资源,如果失败,则从 Hadoop DistributedCache 加载。 资源应包含uri query or a query dsl

# uri (or parameter) query
es.query = ?q=costinl

# query dsl
es.query = { "query" : { "term" : { "user" : "costinl" } } }

# external resource
es.query = org/mypackage/myquery.json

换句话说,es.query 足够灵活,因此您可以使用您喜欢的任何搜索 api,无论是内联还是通过从外部资源加载它。

我们建议使用包含在作业 jar 中的文件中外部化的查询 dsl(因此在其类路径中可用)。 这使得识别、调试和组织查询变得容易。 在整个文档中,我们使用 uri 查询来保存文本并提高可读性 - 当用作 uri 时,现实生活中的查询很快就会变得笨拙。

Operation

es.input.json (default false)

输入是否已经是 JSON 格式(默认)。 有关直接使用 JSON 的更多详细信息,请参阅每个集成的相应部分。

es.write.operation (default index)

elasticsearch-hadoop 应该执行的写操作 - 可以是以下任何一种:

  • index (default)

    在替换(重新索引)现有数据(基于其 id)的同时添加新数据。

  • create

    添加新数据 - 如果数据已经存在(基于其 id),则会引发异常。

  • update

    更新现有数据(基于其 id)。 如果没有找到数据,则抛出异常。

  • upsert

    如果数据不存在则称为 merge 或插入,如果数据存在则更新(基于其 id)。

es.output.json (default false)

连接器的输出是否应为 JSON 格式(默认)。 启用后,文档将以原始 JSON 格式返回(从 Elasticsearch 返回)。 有关直接使用 JSON 的更多详细信息,请参阅每个集成的相应部分。

es.ingest.pipeline (default none)

索引或创建文档时应作为目标的现有 Elasticsearch Ingest 管道的名称。 仅在执行 indexcreate 操作时可用; 与 updateupsert 操作不兼容。

Mapping (when writing to Elasticsearch)

es.mapping.id (default none)

包含文档 ID 的文档字段/属性名称。

es.mapping.parent (default none)

包含文档父级的文档字段/属性名称。 要指定常量,请使用 <CONSTANT> 格式。

es.mapping.join (default none)

包含文档连接字段的文档字段/属性名称。 不接受常量。 文档上的联接字段必须包含作为字符串的父关系名称,或者包含子关系名称及其父关系 id 的对象。 如果在使用此设置时识别到子文档,如果在 es.mapping.routing 中没有配置其他路由,则文档的路由将自动设置为父 id。

es.mapping.routing (default depends on es.mapping.join)

包含文档路由的文档字段/属性名称。 要指定常量,请使用 <CONSTANT> 格式。 如果使用 es.mapping.join 指定连接字段,则默认为连接字段的父 ID 的值。 如果未指定连接字段,则默认为无。

es.mapping.version (default none)

包含文档版本的文档字段/属性名称。 要指定常量,请使用 <CONSTANT> 格式。

es.mapping.version.type (default depends on es.mapping.version)

表示使用的 版本控制类型。 如果 es.mapping.version 未定义(默认),则其值未指定。 如果指定了es.mapping.version,它的值变成external

es.mapping.ttl (default none)

包含文档生存时间的文档字段/属性名称。 要指定常量,请使用 <CONSTANT> 格式。 不适用于 Elasticsearch 6.0+ 索引版本,但将继续支持 5.x 索引版本及更低版本。

es.mapping.timestamp (default none)

包含文档时间戳的文档字段/属性名称。 要指定常量,请使用 <CONSTANT> 格式。 不适用于 Elasticsearch 6.0+ 索引版本,但将继续支持 5.x 索引版本及更低版本。

es.mapping.include (default none)

要包含在发送到 Elasticsearch 的文档中的字段/属性。 对于从实体中提取所需的数据很有用。 语法类似于 Elasticsearch include/exclude。 可以使用逗号指定多个值。 默认情况下,未指定任何值,这意味着包含所有属性/字段。

指定 es.input.json 时会忽略 es.mapping.include 功能。 为了防止连接器索引隐式排除的数据,任何具有这些属性冲突的作业都将拒绝执行!

es.mapping.exclude (default none)

要在发送到 Elasticsearch 的文档中排除的字段/属性。 对于从实体中消除不需要的数据很有用。 语法类似于 Elasticsearch include/exclude。 可以使用逗号指定多个值。 默认情况下,未指定任何值,这意味着不排除任何属性/字段。

指定 es.input.json 时会忽略 es.mapping.exclude 功能。 为了防止连接器索引明确排除的数据,任何具有这些属性冲突的作业都将拒绝执行!

# extracting the id from the field called 'uuid'
es.mapping.id = uuid

# specifying a parent with id '123'
es.mapping.parent = <123>

# combine include / exclude for complete control
# include
es.mapping.include = u*, foo.*
# exclude
es.mapping.exclude = *.description

使用上面的配置,每个条目将只有其顶级字段,以 u 开头,并且包含在文档中的 foo 下的嵌套字段,但名为 description 的任何嵌套字段除外。 此外,文档父级将是123,而文档 ID 是从字段uuid中提取的。

Field information (when reading from Elasticsearch)

es.mapping.date.rich (default true)

Whether to create a rich Date like object for Date fields in Elasticsearch or returned them as primitives (String or long). By default this is true. The actual object type is based on the library used; noteable exception being Map/Reduce which provides no built-in Date object and as such LongWritable and Text are returned regardless of this setting.

是否为 Elasticsearch 中的 Date 字段创建一个 rich Date 类对象,或者将它们作为原语(Stringlong)返回。 默认true。 实际的对象类型取决于使用的库; 值得注意的例外是 Map/Reduce,它不提供内置的 Date 对象,因此无论此设置如何都会返回 LongWritableText

es.read.field.include (default empty)

从 Elasticsearch 读取文档时解析和考虑的字段/属性。 默认情况下为空,意味着所有字段都被考虑。 将此属性与 caution 一起使用,因为它可能会产生副作用。 通常用于某些返回的文档不适合预期映射的情况。

es.read.field.exclude (default empty)

从 Elasticsearch 读取文档时丢弃的字段/属性。 默认情况下为空意味着不排除任何字段。 将此属性与 caution 一起使用,因为它可能会产生令人讨厌的副作用。 通常用于某些返回的文档不适合预期映射的情况。

# To exclude field company.income
es.read.field.exclude = company.income

es.read.field.as.array.include (default empty)

应被视为数组/列表的字段/属性。 由于 Elasticsearch 可以将一个或多个值映射到一个字段,elasticsearch-hadoop 无法从映射中确定是实例化一个值还是数组类型(取决于库类型)。 当遇到多个值时,elasticsearch-hadoop 将自动使用数组/列表类型,但在严格的映射场景(如 Spark SQL)中,这可能会导致意外的架构更改。 语法类似于 Elasticsearch include/exclude。 可以使用逗号指定多个值。 默认情况下,未指定任何值,这意味着不包含任何属性/字段。

# mapping nested.bar as an array
es.read.field.as.array.include = nested.bar

# mapping nested.bar as a 3-level/dimensional array
es.read.field.as.array.include = nested.bar:3

es.read.field.as.array.exclude (default empty)

不应被视为数组/列表的字段/属性。 类似于上面的es.read.field.as.array.include。 可以使用逗号指定多个值。 默认情况下,没有指定任何值,这意味着没有排除任何属性/字段(并且由于如上所述没有包含任何字段),因此没有字段被预先视为数组。 请注意,此设置不会影响嵌套字段,因为它们始终被视为数组。

Metadata (when reading from Elasticsearch)

es.read.metadata (default false)

是否在结果中包含文档元数据(例如 id 和版本)(默认)。

es.read.metadata.field (default _metadata)

放置元数据信息的字段。 当 es.read.metadata 设置为 true 时,信息以指定字段下的 Map 形式返回。

es.read.metadata.version (default false)

是否在返回的元数据中包含文档版本。 仅在启用es.read.metadata时适用。

Update settings (when writing to Elasticsearch)

一种使用 updateupsert 操作,附加设置(反映 update API) 可用:

es.update.script.inline (default none)

用于更新文档的内联脚本。

es.update.script.file (default none)

用于更新文档的文件脚本的名称。 文件脚本在 6.x 中被删除,因此,如果对 6.x 及更高版本的集群使用此属性将引发错误。

es.update.script.stored (default none)

用于更新文档的存储脚本的标识符。

es.update.script.lang (default none)

脚本语言。 默认情况下,没有指定应用节点配置的值。

es.update.script.params (default none)

脚本参数(如果有)。 使用值的文档(当前读取)字段/属性。 要指定常量,请使用 <CONSTANT> 格式。 可以通过逗号(,)指定多个值

# specifying 2 parameters, one extracting the value from field 'number', the other containing the value '123':
es.update.script.params = param1:number,param2:<123>

es.update.script.params.json

raw、JSON 格式指定的脚本参数。 指定的值按原样传递,没有任何进一步的处理或过滤。 通常用于迁移现有的更新脚本。

es.update.script.params.json = {"param1":1, "param2":2}

es.update.retry.on.conflict (default 0)

在发生冲突时重试文档更新的次数。 在并发环境中很有用。

高级配置

Index

es.index.auto.create (default yes)

在将数据写入 Elasticsearch 或失败时,elasticsearch-hadoop 是否应该创建索引(如果它缺失)。

es.index.read.missing.as.empty (default no)

elasticsearch-hadoop 是否允许读取不存在的索引(并返回空数据集)(并抛出异常)

es.field.read.empty.as.null (default yes)

elasticsearch-hadoop 是否会将空字段视为null。 通常不需要此设置(因为 elasticsearch-hadoop 已经处理了 null 情况),但启用此设置可以更轻松地处理尚未清理的文本字段。

es.field.read.validate.presence (default warn)

为了帮助发现从 Hadoop 查询数据时可能出现的错误(这会导致返回不正确的数据),elasticsearch-hadoop 可以执行验证发现缺失的字段和潜在的拼写错误。 可能的值为:**ignore不执行验证warn在验证失败的情况下记录警告消息strict**抛出异常,停止作业,如果 字段丢失

默认 (warn) 将在作业开始时将任何拼写错误记录到控制台:

WARN main mr.EsInputFormat - Field(s) [naem, adress] not found
   in the Elasticsearch mapping specified; did you mean [name, location.address]?

es.read.shard.preference (default none)

执行滚动查询时用于搜索操作的分片首选项的值。 如果留空,连接器将自动感知何时使用 _local 分片首选项。 当您需要直接控制在哪些节点上执行搜索操作时,这在热/冷架构中最有用:

Elasticsearch for Apache Hadoop 在运行之前不会尝试验证此首选项设置,如果使用提供的首选项无法定位分片,错误配置的分片首选项可能会导致滚动查询失败。

es.read.source.filter (default none)

通常,当使用允许指定某种形式的架构(例如 Hive 或 Cascading)的集成时,连接器将自动从架构中提取字段名称,并仅从 Elasticsearch 请求这些字段以节省带宽。 当使用利用任何数据模式(例如普通 MR 和 Spark)的集成时,此属性允许您指定要从 Elasticsearch 返回的以逗号分隔的字段名称字符串。

如果设置了es.read.source.filter,则在连接器尝试下推不同的源字段过滤的情况下会抛出异常。 在这些情况下,您应该清除此属性并相信连接器知道应该返回哪些字段。 这发生在 SparkSQL、Hive 以及在 Cascading 和 Pig 中指定模式时。

User specified source filters were found [name,timestamp], but the connector is executing in a state where it has provided its own source filtering [name,timestamp,location.address]. Please clear the user specified source fields under the [es.read.source.filter] property to continue. Bailing out...

es.index.read.allow.red.status (default false)

在执行从 Elasticsearch 读取的作业时,如果为读取提供的资源包含一个索引,该索引缺少分片导致集群处于red状态,那么 ES-Hadoop 将通知您此状态并快速失败。在作业必须继续使用仍可访问的剩余可用数据的情况下,用户可以启用此属性以指示连接器忽略它无法访问的分片。

使用 es.index.read.allow.red.status 可能会导致作业在不完整的数据集上运行。 与针对完全绿色或黄色集群执行的作业相比,针对红色集群执行的作业将产生不一致的结果。 请谨慎使用此设置。

es.input.max.docs.per.partition (default 100000)

从支持滚动切片(Elasticsearch v5.0.0 及更高版本)的 Elasticsearch 集群中读取数据时,此参数会建议连接器每个输入分区的最大文档数应该是多少。 连接器将采样并估计每个分片上要读取的文档数量,并使用此属性提供的值将每个分片划分为输入切片。 此属性是建议,而不是保证。 每个分区的最终文档数不能保证低于这个数字,而是会接近这个数字。 如果您从不支持滚动切片的 Elasticsearch 集群(Elasticsearch 低于 v5.0.0 的任何版本)中读取,此属性将被自动忽略。

es.input.use.sliced.partitions (default true)

默认情况下,当此参数为 true 时,使用切片分区(Elasticsearch v5.0.0 及更高版本的标准行为)。 这可能会导致索引的预读阶段显着放缓。 在某些情况下,准备时间可能比检索数据所需的时间长得多。 此选项允许您禁用此行为并使用分片分区(对于 5.0.0 之前的 Elasticsearch)。 [6.5.0] 在 6.5.0 中已弃用。此设置在 7.0.0 中被删除,因为 es.input.max.docs.per.partition 的默认值已被删除,切片滚动将默认禁用 除非用户通过指定要使用的每个分区的最大文档数来明确启用它。

Network

es.nodes.discovery (default true)

Whether to discover the nodes within the Elasticsearch cluster or only to use the ones given in es.nodes for metadata queries. Note that this setting only applies during start-up; afterwards when reading and writing, elasticsearch-hadoop uses the target index shards (and their hosting nodes) unless es.nodes.client.only is enabled.

是发现 Elasticsearch 集群中的节点,还是仅使用 es.nodes 中给定的节点进行元数据查询。 请注意,此设置仅适用于启动期间; 之后在读写时,elasticsearch-hadoop 使用目标索引分片(及其托管节点),除非启用了 es.nodes.client.only

es.nodes.client.only (default false)

Whether to use Elasticsearch client nodes (or load-balancers). When enabled, elasticsearch-hadoop will route all its requests (after nodes discovery, if enabled) through the client nodes within the cluster. Note this typically significantly reduces the node parallelism and thus it is disabled by default. Enabling it also disables es.nodes.data.only (since a client node is a non-data node).

是否使用 Elasticsearch 客户端节点(或 load-balancers)。 启用后,elasticsearch-hadoop 将通过集群内的 client 节点路由所有其请求(在节点发现之后,如果启用)。 请注意,这通常会显着降低节点并行度,因此默认情况下它是禁用的。 启用它还会禁用es.nodes.data.only(因为客户端节点是非数据节点)。

es.nodes.data.only (default true)

Whether to use Elasticsearch data nodes only. When enabled, elasticsearch-hadoop will route all its requests (after nodes discovery, if enabled) through the data nodes within the cluster. The purpose of this configuration setting is to avoid overwhelming non-data nodes as these tend to be “smaller” nodes. This is enabled by default.

是否仅使用 Elasticsearch 数据节点。 启用后,elasticsearch-hadoop 将通过集群内的 data 节点路由所有其请求(在节点发现之后,如果启用)。 此配置设置的目的是避免压倒非数据节点,因为这些节点往往是“较小的”节点。 这是默认启用的。

es.nodes.ingest.only (default false)

Whether to use Elasticsearch ingest nodes only. When enabled, elasticsearch-hadoop will route all of its requests (after nodes discovery, if enabled) through the ingest nodes within the cluster. The purpose of this configuration setting is to avoid incurring the cost of forwarding data meant for a pipeline from non-ingest nodes; Really only useful when writing data to an Ingest Pipeline (see es.ingest.pipeline above).

是否仅使用 Elasticsearch 摄取节点。 启用后,elasticsearch-hadoop 将通过集群内的 ingest 节点路由 all 其请求(在发现节点后,如果启用)。 此配置设置的目的是避免产生从非摄取节点转发用于管道的数据的成本; 仅在将数据写入 Ingest Pipeline 时才真正有用(请参阅上面的 es.ingest.pipeline)。

es.nodes.wan.only (default false)

Whether the connector is used against an Elasticsearch instance in a cloud/restricted environment over the WAN, such as Amazon Web Services. In this mode, the connector disables discovery and only connects through the declared es.nodes during all operations, including reads and writes. Note that in this mode, performance is highly affected.

连接器是否用于 WAN 上云/受限环境中的 Elasticsearch 实例,例如 Amazon Web Services。 在这种模式下,连接器禁用发现,并且在所有操作(包括读取和写入)期间通过声明的 es.nodes 进行连接。 请注意,在此模式下,性能受到高度影响。

es.nodes.resolve.hostname (default depends)

Whether the connector should resolve the nodes hostnames to IP addresses or not. By default it is true unless wan mode is enabled (see above) in which case it will default to false.

连接器是否应将节点主机名解析为 IP 地址。 默认情况下,它是 true,除非启用了 wan 模式(见上文),在这种情况下,它将默认为 false。

es.http.timeout (default 1m)

Timeout for HTTP/REST connections to Elasticsearch.

与 Elasticsearch 的 HTTP/REST 连接超时。

es.http.retries (default 3)

Number of retries for establishing a (broken) http connection. The retries are applied for each conversation with an Elasticsearch node. Once the retries are depleted, the connection will automatically be re-reouted to the next available Elasticsearch node (based on the declaration of es.nodes, followed by the discovered nodes - if enabled).

建立(断开的)http 连接的重试次数。 使用 Elasticsearch 节点对每个 conversation 应用重试。 一旦重试次数用尽,连接将自动重新路由到下一个可用的 Elasticsearch 节点(基于 es.nodes 的声明,然后是发现的节点 - 如果启用)。

es.scroll.keepalive (default 10m)

The maximum duration of result scrolls between query requests.

结果在查询请求之间滚动的最大持续时间。

es.scroll.size (default 50)

Number of results/items returned by each individual per request.

每个请求返回的结果/项目数。

es.scroll.limit (default -1)

Number of total results/items returned by each individual scroll. A negative value indicates that all documents that match should be returned. Do note that this applies per scroll which is typically bound to one of the job tasks. Thus the total number of documents returned is LIMIT * NUMBER_OF_SCROLLS (OR TASKS)

每个单独滚动返回的 total 结果/项目数。 负值表示应返回所有匹配的文档。 请注意,这适用于通常绑定到其中一项工作任务的每个滚动。 因此返回的文档总数是LIMIT * NUMBER_OF_SCROLLS (OR TASKS)

es.action.heart.beat.lead (default 15s)

The lead to task timeout before elasticsearch-hadoop informs Hadoop the task is still running to prevent task restart.

在 elasticsearch-hadoop 通知 Hadoop 任务仍在运行之前导致任务超时,以防止任务重启。

Setting HTTP Request Headers

es.net.http.header.[HEADER-NAME]

通过使用 es.net.http.header. 前缀,您可以为从 elasticsearch-hadoop 向 Elasticsearch 发出的所有请求提供 HTTP 标头。 请注意,连接器保留了一些标准 HTTP 标头以确保正确操作,并且不能由用户设置或覆盖(例如,AcceptContent-Type)。

例如,这里用户正在设置 Max-Forwards HTTP 标头:

es.net.http.header.Max-Forwards = 10

Secure Settings

es.keystore.location

安全设置密钥库文件的位置(通常是 URL,没有前缀,它被解释为类路径条目)。 有关详细信息,请参阅 安全设置

Basic Authentication

  • es.net.http.auth.user

    Basic Authentication user name

  • es.net.http.auth.pass

    Securable. Basic Authentication password

SSL

es.net.ssl (default false)

Enable SSL

es.net.ssl.keystore.location

key store (if used) location (typically a URL, without a prefix it is interpreted as a classpath entry)

es.net.ssl.keystore.pass

Securable. key store password

es.net.ssl.keystore.type (default JKS)

key store type. PK12 is a common, alternative format

es.net.ssl.truststore.location

trust store location (typically a URL, without a prefix it is interpreted as a classpath entry)

es.net.ssl.truststore.pass

Securable. trust store password

es.net.ssl.cert.allow.self.signed (default false)

Whether or not to allow self signed certificates

es.net.ssl.protocol(default TLS)

SSL protocol to be used

Proxy

es.net.proxy.http.host

Http proxy host name

es.net.proxy.http.port

Http proxy port

es.net.proxy.http.user

Http proxy user name

es.net.proxy.http.pass

Securable. Http proxy password

es.net.proxy.http.use.system.props(default yes)

Whether the use the system Http proxy properties (namely http.proxyHost and http.proxyPort) or not

es.net.proxy.https.host

Https proxy host name

es.net.proxy.https.port

Https proxy port

es.net.proxy.https.user

Https proxy user name

es.net.proxy.https.pass

Securable. Https proxy password

es.net.proxy.https.use.system.props(default yes)

Whether the use the system Https proxy properties (namely https.proxyHost and https.proxyPort) or not

es.net.proxy.socks.host

Http proxy host name

es.net.proxy.socks.port

Http proxy port

es.net.proxy.socks.user

Http proxy user name

es.net.proxy.socks.pass

Securable. Http proxy password

es.net.proxy.socks.use.system.props(default yes)

Whether the use the system Socks proxy properties (namely socksProxyHost and socksProxyHost) or not

elasticsearch-hadoop 允许使用上述设置将代理设置仅应用于其连接。 当已经存在 JVM 范围的代理设置(通常通过系统属性)时要格外小心,以避免出现意外行为。 重要提示:JVM docs 中描述了这些属性的语义 . 在某些情况下,将 JVM 属性 java.net.useSystemProxies 设置为 true 比手动设置这些属性效果更好。

Serialization

es.batch.size.bytes (default 1mb)

使用 Elasticsearch bulk API 进行批量写入的大小(以字节为单位)。 请注意,批量大小是按每个任务实例分配的。 始终乘以 Hadoop 作业中的任务数,以获得运行时达到 Elasticsearch 的总批量大小。

es.batch.size.entries (default 1000)

使用 Elasticsearch bulk API 进行批量写入的大小(以条目为单位) - (0 禁用它)。 es.batch.size.bytes 的伴侣,一旦匹配,就会执行批量更新。 与大小类似,此设置是per task instance; 它在运行时乘以正在运行的 Hadoop 任务的总数。

es.batch.write.refresh (default true)

批量更新完成后是否调用索引刷新。 请注意,仅在执行了整个写入(意味着多次批量更新)之后才会调用它。

es.batch.write.retry.count (default 3)

在 Elasticsearch 过载并且数据被拒绝的情况下,给定批次的重试次数。 请注意,仅重试被拒绝的数据。 如果执行重试后仍有数据被拒绝,则 Hadoop 作业将被取消(并失败)。 负值表示无限重试; 设置此值时要小心,因为它可能会产生不必要的副作用。

es.batch.write.retry.wait (default 10s)

由批量拒绝引起的批量写入重试之间的等待时间。

es.ser.reader.value.class (default *depends on the library used*)

用于将 JSON 转换为对象的 ValueReader 实现的名称。 这是由框架根据使用的库(Map/Reduce、Cascading、Hive、Pig 等)设置的。

es.ser.writer.value.class (default *depends on the library used*)

用于将对象转换为 JSON 的 ValueWriter 实现的名称。 这是由框架根据使用的库(Map/Reduce、Cascading、Hive、Pig 等)设置的。

  大数据 最新文章
实现Kafka至少消费一次
亚马逊云科技:还在苦于ETL?Zero ETL的时代
初探MapReduce
【SpringBoot框架篇】32.基于注解+redis实现
Elasticsearch:如何减少 Elasticsearch 集
Go redis操作
Redis面试题
专题五 Redis高并发场景
基于GBase8s和Calcite的多数据源查询
Redis——底层数据结构原理
上一篇文章      下一篇文章      查看所有文章
加:2022-07-21 21:37:17  更:2022-07-21 21:37:56 
 
开发: C++知识库 Java知识库 JavaScript Python PHP知识库 人工智能 区块链 大数据 移动开发 嵌入式 开发工具 数据结构与算法 开发测试 游戏开发 网络协议 系统运维
教程: HTML教程 CSS教程 JavaScript教程 Go语言教程 JQuery教程 VUE教程 VUE3教程 Bootstrap教程 SQL数据库教程 C语言教程 C++教程 Java教程 Python教程 Python3教程 C#教程
数码: 电脑 笔记本 显卡 显示器 固态硬盘 硬盘 耳机 手机 iphone vivo oppo 小米 华为 单反 装机 图拉丁

360图书馆 购物 三丰科技 阅读网 日历 万年历 2024年5日历 -2024/5/19 21:05:24-

图片自动播放器
↓图片自动播放器↓
TxT小说阅读器
↓语音阅读,小说下载,古典文学↓
一键清除垃圾
↓轻轻一点,清除系统垃圾↓
图片批量下载器
↓批量下载图片,美女图库↓
  网站联系: qq:121756557 email:121756557@qq.com  IT数码