Elasticsearch & Kibana 8.6.1 集群配置

Elasticsearch & Kibana 8.6.1 集群配置

Elasticsearch概念

Elasticsearch是一个分布式、高扩展、高实时的搜索与数据分析引擎。它能很方便的使大量数据具有搜索、分析和探索的能力。

Elasticsearch可以看做一个便于搜索的数据库,相比传统关系型数据库如下

Mysql ‐> Databases ‐> Tables ‐> Rows ‐> Columns
Elasticsearch ‐> Indices ‐> Types ‐> Documents ‐> Fields

Elasticsearch8.x已经删除了Types,所以现在的层级应该是

Elasticsearch ‐> Indices ‐> Documents ‐> Fields

Index

索引,相当于mysql中的一个数据表(原来有type时它相当于数据库,type相当于数据表,现在es8取

消了type,index当做一个数据表来理解方便一点)

Documents

一条存储的JSON数据,相当于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内存配置

################################################################
## 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节点node-9201和node-9202为例,node-9201配置如下,其他节点以此类推

# 集群名称,节点之间要保持一致
cluster.name: xigua-es-cluster
# 节点名称,集群内要唯一
node.name: node-9201
# ip 地址
network.host: localhost
# http 端口
http.port: 9201
# tcp 监听端口
transport.port: 9301
# 集群内其他(符合主节点条件)节点的集合
discovery.seed_hosts: ["localhost:9302"]
# 节点被ping的频率,默认为1s
discovery.zen.fd.ping_interval: 1s
# 等待ping响应的时间,默认为30s
discovery.zen.fd.ping_timeout: 1m
# ping失败/超时多少次被视为失败,默认为3次
discovery.zen.fd.ping_retries: 5
# 集群内的可以被选为主节点的节点集合
cluster.initial_master_nodes: ["node-9201", "node-9202"]

Kibana概念

Kibana是一款开源的数据分析和可视化平台,设计用于和 Elasticsearch 协作。可以使用 Kibana 对 Elasticsearch 索引中的数据进行搜索、查看、交互操作

Kibana配置

将Elasticsearch集群节点加入elasticsearch.hosts即可

# 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内存配置

## max size of old space in megabytes
 --max-old-space-size=4096
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值