最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

elasticsearch.yml配置文件解讀(ES配置詳解)

 更新時間:2024年08月09日 10:13:03   作者:G佳偉  
elasticsearch的config文件夾里面有一個主配置文件:elasticsearch.yml是es的基本配置文件,下面主要講解下elasticsearch.yml這個文件中可配置文件,感興趣的朋友一起看看吧

elasticsearch的config文件夾里面有一個主配置文件:elasticsearch.yml是es的基本配置文件。下面主要講解下elasticsearch.yml這個文件中可配置的東西。

源文件

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
#node.name: node-1
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /home/es/elasticsearch-6.0.0/data
#
# Path to log files:
#
path.logs: /home/es/elasticsearch-6.0.0/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 3
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

詳細解釋

cluster.name: elasticsearch

配置es的集群名稱,默認是elasticsearch,es會自動發(fā)現(xiàn)在同一網(wǎng)段下的es,如果在同一網(wǎng)段下有多個集群,就可以用這個屬性來區(qū)分不同的集群。

node.name: "Franz Kafka"

節(jié)點名,默認隨機指定一個name列表中名字,該列表在es的jar包中config文件夾里name.txt文件中,其中有很多作者添加的有趣名字。

node.master: true

指定該節(jié)點是否有資格被選舉成為node,默認是true,es是默認集群中的第一臺機器為master,如果這臺機掛了就會重新選舉master。

node.data: true

指定該節(jié)點是否存儲索引數(shù)據(jù),默認為true。

index.number_of_shards: 5

設(shè)置默認索引分片個數(shù),默認為5片。

index.number_of_replicas: 1

設(shè)置默認索引副本個數(shù),默認為1個副本。

path.conf: /path/to/conf

設(shè)置配置文件的存儲路徑,默認是es根目錄下的config文件夾。

path.data: /path/to/data

設(shè)置索引數(shù)據(jù)的存儲路徑,默認是es根目錄下的data文件夾,可以設(shè)置多個存儲路徑,用逗號隔開,例:

path.data: /path/to/data1,/path/to/data2
path.work: /path/to/work

設(shè)置臨時文件的存儲路徑,默認是es根目錄下的work文件夾。

path.logs: /path/to/logs

設(shè)置日志文件的存儲路徑,默認是es根目錄下的logs文件夾

path.plugins: /path/to/plugins

設(shè)置插件的存放路徑,默認是es根目錄下的plugins文件夾

bootstrap.mlockall: true

設(shè)置為true來鎖住內(nèi)存。因為當(dāng)jvm開始swapping時es的效率會降低,所以要保證它不swap,可以把ES_MIN_MEM和ES_MAX_MEM兩個環(huán)境變量設(shè)置成同一個值,并且保證機器有足夠的內(nèi)存分配給es。同時也要允許elasticsearch的進程可以鎖住內(nèi)存,Linux下可以通過ulimit -l unlimited命令。

network.bind_host: 192.168.0.1
設(shè)置綁定的ip地址,可以是ipv4或ipv6的,默認為0.0.0.0。

network.publish_host: 192.168.0.1

設(shè)置其它節(jié)點和該節(jié)點交互的ip地址,如果不設(shè)置它會自動判斷,值必須是個真實的ip地址。

network.host: 192.168.0.1

這個參數(shù)是用來同時設(shè)置bind_host和publish_host上面兩個參數(shù)。

transport.tcp.port: 9300

設(shè)置節(jié)點間交互的tcp端口,默認是9300。

transport.tcp.compress: true

設(shè)置是否壓縮tcp傳輸時的數(shù)據(jù),默認為false,不壓縮。

http.port: 9200

設(shè)置對外服務(wù)的http端口,默認為9200。

http.max_content_length: 100mb

設(shè)置內(nèi)容的最大容量,默認100mb

http.enabled: false

是否使用http協(xié)議對外提供服務(wù),默認為true,開啟。

gateway.type: local

gateway的類型,默認為local即為本地文件系統(tǒng),可以設(shè)置為本地文件系統(tǒng),分布式文件系統(tǒng),Hadoop的HDFS,和amazon的s3服務(wù)器,其它文件系統(tǒng)的設(shè)置方法下次再詳細說。

gateway.recover_after_nodes: 1

設(shè)置集群中N個節(jié)點啟動時進行數(shù)據(jù)恢復(fù),默認為1。

gateway.recover_after_time: 5m

設(shè)置初始化數(shù)據(jù)恢復(fù)進程的超時時間,默認是5分鐘。

gateway.expected_nodes: 2

設(shè)置這個集群中節(jié)點的數(shù)量,默認為2,一旦這N個節(jié)點啟動,就會立即進行數(shù)據(jù)恢復(fù)。

cluster.routing.allocation.node_initial_primaries_recoveries: 4

初始化數(shù)據(jù)恢復(fù)時,并發(fā)恢復(fù)線程的個數(shù),默認為4。

cluster.routing.allocation.node_concurrent_recoveries: 2

添加刪除節(jié)點或負載均衡時并發(fā)恢復(fù)線程的個數(shù),默認為4。

indices.recovery.max_size_per_sec: 0

設(shè)置數(shù)據(jù)恢復(fù)時限制的帶寬,如入100mb,默認為0,即無限制。

indices.recovery.concurrent_streams: 5

設(shè)置這個參數(shù)來限制從其它分片恢復(fù)數(shù)據(jù)時最大同時打開并發(fā)流的個數(shù),默認為5。

discovery.zen.minimum_master_nodes: 1

設(shè)置這個參數(shù)來保證集群中的節(jié)點可以知道其它N個有master資格的節(jié)點。默認為1,對于大的集群來說,可以設(shè)置大一點的值(2-4)

discovery.zen.ping.timeout: 3s

設(shè)置集群中自動發(fā)現(xiàn)其它節(jié)點時ping連接超時時間,默認為3秒,對于比較差的網(wǎng)絡(luò)環(huán)境可以高點的值來防止自動發(fā)現(xiàn)時出錯。

discovery.zen.ping.multicast.enabled: false

設(shè)置是否打開多播發(fā)現(xiàn)節(jié)點,默認是true。

discovery.zen.ping.unicast.hosts: ["host1", "host2:port", "host3[portX-portY]"]

設(shè)置集群中master節(jié)點的初始列表,可以通過這些節(jié)點來自動發(fā)現(xiàn)新加入集群的節(jié)點。

下面是一些查詢時的慢日志參數(shù)設(shè)置

index.search.slowlog.level: TRACE
index.search.slowlog.threshold.query.warn: 10s
index.search.slowlog.threshold.query.info: 5s
index.search.slowlog.threshold.query.debug: 2s
index.search.slowlog.threshold.query.trace: 500ms
index.search.slowlog.threshold.fetch.warn: 1s
index.search.slowlog.threshold.fetch.info: 800ms
index.search.slowlog.threshold.fetch.debug:500ms
index.search.slowlog.threshold.fetch.trace: 200ms

到此這篇關(guān)于elasticsearch.yml配置文件解讀,ES配置詳解的文章就介紹到這了,更多相關(guān)elasticsearch.yml配置文件內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 圖文解析布隆過濾器大小的算法公式

    圖文解析布隆過濾器大小的算法公式

    這篇文章主要為大家介紹了布隆過濾器大小的算法公式圖文詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步早日升職加薪<BR>
    2022-04-04
  • OpenVas漏洞掃描器圖文使用教程

    OpenVas漏洞掃描器圖文使用教程

    本文介紹了開源漏洞掃描工具OpenVAS的基本使用方法,包括安裝配置、Web界面操作、掃描策略設(shè)置等內(nèi)容,并通過實例演示如何利用OpenVAS進行網(wǎng)絡(luò)漏洞掃描,
    2025-07-07
  • Kettle下載與安裝保姆級教程(最新)

    Kettle下載與安裝保姆級教程(最新)

    Kettle是一個實現(xiàn)ETL開發(fā)的一款開發(fā)工具,Spoon是Kettle工具提供的圖形化界面,它由Java開發(fā),支持跨平臺運行,本文給大家分享Kettle下載與安裝配置教程,感興趣的朋友一起看看吧
    2022-11-11
  • 一站式了解接口防刷(限流)的基本操作

    一站式了解接口防刷(限流)的基本操作

    接口防刷是生產(chǎn)項目落地必須解決的問題,這篇文章會從架構(gòu)的角度,分層次的講講如何解決這個問題, 文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2026-02-02
  • 學(xué)習(xí)哪門編程語言最有前途,最好賺錢,需求量高

    學(xué)習(xí)哪門編程語言最有前途,最好賺錢,需求量高

    近期有很多同學(xué)想學(xué)習(xí)編程,不知道選擇哪種語言比較好,這里簡單的給大家介紹一下,其實看個人發(fā)展,無論選擇哪個只要努力都是賺錢的
    2017-08-08
  • VScode訪問HTML頁面時相對位置正確但圖片卻加載不出來的解決辦法

    VScode訪問HTML頁面時相對位置正確但圖片卻加載不出來的解決辦法

    這篇文章主要介紹了VScode訪問HTML頁面時相對位置正確但圖片卻加載不出來的解決辦法,在使用VSCode編寫代碼并通過本地文件路徑(file://)打開HTML時,可能會因瀏覽器安全限制或路徑錯誤而無法正確加載圖片,文中通過圖文介紹的非常詳細,需要的朋友可以參考下
    2024-10-10
  • 不同的編程語言輸出 “Hello World” 代碼

    不同的編程語言輸出 “Hello World” 代碼

    對很多人來說,每當(dāng)學(xué)習(xí)一門新的編程語言,寫下的第一行代碼可能都是“Hello,World!“。因此,”Hello,World!" 已經(jīng)成為一段經(jīng)典程序。在成長中,程序員通常會使用多種編程語言,大部分程序員甚至實現(xiàn)過十幾種”Hello,World!”版本。
    2022-12-12
  • Hadoop 分布式存儲系統(tǒng) HDFS的實例詳解

    Hadoop 分布式存儲系統(tǒng) HDFS的實例詳解

    HDFS是Hadoop Distribute File System 的簡稱,也就是Hadoop的一個分布式文件系統(tǒng)。這篇文章主要介紹了Hadoop 分布式存儲系統(tǒng) HDFS,需要的朋友可以參考下
    2019-06-06
  • IDEA開啟Run Dashboard的配置詳解

    IDEA開啟Run Dashboard的配置詳解

    這篇文章主要介紹了IDEA開啟Run Dashboard的配置詳解,文中通過示例代碼介紹的非常詳細,對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-06-06
  • 好用的VSCode頭部注釋插件Fileheader?Pro

    好用的VSCode頭部注釋插件Fileheader?Pro

    這篇文章主要為大家介紹了VSCode頭部注釋插件Fileheader?Pro的使用示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2022-07-07

最新評論

察雅县| 东安县| 韩城市| 秦安县| 商丘市| 福清市| 瓮安县| 鄂托克旗| 元朗区| 阿尔山市| 都昌县| 桂林市| 中阳县| 盐城市| 金湖县| 定兴县| 阿拉尔市| 金山区| 台安县| 凌源市| 讷河市| 特克斯县| 金坛市| 抚宁县| 丹凤县| 宁晋县| 凤庆县| 泸定县| 辉南县| 巴中市| 惠东县| 泰兴市| 临潭县| 融水| 蒲江县| 海门市| 和政县| 浮梁县| 涞源县| 金华市| 汉中市|