本地英文版地址: ../en/modules-remote-clusters.html
远程集群(remote clusters) 功能使你能够建立与远程集群的单向连接。 跨集群复制 和 跨集群搜索 需要远程集群。
远程集群连接通过配置远程集群并连接到该远程集群中有限数量的节点来工作。 远程集群连接有两种模式:嗅探模式(sniff mode) 和 代理模式(proxy mode)。
不同集群之间所需的所有通信都要经过 传输层。 远程集群连接由从协调节点到远程连接的单向连接组成。
嗅探模式(sniff mode)
在嗅探模式中,使用一个名称和一个种子节点列表来创建集群。 注册远程集群时,从其中一个种子节点检索其集群状态,并选择最多三个 网关节点(gateway node) 作为远程集群请求的一部分。 此模式要求本地集群可以访问网关节点的发布地址。
嗅探模式是默认的连接模式。
网关节点选择 (gateway nodes selection)
g网关节点 的选择取决于以下标准:
- version:远程节点必须与它们注册到的集群兼容。 这受制于与 滚动升级(Rolling upgrades)相似的规则。 任何节点都可以与同一主版本上的任何其他节点通信(例如,7.0 可以与任何 7.x 版本的节点通信)。 只有某个主要版本的最后一个次要版本上的节点才能与下一个主要版本上的节点通信。 注意,在 6.x 系列中,6.8 可以与任何 7.x 节点通信,而 6.7 只能与 7.0 通信。 版本兼容性是对称的,意味着如果 6.7 可以与 7.0 通信,那么 7.0 也可以与 6.7 通信。 下表总结了如上所述的兼容性。
兼容性 |
5.0→5.5 |
5.6 |
6.0→6.6 |
6.7 |
6.8 |
7.0 |
7.1→7.x |
5.0→5.5 |
Yes |
Yes |
No |
No |
No |
No |
No |
5.6 |
Yes |
Yes |
Yes |
Yes |
Yes |
No |
No |
6.0→6.6 |
No |
Yes |
Yes |
Yes |
Yes |
No |
No |
6.7 |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
No |
6.8 |
No |
Yes |
Yes |
Yes |
Yes |
Yes |
Yes |
7.0 |
No |
No |
No |
Yes |
Yes |
Yes |
Yes |
7.1→7.x |
No |
No |
No |
No |
Yes |
Yes |
Yes |
- 角色(role):专用主节点永远不会被选中。
- 属性(attributes): 你可以标记应该选择哪些节点(请参阅所有模式下的远程集群设置),尽管这样标记的节点仍然必须满足上述两个要求。
代理模式 (Proxy mode)
在代理模式下,使用名称和单个代理地址创建集群。 注册远程集群时,会向代理地址打开可配置数量的 socket 连接。 代理需要将这些连接路由到远程集群。 代理模式不要求远程集群节点具有可访问的发布地址。
代理模式不是默认的连接模式,必须进行配置。 与嗅探模式下的 网关节点 类似,远程连接遵循与 滚动升级 相同的版本兼容性规则。
配置远程集群
可以使用 集群设置 来全局配置远程集群,集群设置可以动态更新。
或者,你可以使用 elasticsearch.yml
文件在单个节点上进行本地配置。
如果在 elasticsearch.yml
文件中指定设置,则只有具有这些设置的节点才能连接到远程集群。
换句话说,依赖于远程集群请求的功能必须由这些节点专门驱动。例如:
cluster: remote: cluster_one: seeds: 127.0.0.1:9300 transport.ping_schedule: 30s cluster_two: mode: sniff seeds: 127.0.0.1:9301 transport.compress: true skip_unavailable: true cluster_three: mode: proxy proxy_address: 127.0.0.1:9302
|
|
远程集群中种子节点的主机名和传输端口(默认值:9300)。 |
|
为 |
|
配置的连接模式。
默认情况下,它是 |
|
对 |
|
对于 |
|
用于连接 |
有关可选的传输设置的更多信息,参考 传输。
如果使用 集群设置,远程集群在集群中的每个节点上都可用。例如:
PUT _cluster/settings { "persistent": { "cluster": { "remote": { "cluster_one": { "seeds": [ "127.0.0.1:9300" ], "transport.ping_schedule": "30s" }, "cluster_two": { "mode": "sniff", "seeds": [ "127.0.0.1:9301" ], "transport.compress": true, "skip_unavailable": true }, "cluster_three": { "mode": "proxy", "proxy_address": "127.0.0.1:9302" } } } } }
可以动态更新 压缩 和 ping 时间表设置。
但是,必须在更新设置的请求中重新包含 seeds
或 proxy_address
。例如:
PUT _cluster/settings { "persistent": { "cluster": { "remote": { "cluster_one": { "seeds": [ "127.0.0.1:9300" ], "transport.ping_schedule": "60s" }, "cluster_two": { "mode": "sniff", "seeds": [ "127.0.0.1:9301" ], "transport.compress": false }, "cluster_three": { "mode": "proxy", "proxy_address": "127.0.0.1:9302", "transport.compress": true } } } } }
当 压缩 或 ping 时间表设置更改时,所有现有节点连接必须关闭并重新打开,这可能会导致正在进行的请求失败。
通过将远程集群的设置设置为null
,可以将其从集群设置中删除:
PUT _cluster/settings { "persistent": { "cluster": { "remote": { "cluster_two": { "mode": null, "seeds": null, "skip_unavailable": null, "transport": { "compress": null } } } } } }
所有模式下的远程集群配置 (Remote cluster settings for all modes)
这些设置适用于 嗅探模式 和 代理模式。 嗅探模式设置和代理模式设置 设置如下:
-
cluster.remote.<cluster_alias>.mode
-
用于远程集群连接的模式。
支持的模式仅限
sniff
和proxy
。 -
cluster.remote.initial_connect_timeout
-
节点启动时等待建立远程连接的时间。默认值为
30s
。 -
node.remote_cluster_client
-
默认情况下,集群中的任何节点都可以充当跨集群客户端,并连接到远程集群。
node.remote_cluster_client
设置可以设置为false
(默认为true
),以防止某些节点连接到远程集群。 远程集群请求必须发送到允许充当跨集群客户端的节点。 -
cluster.remote.<cluster_alias>.skip_unavailable
-
每个集群布尔值设置,当没有属于某个集群的节点可用且它们是远程集群请求的目标时,允许跳过特定集群。
默认值为
false
,这意味着默认情况下所有集群都是强制的,但是通过将此设置设置为true
,可以有选择地将它们设置为可选的。 -
cluster.remote.<cluster_alias>.transport.ping_schedule
-
设置发送常规应用程序级 ping 消息的时间间隔,以确保到属于远程集群的节点的传输连接保持活动状态。
如果设置为
-1
,则不会向该远程集群发送应用程序级别的 ping 消息。 如果未设置,则根据全局transport.ping_schedule
设置发送应用程序级别的 ping 消息,默认值为-1
,表示不发送 ping。 -
cluster.remote.<cluster_alias>.transport.compress
-
每个集群布尔值设置,使你能够为特定远程集群的请求配置压缩。
此设置仅影响发送到远程集群的请求。
如果入站请求被压缩,Elasticsearch 会压缩响应。
如果未设置,全局
transport.compress
将用作回退设置。
嗅探模式的远程集群设置
-
cluster.remote.<cluster_alias>.seeds
- 用于探查远程集群状态的种子节点列表。
-
cluster.remote.<cluster_alias>.node_connections
-
该远程集群要连接的网关节点数。默认值为
3
。 -
cluster.remote.node.attr
-
一个节点属性,用于筛选出可作为远程集群中网关节点的节点。
例如,节点可以具有节点属性
node.attr.gateway: true
,这样,如果cluster.remote.node.attr
设置为gateway
,则只有具有该属性的节点才会连接到。
代理模式下远程集群的配置
-
cluster.remote.<cluster_alias>.proxy_address
- 用于所有远程连接的地址。
-
cluster.remote.<cluster_alias>.proxy_socket_connections
-
每个远程集群要打开的 socket 连接数。默认值为
18
。
-
cluster.remote.<cluster_alias>.server_name
-
可选的主机名字符串,如果启用了 TLS,则在 TLS 服务器名称指示(TLS SNI, TLS Server Name Indication) 扩展的
server_name
字段中发送。 如果此字段不是 TLS SNI 规范定义的有效主机名,TLS 传输将无法打开远程连接。
检索远程集群信息
可以使用 远程集群信息API 来检索关于已配置的远程集群以及该节点所连接的远程节点的信息。
- Elasticsearch权威指南: 其他版本:
- Elasticsearch是什么?
- 7.7版本的新特性
- 开始使用Elasticsearch
- 安装和设置
- 升级Elasticsearch
- 搜索你的数据
- 查询领域特定语言(Query DSL)
- SQL access(暂时不翻译)
- Overview
- Getting Started with SQL
- Conventions and Terminology
- Security
- SQL REST API
- SQL Translate API
- SQL CLI
- SQL JDBC
- SQL ODBC
- SQL Client Applications
- SQL Language
- Functions and Operators
- Comparison Operators
- Logical Operators
- Math Operators
- Cast Operators
- LIKE and RLIKE Operators
- Aggregate Functions
- Grouping Functions
- Date/Time and Interval Functions and Operators
- Full-Text Search Functions
- Mathematical Functions
- String Functions
- Type Conversion Functions
- Geo Functions
- Conditional Functions And Expressions
- System Functions
- Reserved keywords
- SQL Limitations
- 聚合
- 度量(metric)聚合
- 桶(bucket)聚合
- adjacency_matrix 聚合
- auto_date_histogram 聚合
- children 聚合
- composite 聚合
- date_histogram 聚合
- date_range 聚合
- diversified_sampler 聚合
- filter 聚合
- filters 聚合
- geo_distance 聚合
- geohash_grid 聚合
- geotile_grid 聚合
- global 聚合
- histogram 聚合
- ip_range 聚合
- missing 聚合
- nested 聚合
- parent 聚合
- range 聚合
- rare_terms 聚合
- reverse_nested 聚合
- sampler 聚合
- significant_terms 聚合
- significant_text 聚合
- terms 聚合
- 给范围字段分桶的微妙之处
- 管道(pipeline)聚合
- 矩阵(matrix)聚合
- 重度缓存的聚合
- 只返回聚合的结果
- 聚合元数据
- Returning the type of the aggregation
- 使用转换对聚合结果进行索引
- 脚本
- 映射
- 删除的映射类型
- 字段数据类型
- alias(别名)
- array(数组)
- binary(二进制)
- boolean(布尔)
- date(日期)
- date_nanos(日期纳秒)
- dense_vector(密集矢量)
- histogram(直方图)
- flattened(扁平)
- geo_point(地理坐标点)
- geo_shape(地理形状)
- IP
- join(联结)
- keyword(关键词)
- nested(嵌套)
- numeric(数值)
- object(对象)
- percolator(渗透器)
- range(范围)
- rank_feature(特征排名)
- rank_features(特征排名)
- search_as_you_type(输入即搜索)
- Sparse vector
- Text
- Token count
- Shape
- Constant keyword
- Meta-Fields
- Mapping parameters
- Dynamic Mapping
- Text analysis
- Overview
- Concepts
- Configure text analysis
- Built-in analyzer reference
- Tokenizer reference
- Char Group Tokenizer
- Classic Tokenizer
- Edge n-gram tokenizer
- Keyword Tokenizer
- Letter Tokenizer
- Lowercase Tokenizer
- N-gram tokenizer
- Path Hierarchy Tokenizer
- Path Hierarchy Tokenizer Examples
- Pattern Tokenizer
- Simple Pattern Tokenizer
- Simple Pattern Split Tokenizer
- Standard Tokenizer
- Thai Tokenizer
- UAX URL Email Tokenizer
- Whitespace Tokenizer
- Token filter reference
- Apostrophe
- ASCII folding
- CJK bigram
- CJK width
- Classic
- Common grams
- Conditional
- Decimal digit
- Delimited payload
- Dictionary decompounder
- Edge n-gram
- Elision
- Fingerprint
- Flatten graph
- Hunspell
- Hyphenation decompounder
- Keep types
- Keep words
- Keyword marker
- Keyword repeat
- KStem
- Length
- Limit token count
- Lowercase
- MinHash
- Multiplexer
- N-gram
- Normalization
- Pattern capture
- Pattern replace
- Phonetic
- Porter stem
- Predicate script
- Remove duplicates
- Reverse
- Shingle
- Snowball
- Stemmer
- Stemmer override
- Stop
- Synonym
- Synonym graph
- Trim
- Truncate
- Unique
- Uppercase
- Word delimiter
- Word delimiter graph
- Character filters reference
- Normalizers
- Index modules
- Ingest node
- Pipeline Definition
- Accessing Data in Pipelines
- Conditional Execution in Pipelines
- Handling Failures in Pipelines
- Enrich your data
- Processors
- Append Processor
- Bytes Processor
- Circle Processor
- Convert Processor
- CSV Processor
- Date Processor
- Date Index Name Processor
- Dissect Processor
- Dot Expander Processor
- Drop Processor
- Enrich Processor
- Fail Processor
- Foreach Processor
- GeoIP Processor
- Grok Processor
- Gsub Processor
- HTML Strip Processor
- Inference Processor
- Join Processor
- JSON Processor
- KV Processor
- Lowercase Processor
- Pipeline Processor
- Remove Processor
- Rename Processor
- Script Processor
- Set Processor
- Set Security User Processor
- Split Processor
- Sort Processor
- Trim Processor
- Uppercase Processor
- URL Decode Processor
- User Agent processor
- ILM: Manage the index lifecycle
- Monitor a cluster
- Frozen indices
- Roll up or transform your data
- Set up a cluster for high availability
- Snapshot and restore
- Secure a cluster
- Overview
- Configuring security
- User authentication
- Built-in users
- Internal users
- Token-based authentication services
- Realms
- Realm chains
- Active Directory user authentication
- File-based user authentication
- LDAP user authentication
- Native user authentication
- OpenID Connect authentication
- PKI user authentication
- SAML authentication
- Kerberos authentication
- Integrating with other authentication systems
- Enabling anonymous access
- Controlling the user cache
- Configuring SAML single-sign-on on the Elastic Stack
- Configuring single sign-on to the Elastic Stack using OpenID Connect
- User authorization
- Built-in roles
- Defining roles
- Security privileges
- Document level security
- Field level security
- Granting privileges for indices and aliases
- Mapping users and groups to roles
- Setting up field and document level security
- Submitting requests on behalf of other users
- Configuring authorization delegation
- Customizing roles and authorization
- Enabling audit logging
- Encrypting communications
- Restricting connections with IP filtering
- Cross cluster search, clients, and integrations
- Tutorial: Getting started with security
- Tutorial: Encrypting communications
- Troubleshooting
- Some settings are not returned via the nodes settings API
- Authorization exceptions
- Users command fails due to extra arguments
- Users are frequently locked out of Active Directory
- Certificate verification fails for curl on Mac
- SSLHandshakeException causes connections to fail
- Common SSL/TLS exceptions
- Common Kerberos exceptions
- Common SAML issues
- Internal Server Error in Kibana
- Setup-passwords command fails due to connection failure
- Failures due to relocation of the configuration files
- Limitations
- Alerting on cluster and index events
- Command line tools
- How To
- Glossary of terms
- REST APIs
- API conventions
- cat APIs
- cat aliases
- cat allocation
- cat anomaly detectors
- cat count
- cat data frame analytics
- cat datafeeds
- cat fielddata
- cat health
- cat indices
- cat master
- cat nodeattrs
- cat nodes
- cat pending tasks
- cat plugins
- cat recovery
- cat repositories
- cat shards
- cat segments
- cat snapshots
- cat task management
- cat templates
- cat thread pool
- cat trained model
- cat transforms
- Cluster APIs
- Cluster allocation explain
- Cluster get settings
- Cluster health
- Cluster reroute
- Cluster state
- Cluster stats
- Cluster update settings
- Nodes feature usage
- Nodes hot threads
- Nodes info
- Nodes reload secure settings
- Nodes stats
- Pending cluster tasks
- Remote cluster info
- Task management
- Voting configuration exclusions
- Cross-cluster replication APIs
- Document APIs
- Enrich APIs
- Explore API
- Index APIs
- Add index alias
- Analyze
- Clear cache
- Clone index
- Close index
- Create index
- Delete index
- Delete index alias
- Delete index template
- Flush
- Force merge
- Freeze index
- Get field mapping
- Get index
- Get index alias
- Get index settings
- Get index template
- Get mapping
- Index alias exists
- Index exists
- Index recovery
- Index segments
- Index shard stores
- Index stats
- Index template exists
- Open index
- Put index template
- Put mapping
- Refresh
- Rollover index
- Shrink index
- Split index
- Synced flush
- Type exists
- Unfreeze index
- Update index alias
- Update index settings
- Index lifecycle management API
- Ingest APIs
- Info API
- Licensing APIs
- Machine learning anomaly detection APIs
- Add events to calendar
- Add jobs to calendar
- Close jobs
- Create jobs
- Create calendar
- Create datafeeds
- Create filter
- Delete calendar
- Delete datafeeds
- Delete events from calendar
- Delete filter
- Delete forecast
- Delete jobs
- Delete jobs from calendar
- Delete model snapshots
- Delete expired data
- Estimate model memory
- Find file structure
- Flush jobs
- Forecast jobs
- Get buckets
- Get calendars
- Get categories
- Get datafeeds
- Get datafeed statistics
- Get influencers
- Get jobs
- Get job statistics
- Get machine learning info
- Get model snapshots
- Get overall buckets
- Get scheduled events
- Get filters
- Get records
- Open jobs
- Post data to jobs
- Preview datafeeds
- Revert model snapshots
- Set upgrade mode
- Start datafeeds
- Stop datafeeds
- Update datafeeds
- Update filter
- Update jobs
- Update model snapshots
- Machine learning data frame analytics APIs
- Create data frame analytics jobs
- Create inference trained model
- Delete data frame analytics jobs
- Delete inference trained model
- Evaluate data frame analytics
- Explain data frame analytics API
- Get data frame analytics jobs
- Get data frame analytics jobs stats
- Get inference trained model
- Get inference trained model stats
- Start data frame analytics jobs
- Stop data frame analytics jobs
- Migration APIs
- Reload search analyzers
- Rollup APIs
- Search APIs
- Security APIs
- Authenticate
- Change passwords
- Clear cache
- Clear roles cache
- Create API keys
- Create or update application privileges
- Create or update role mappings
- Create or update roles
- Create or update users
- Delegate PKI authentication
- Delete application privileges
- Delete role mappings
- Delete roles
- Delete users
- Disable users
- Enable users
- Get API key information
- Get application privileges
- Get builtin privileges
- Get role mappings
- Get roles
- Get token
- Get users
- Has privileges
- Invalidate API key
- Invalidate token
- OpenID Connect Prepare Authentication API
- OpenID Connect authenticate API
- OpenID Connect logout API
- SAML prepare authentication API
- SAML authenticate API
- SAML logout API
- SAML invalidate API
- SSL certificate
- Snapshot and restore APIs
- Snapshot lifecycle management API
- Transform APIs
- Usage API
- Watcher APIs
- Definitions
- Breaking changes
- Release notes
- Elasticsearch version 7.7.1
- Elasticsearch version 7.7.0
- Elasticsearch version 7.6.2
- Elasticsearch version 7.6.1
- Elasticsearch version 7.6.0
- Elasticsearch version 7.5.2
- Elasticsearch version 7.5.1
- Elasticsearch version 7.5.0
- Elasticsearch version 7.4.2
- Elasticsearch version 7.4.1
- Elasticsearch version 7.4.0
- Elasticsearch version 7.3.2
- Elasticsearch version 7.3.1
- Elasticsearch version 7.3.0
- Elasticsearch version 7.2.1
- Elasticsearch version 7.2.0
- Elasticsearch version 7.1.1
- Elasticsearch version 7.1.0
- Elasticsearch version 7.0.0
- Elasticsearch version 7.0.0-rc2
- Elasticsearch version 7.0.0-rc1
- Elasticsearch version 7.0.0-beta1
- Elasticsearch version 7.0.0-alpha2
- Elasticsearch version 7.0.0-alpha1