Elasticsearch & Kibana 8.6.1 集群配置
Elasticsearch概念
Elasticsearch是一個分布式、高擴展、高實時的搜索與數(shù)據(jù)分析引擎。它能很方便的使大量數(shù)據(jù)具有搜索、分析和探索的能力。
Elasticsearch可以看做一個便于搜索的數(shù)據(jù)庫,相比傳統(tǒng)關系型數(shù)據(jù)庫如下
Mysql ‐> Databases ‐> Tables ‐> Rows ‐> Columns
Elasticsearch ‐> Indices ‐> Types ‐> Documents ‐> Fields
Elasticsearch8.x已經(jīng)刪除了Types,所以現(xiàn)在的層級應該是
Elasticsearch ‐> Indices ‐> Documents ‐> Fields
Index
索引,相當于mysql中的一個數(shù)據(jù)表(原來有type時它相當于數(shù)據(jù)庫,type相當于數(shù)據(jù)表,現(xiàn)在es8取
消了type,index當做一個數(shù)據(jù)表來理解方便一點)
Documents
一條存儲的JSON數(shù)據(jù),相當于mysql的一條記錄
Fields
字段,類似mysql的字段
Elasticsearch一般配置
修改/config/elasticsearch.yml
配置
# 關閉geoip的自動更新
ingest.geoip.downloader.enabled: false
# 關閉默認開啟的ssl認證
xpack.security.enabled: false
# 允許跨域訪問
http.cors.enabled: true
http.cors.allow-origin: "*"
按需修改jvm.options
內(nèi)存配置
################################################################
## IMPORTANT: JVM heap size
################################################################
##
## The heap size is automatically configured by Elasticsearch
## based on the available memory in your system and the roles
## each node is configured to fulfill. If specifying heap is
## required, it should be done through a file in jvm.options.d,
## which should be named with .options suffix, and the min and
## max should be set to the same value. For example, to set the
## heap to 4 GB, create a new file in the jvm.options.d
## directory containing these lines:
##
-Xms4g
-Xmx4g
##
## See https://www.elastic.co/guide/en/elasticsearch/reference/8.6/heap-size.html
## for more information
##
################################################################
Elasticsearch集群配置
以兩個Elasticsearch節(jié)點node-9201和node-9202為例,node-9201配置如下,其他節(jié)點以此類推
# 集群名稱,節(jié)點之間要保持一致
cluster.name: xigua-es-cluster
# 節(jié)點名稱,集群內(nèi)要唯一
node.name: node-9201
# ip 地址
network.host: localhost
# http 端口
http.port: 9201
# tcp 監(jiān)聽端口
transport.port: 9301
# 集群內(nèi)其他(符合主節(jié)點條件)節(jié)點的集合
discovery.seed_hosts: ["localhost:9302"]
# 節(jié)點被ping的頻率,默認為1s
discovery.zen.fd.ping_interval: 1s
# 等待ping響應的時間,默認為30s
discovery.zen.fd.ping_timeout: 1m
# ping失敗/超時多少次被視為失敗,默認為3次
discovery.zen.fd.ping_retries: 5
# 集群內(nèi)的可以被選為主節(jié)點的節(jié)點集合
cluster.initial_master_nodes: ["node-9201", "node-9202"]
Kibana概念
Kibana是一款開源的數(shù)據(jù)分析和可視化平臺,設計用于和 Elasticsearch 協(xié)作。可以使用 Kibana 對 Elasticsearch 索引中的數(shù)據(jù)進行搜索、查看、交互操作
Kibana配置
將Elasticsearch集群節(jié)點加入elasticsearch.hosts即可文章來源:http://www.zghlxwxcb.cn/news/detail-624986.html
# host
server.host: "0.0.0.0"
# 名稱
server.name: "xigua-kibana"
# elasticsearch的host
elasticsearch.hosts: ["http://localhost:9201", "http://localhost:9202"]
# kibana中文界面
i18n.locale: "zh-CN"
按需修改node.options
內(nèi)存配置文章來源地址http://www.zghlxwxcb.cn/news/detail-624986.html
## max size of old space in megabytes
--max-old-space-size=4096
到了這里,關于Elasticsearch & Kibana 8.6.1 集群配置的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!