大数据学习初级入门教程(十七) —— Elasticsearch 8.7.0 完全分布式集群的安装、配置、启动和测试
2023年04月24日 17:42:42 Elasticsearch ⁄ 共 3646字 评论数 1 ⁄ 被围观 1,216次

​好久没用 Elasticsearch 集群了,参考以前写的《大数据学习初级入门教程(八) —— Elasticsearch 7.6.2 单节点的安装、启动和测试》、《大数据学习初级入门教程(九) —— Elasticsearch 7.6.2 伪分布式集群的安装、配置、启动和测试》和《大数据学习初级入门教程(十) —— Elasticsearch 7.6.2 完全分布式集群的安装、配置、启动和测试》,下载了目前官网最新的版本 elasticsearch-8.7.0-linux-x86_64 再重温下集群部署。按步骤部署过程中,发现不少和老版本不一致的地方,这里记录一下。

老版本配置中很多配置项在新版本中无法识别而报错,新版本的配置文件如下:

# ======================== 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: mllcluster-es870
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: es111
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
node.roles: [master,data]
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
path.data: /data/elasticsearch/elasticsearch-8.7.0
#
# Path to log files:
#
#path.logs: /path/to/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 -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
#
network.host: 192.168.220.111
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
discovery.seed_hosts: ["node111", "node112", "node113", "node114", "node115"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["es111", "es112", "es113", "es114", "es115"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Allow wildcard deletion of indices:
#
#action.destructive_requires_name: false

#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
#
# The following settings, TLS certificates, and keys have been automatically      
# generated to configure Elasticsearch security features on 24-04-2023 07:30:33
#
# --------------------------------------------------------------------------------

# Enable security features
xpack.security.enabled: false

xpack.security.enrollment.enabled: true

# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
  enabled: false
  keystore.path: certs/http.p12

# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
  enabled: true
  verification_mode: certificate
  keystore.path: certs/transport.p12
  truststore.path: certs/transport.p12
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------

目前对安全验证等配置都已注释掉,后续抽空再研究。另外如果集群节点只剩下一个,启动节点后集群一直处于异常状态,无法自动恢复。

 Good Luck! ​

目前有 1 条留言 其中:访客:0 条, 博主:0 条

  1. Avatar photo eroom24.com : 2024年07月02日18:03:29  -9楼 @回复 回复
    hello there and thank you for your info – I have definitely picked up something new from right here. I did however expertise several technical points using this web site, as I experienced to reload the web site lots of times previous to I could get it to load correctly. I had been wondering if your web hosting is OK? Not that I'm complaining, but sluggish loading instances times will often affect your placement in google and can damage your high quality score if advertising and marketing with Adwords. Well I’m adding this RSS to my e-mail and could look out for a lot more of your respective interesting content. Ensure that you update this again soon.. Escape rooms hub

给我留言

留言无头像?