Cluster Wide Setting(集群围配置)

集群当前使用的所有配置都可以通过查询sys.cluster.setting获得。大部分集群的配置都可以在运行期间通过SET/RESET语句改变 。每个设置都被文档化存储。不建议将集群范围的配置添加到每一个集群节点上的crate.yml配置文件中,如果这样将会使每个节点都有一个不同的集群配置,从而导致集群有不确定性的行为。

Collecting Stats(收集状态信息)

stats.enabled

Default: false
Runtime: yes
是否收集统计集群的信息。

stats.jobs_log_size

Default: 10000
Runtime: yes
sys.jobs_log记录着每个节点上用于性能分析的作业的数量。当达到jobs_log_size的大小后,较早的记录将被删除。一个单独的sq语句将引发集群上一个作业的执行。设置值较大时将会产生很多结果,从而也需要获取较大的内存。设置成0将禁用收集作业信息。

stats.operations_log_size

Default: 10000
Runtime: yes
sys.operations_log表记录着每个节点上用于性能分析的操作次数。当operations_log_size达到上限时较早的记录会被删除。一个作业由多个操作组成。较大的值将产生更多结果,从而也会使用更多的内存。设置为0将禁用收集操作信息。

Usage Data Collector(数据使用情况收集器)

数据使用情况收集器的设置是只读的而且不能在运行期间设置。请查看数据使用情况收集器获取更加详细的使用说明。

udc.enabled

Default: true
Runtime: no
true:开启数使用率的收集器 false:禁用数使用率的收集器

udc.initial_delay

Default: 10m
Runtime: no
启动后第一次ping的延迟。 此字段期望一个long或者double或者一个带时间后缀 (ms, s, m, h, d, w)的字符串。

udc.interval

Default: 24h
Runtime: no 一个UDC ping的间隔。 此字段期望一个long或者double或者一个带时间后缀的字符串。

udc.url

Default: https://udc.crate.io Runtime: no 要ping的URL地址。

Graceful Stop(正常停止)

默认配置下,当Crate进程停止时最简单的方式就是shuts down,可能使一些shards(分片)处于不可用的状态将导致集群处于红色状态而且使许多需要当前不可用shards的查询失败。为了安全地停止Crate节点,可以使用正常停止程序。 以下集群的配置将被用来改变集群节点的停止行为:

cluster.graceful_stop.min_availability

Default: primaries
Runtime: yes
Allowed Values: none | primaries | full
none:无最小可用数据是必须的。节点可以停止即使记录停止后丢失。 primaries:在节点停止后至少所有主分片需要处于可用状态,副本可能丢失。 full: 在节点关闭之后,所有的记录和副本需要处于可用状态。所有的数据都是可用的。

注意
这个选项将被忽略如果集群中仅仅有一个节点。

cluster.graceful_stop.reallocate

Default: true
Runtime: yes
true:正常停止命令允许在节点停止前重新分配分片,以确保min_availability设置的最小数据可用性。 false:如果集群将需要重新分配分片确保最小可用性min_availability设置的最小数据可用性,则正常停止命令将会失败。

注意 确保你有足够的节点和磁盘空间来重新分配。

cluster.graceful_stop.timeout

Default: 2h Runtime: yes
定义正常停止时等待重新分片进程完成的最大时间。强制设置将会使关闭进程进入此超时时间。 此字段期望一个long或者double或者一个带时间后缀(ms, s, m, h, d, w)的字符串。

cluster.graceful_stop.force

Default: false
Runtime: yes
当正常停止时间超过cluster.graceful_stop.timeout设置的超时时间时,强制停止节点。

Bulk Operations(批量操作)

涉及大量含的SQL DML语句例如COPY FROM, INSERT 或 UPDATE,可能消耗很大的资源和时间。以下的设置可以改变这些查询的行为。

bulk.request_timeout

Default: 1m Runtime: yes
内部基于分片的请求在大量行上执行DML SQL语句时的超时时间。

Discovery(发现机制)

discovery.zen.minimum_master_nodes

Default: 1
Runtime: yes
设置确保一个节点可以看到集群范围内可操作的其他N个可作为主节点的合格节点。推荐设置大于1的值当在集群里运行多于两个节点时。

discovery.zen.ping_timeout

Default: 3s
Runtime: yes
设置发现其他节点时,等待其他节点ping的响应包的等待时间。当较慢或者阻塞的网络中将此值可设置较大一点可以使发现失败率降到最低。

discovery.zen.publish_timeout

Default: 30s
Runtime: yes
等待集群中其他节点都变为发布状态的响应时间。 Unicast Host Discovery(单播主机发现)

discovery.zen.ping.multicast.enabled

Default: true
Runtime: no
是否启用多播发现机制。 Crate内置支持几种不同节点发现机制,如何获取节点发现的单播主机。最简单的机制是在配置文件中指定主机列表。

discovery.zen.ping.unicast.hosts

Default: not set
Runtime: no
当前有两种其他的发现类型:通过DNS和通过EC2的API。 当一个节点启动时启动这些发现类型之一时,它使用以下列出的指定机制的设置来执行查找。主机和端口将用于生成节点发现的单播主机列表。
每当重新选举主节点时,集群中的所有节点也执行相同的查找(请参阅集群元数据)。

disovery.type

Default: not set
Runtime: no
Allowed Values: srv, ec2
参见: Discovery.

Discovery via DNS(通过DNS发现)

Crate内部支持DNS发现机制。将discovery.type设置为srv将开启DNS发现机制。 单播主机的顺序由SRV中国定义的优先级来决定。每个主机的权重和名称都在SRV中记录。例如:

_crate._srv.example.com. 3600 IN SRV 2 20 4300 crate1.example.com.

_crate._srv.example.com. 3600 IN SRV 1 10 4300 crate2.example.com.

_crate._srv.example.com. 3600 IN SRV 2 10 4300 crate3.example.com.

被发现的节点顺序将如下:

crate2.example.com:4300, crate3.example.com:4300, crate1.example.com:4300

discovery.srv.query

Runtime: no

The DNS query that is used to look up SRV records, usually in the format _service._protocol.fqdn If not set, the service discovery will not be able to look up any SRV records.

用于查找SRV记录的DNS查询(通常格式如 _service._protocol.fqdn),如果不设置,服务器发现将无法查找任何SRV记录。

discovery.srv.resolver

Runtime: no
用于解析DNS记录的DNS服务器的主机名或者IP,如果未设置,或者指定不可解析的主机名或IP,则使用默认解析器。可以使用hostname:port指定自定义端口。

Discovery via EC2(通过EC2发现) Crate内部支持通过EC2 API来发现。可以将discovery.type设置为ec2来开启EC2发现机制。

cloud.aws.access_key

Runtime: no
用于标识API调用的访问关键ID。

cloud.aws.secret_key

Runtime: no 标识API调用的密钥。

注意 AWS证书可以由环境变量变量 AWS_ACCESS_KEY_ID和AWS_SECRET_KEY或者通过系统配置属性aws.accessKeyId和aws.secretKey来配置。

Following settings control the discovery(以下的配置控制发现):

discovery.ec2.groups

Runtime: no
一个安全群组列表;id或者名字。仅仅给定群组的实例将被用于单播主机的发现。

discovery.ec2.any_group

Runtime: no
Default: true
Defines whether all (false) or just any (true) security group must be present for the instance to be used for discovery. 定义所有被用于发现的实例是否必须在所有或任何安全组。

discovery.ec2.host_type

Runtime: no
Default: private_ip
允许的值: private_ip, public_ip, private_dns, public_dns

Defines via which host type to communicate with other instances. 定义通过哪种主机类型和同其他实例通信。

discovery.ec2.availability_zones

Runtime: no
可用区域列表。只有指定可用区域内的指定实例才会用于单播主机发现。

discovery.ec2.ping_timeout

Runtime: no
Default: 3s
在发现期间对已存在的EC2实例的进行ping的超时时间。如果没有时间后缀的情况下,默认使用毫秒。

discovery.ec2.tag.

Runtime: no 可使用discovery.ec2.tag.前缀加上标签名来过滤发现哪些EC2实例。例如要过滤值为dev的环境变量的实例,您的设置如下: discovery.ec2.tag.environment: dev.

cloud.aws.ec2.endpoint

Runtime: no
If you have your own compatible implementation of the EC2 API service you can set the enpoint that should be used.

若果你有自己对EC2服务API服务可兼容的一个实现,你可以设置为此服务。

Routing Allocation(路由分配)

cluster.routing.allocation.enable

Default: all
Runtime: yes
允许的值: all | none | primaries | new_primaries all:允许所有的分片分配,集群可能分配所有类型的shards(分片)。 none:不允许分配分片。将没有分片被移除或者创建。 primaries:只有主分片可以被移除或者创建。这个将包括已存在的主分片。

new_primaries allows allocations for new primary shards only. This means that for example a newly added node will not allocate any replicas. However it is still possible to allocate new primary shards for new indices. Whenever you want to perform a zero downtime upgrade of your cluster you need to set this value before gracefully stopping the first node and reset it to all after starting the last updated node.

new_primaries:仅允许为新的主分片分配。这意味着新添加的节点将不会分配任何副本。然而任然有可能分配主分片给新的索引。无论何时要对集群执行零停机升级,需要先设置此值,然后正常停止第一个节点并在启动最后更新的节点后将其重置为all。

注意

此分配设置对主分片的恢复没有任何作用,即使 cluster.routing.allocation.enable被设置为none,节点重启后节点依然会立即恢复它们本地未分配的主分片,以防满足recovery.initial_shards的设置。

cluster.routing.allocation.allow_rebalance

Default: indices_all_active
Runtime: yes
允许的值: always | indices_primary_active | indices_all_active 允许根据集群中所有索引分片的总状态控制何时进行重新平衡。默认设置为indices_all_active以减少初始恢复期间的抖动。

cluster.routing.allocation.cluster_concurrent_rebalance

Default: 2
Runtime: yes
定义集群允许范围内并发重新平衡任务的任务数。

cluster.routing.allocation.node_initial_primaries_recoveries

Default: 4
Runtime: yes

定义每个节允许的初始恢复数。由于大多时候使用本地网关,这些应该很快而且我们能处理更多的节点而不用创建新的负载。

cluster.routing.allocation.node_concurrent_recoveries

Default: 2 Runtime: yes 一个节点上允许多少个并发恢复任务。

Awareness(感知)

集群分配感知允许在通用属性相关的节点间配置分片和副本。

cluster.routing.allocation.awareness.attributes

Runtime: no 定义用于感知一个分片和它的副本的节点属性。例如,我们定义一个属性rack_id,启动两个节点将其rack_id设置为rack_one,然后部署一个单表带有5个分片和一个副本。这个表将完全部署在当前节点上(五个分片每个分片一个副本,总共10个分片)。 现在,如果我们启动两个或更多个节点,将node.rack_id设置为rack_two,分片将重新定位甚至跨节点的分片,但是一个分片和它的副本将不会分配同样的rack_id值。 感知属性可设置多个值。

cluster.routing.allocation.awareness.force.*.values

Runtime: no
属性所在的分片将被强制分配。*是一个感知属性的通配符,可以通过cluster.routing.allocation.awareness.attributes来设置。假如我们来配置一个感知属性和值zone1,zone2,启动两个node.zone配置都为zone1的节点,并且创建一个5个分片一个副本的表。表将被创建,但仅仅有5个分片被分配。只有当我们启动多个分片而且node.zone设置为zone2,副本分片才会将被分配。

Balanced Shards(平衡分片)

所有这些值都是相对的。前三个用于将三个独立的加权函数组成一个。当没有允许的行为使得每个节点的权重靠近在一起超过第四设值的时候,集群是平衡的。可能不允许执行一些操作如强制感知或者分配过滤。

cluster.routing.allocation.balance.shard

Default: 0.45f
Runtime: yes
为分片在一个节点上分配定义权重因数。提高这个值提高了均衡集群中所有节点上的分片的数量的趋势。

cluster.routing.allocation.balance.index

Default: 0.5f Runtime: yes

Defines a factor to the number of shards per index allocated on a specific node (float). Increasing this value raises the tendency to equalize the number of shards per index across all nodes in the cluster.

定义在特定节点(float)上分配的每个索引的分片数量的因子。增大这个值将提高均衡集群中所有节点上每个索引分片的数量的趋势。

cluster.routing.allocation.balance.primary

Default: 0.05f
Runtime: yes
Defines a weight factor for the number of primaries of a specific index allocated on a node (float). Increasing this value raises the tendency to equalize the number of primary shards across all nodes in the cluster.

定义在节点(float)上分配的特定索引的基数的权重因子。增大此值将提高平衡集群中主分片数量的趋势。

cluster.routing.allocation.balance.threshold

Default: 1.0f
Runtime: yes
Minimal optimization value of operations that should be performed (non negative float). Increasing this value will cause the cluster to be less aggressive about optimising the shard balance.
应该执行的操作的最小优化值(非负浮点数)。增加此值将降低集群在优化分片平衡方面的积极性。

Cluster-Wide Allocation Filtering(集群范围分配过滤)

Allow to control the allocation of all shards based on include/exclude filters. E.g. this could be used to allocate all the new shards on the nodes with specific IP addresses or custom attributes. 允许所有分片的分配包括过滤器包含或排除过的分片。例如,这可以用于在特有的ip地址或自定义属性的节点上分配所有新分片。

cluster.routing.allocation.include.*

Runtime: no
Place new shards only on nodes where one of the specified values matches the attribute. e.g.: cluster.routing.allocation.include.zone: “zone1,zone2”
仅在节点上分配新的分片,其中指定的值与改属性匹配。例如: cluster.routing.allocation.include.zone: “zone1,zone2”

cluster.routing.allocation.exclude.*

Runtime: no
当没有特殊的值可以匹配到将只放置新的分片在节点上,例如: cluster.routing.allocation.exclude.zone: “zone1”

cluster.routing.allocation.require.*

Runtime: no
用于指定一些规则,所有规则必须匹配到一个节点,以便为其分配一个分片。这与包括其中将任何规则匹配的节点的情况相反。

Disk-based Shard Allocation(基于磁盘的分片分配)

cluster.routing.allocation.disk.threshold_enabled
Default: true
Runtime: yes
根据磁盘使用情况阻止节点上的分片分配。

cluster.routing.allocation.disk.watermark.low

Default: 85%
Runtime: yes
定义分片分配的磁盘最小阈值。将不会在磁盘使用量大于此值的节点上分配新的分片。可以设置为绝对字节值(例如500mb),防止在集群中比该值小的磁盘空间的节点上分配新的分片。

cluster.routing.allocation.disk.watermark.high

Default: 90%
Runtime: yes
设置分片分配的最高磁盘阈值限制。如果节点上的磁盘使用率超过此值,集群将尝试将现有分片重新定位到另一个节点。它可以设置为绝对字节值(例如500mb),以便从具有比该值小的可用磁盘空间的节点重新定位分片。 默认情况下,集群将每隔30秒检查有关节点的磁盘使用情况信息。这也可以通过设置cluster.info.update.interval设置来更改。

Recovery(恢复)

indices.recovery.concurrent_streams

Default: 3
Runtime: yes
设置当一个分片从对等点恢复时能够打开的并发流的上限。

indices.recovery.file_chunk_size

Default: 512kb
Runtime: yes
从源分片拷贝分片数据的特殊块大小。如果将indices.recovery.compress设置为true将使用压缩。

indices.recovery.translog_ops

Default: 1000
Runtime: yes
指定在恢复过程中单个请求在分片之间传输的事务日志行数。如果首先达到indices.recovery.translog_size 设置的值,这个请求将忽略这个值。

indices.recovery.translog_size

Default: 512kb
Runtime: yes
指定在恢复过程中单个请求在分片之间传输的事务日志数据量。如果首先达到indices.recovery.translog_size 设置的值,这个请求将忽略这个值。

indices.recovery.compress

Default: true
Runtime: yes
设置在恢复过程中是否应该压缩传输的数据。将其设置为false可以降低cpu的压力同时允许更多的数据在网路间传输。

indices.recovery.max_bytes_per_sec

Default: 40mb
Runtime: yes
指定分片在恢复期间每秒最大传输的字节数。可以设置为0来禁用限制。与indexes.recovery.concurrent_streams类似,此设置允许控制恢复期间的网络使用情况。 更高的值可能导致更高的网络利用率,但也可以加快的恢复过程。

indices.recovery.retry_delay_state_sync

Default: 500ms Runtime: yes
设置在尝试恢复之前由于集群状态同步而导致问题后的等待的时间。

indices.recovery.retry_delay_network

Default: 5s Runtime: yes 设置在尝试恢复前由于网络原因导致问题后的等待时间。

indices.recovery.retry_activity_timeout

Default: 15m
Runtime: yes
设置空闲恢复失败的时间间隔。

indices.recovery.retry_internal_action_timeout

Default: 15m
Runtime: yes
设置作为恢复一部分的内部请求的超时时间。

indices.recovery.retry_internal_long_action_timeout

Default: 30m
Runtime: yes
定义作为恢复的一部分内部请求的超时时间,这些请求预计需要很长时间。默认两次retry_internal_action_timeout时间。

Store Level Throttling

indices.store.throttle.type

Default: merge
Runtime: yes
Allowed Values: all | merge | none
允许对存储模块的合并(或所有)进程进行限制。

indices.store.throttle.max_bytes_per_sec

Default: 20mb
Runtime: yes
如果通过indices.store.throttle.type启用限制,这个设置指定一个存储模块每秒操纵的最大字节数。

Query Circuit Breaker

查询请求将跟踪内存使用情况在一个查询执行期间。如果一个请求消费太多的内存或者集群已经接近内存使用上限,请求将被中断以维持集群正常运行。

indices.breaker.query.limit

Default: 60%
Runtime: yes
指定查询中断的限制。提供的值可能使一个绝对的值,字节大小(例如 1mb)或者堆的百分比(例如 12%)。值-1可以禁用查询中断,同时任会记录内存使用情况。

indices.breaker.query.overhead

Default: 1.09
Runtime: no
所有数据估算都要相乘的常数值,以确定最终额估算。

Field Data Circuit Breaker(数据断路器)

估算将数据加载到内存所需要的堆存储大小。如果到达确切的限制,将会引发一个异常。

indices.fielddata.breaker.limit

Default: 60%
Runtime: yes
指定fielddata断路器的jvm的堆的限制

indices.fielddata.breaker.overhead

Default: 1.03
Runtime: yes
所有现场数估算都要乘以的常数用来决定最终得估算值。

Request Circuit Breaker

请求断路器允许每个请求估算的堆内存的大小。如果单个请求超过指定的内存量,则会引发异常。

indices.breaker.request.limit

Default: 40%
Runtime: yes
为请求断路器指定jvm的堆内存限制。

indices.breaker.request.overhead

Default: 1.0
Runtime: yes
所有请求估算都要乘以的常数,用来决定最终得估算值。

Threadpools(线程池)

每个节点持有的多个线程池用来改进在每个节点内管理节点。有一些线程池,但是最为重要的包括如下: index: For index/delete operations, defaults to fixed search: For count/search operations, defaults to fixed get: For queries that are optimized to do a direct lookup by primary key, defaults to fixed bulk: For bulk operations, defaults to fixed
refresh: For refresh operations, defaults to cache

index: 索引或删除的操作,默认为fixed
search:计数或查询的操作,默认为fixed
get:通过直接查询一些主要关键字优化查询,默认为fixed
bulk:批量操作,默认为fixed
refresh:刷新操作,默认为cache

threadpool..type

Runtime: no
Allowed Values: fixed | cache
固定持有一个固定数量的线程来处理请求。如果没有可用的线程,它有待处理请求的队列。 缓存将会挂起一个线程如果有一个待处理请求的队列。

Fixed Threadpool Settings(固定线程池设置)

如果现线程池的类型被设置为固定大小的将有一些设置项。

threadpool..size

Default index:
Default search: * 3
Default get:
Default bulk:
Runtime: no
线程数

threadpool..queue_size

Default index: 200
Default search: 1000
Default get: 1000
Default bulk: 50
Runtime: no
待处理请求队列的大小。设置为-1将会不限制其大小。

Metadata(元数据)

cluster.info.update.interval

Default: 30s
Runtime: yes
定义集群收集元数据信息的频率,如果没有具体的事件被触发。

Metadata Gateway(元数据网关)

每次元数据发生变化,网关都会将集群的元数据信息持久化到磁盘上。这些数据持久存储在整个集群中,并在节点重新启动后恢复。

gateway.expected_nodes

Default: -1
Runtime: no
这个gateway.expected_nodes设置定义集群状态立即恢复需要等待的节点的数量。这个值应该与集群中节点的数量相等。因为你只想在所有节点都启动后集群状态恢复。

gateway.recover_after_time

Default: 5m
Runtime: no
gateway.recover_after_time设置定义了开始恢复集群状态之前的等待时间,一旦gateway.recover_after_nodes定义的节点数都启动后。如果gateway.recover_after_nodes设置小于gateway.expected_nodes则这个值,则这个值是相关的。

gateway.recover_after_nodes

Default: -1
Runtime: no
gateway.recover_after_nodes定义了需要在集群状态开始恢复之前必须启动的节点数量。理想情况下这个值应该与集群的节点数相等,因为你只需要在所有节点都启动后,恢复集群状态。然而这个值必须大于一半以上数量的集群集群节点数。

results matching ""

    No results matching ""