ARM64环境使用docker-compose进行ElasticSearch8集群部署

环境规划

主机IP系统ES版本CPU架构用户名密码
192.168.174.18Ubuntu 22.04.4 LTSelasticsearch:8.10.4ARM64elasticllodyi4TMmZD
192.168.174.218Ubuntu 22.04.4 LTSelasticsearch:8.10.4ARM64
192.168.174.112Ubuntu 22.04.4 LTSelasticsearch:8.10.4ARM64

概念:

node节点:master、data、client
默认情况下,ES集群节点都是混合节点,即在elasticsearch.yml中默认node.master: true和node.data: true

master节点数量至少保证3个,不然主节点宕机时,可能无法选举出master节点
shard切片数量:与data数据节点数量成正比,但不宜超过data节点数量,索引一旦创建,shard值不可改变

replicas副本数量:其值越大搜索效率越高,但写入性能越低(一条数据写入操作需要做(1+replicas)遍)具体值与集群data节点数量相关,不宜超过【data节点数-1】

master - 主节点:
master节点数量至少保证3个
主要功能:维护元数据,管理集群节点状态;不负责数据写入和查询。
配置要点:内存可以相对小一些,但是机器一定要稳定,最好是独占的机器。
elasticsearch.yml配置如下 :
node.roles: [“master”]

data - 数据节点:
主要功能:负责数据的写入与查询,压力大。
配置要点:大内存,最好是独占的机器。
elasticsearch.yml 配置如下:
node.roles: [“data”]

client - 客户端节点:
主要功能:负责任务分发和结果汇聚,分担数据节点压力。
配置要点:大内存,最好是独占的机器
elasticsearch.yml配置如下 :
node.roles: [“ingest”]

mixed- 混合节点:
既是主节点,又是数据节点,服务器数量不充足的情况下,也只能考虑这种节点配置
elasticsearch.yml 配置如下:
node.roles: [“master”, “data”]

ES集群部署

创建持久化目录(所有节点)

mkdir -p  /data/es/{data,conf,logs,plugins}

创建elasticsearch.yml配置文件详解

#集群名称 所有节点名称一致
cluster.name: es-clusters

#当前该节点的名称,每个节点不能重复es-node-1,es-node-2,es-node-3
node.name: es-node-1

# 当前该节点的角色
node.roles: ["master", "data"]

#设置为公开访问
network.host: 0.0.0.0

#设置其它节点和该节点交互的本机器的ip地址,三台各自为
network.publish_host: 192.168.174.18

# 设置映射端口
http.port: 9200

# 内部节点之间沟通端口
transport.port: 9300

# 支持跨域访问
http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization

#开启xpack安全认证
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.keystore.type: PKCS12
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.type: PKCS12
xpack.security.transport.ssl.keystore.password: llodyi4TMmZD
xpack.security.transport.ssl.truststore.password: llodyi4TMmZD

# HTTP 层的 SSL 配置
xpack.security.http.ssl:
  enabled: true
  keystore.path: elastic-certificates.p12
  keystore.password: llodyi4TMmZD
  truststore.path: elastic-certificates.p12
  truststore.password: llodyi4TMmZD

#配置集群的主机地址
discovery.seed_hosts: ["192.168.174.18", "192.168.174.218", "192.168.174.112"]
#初始主节点,使用一组初始的符合主条件的节点引导集群
cluster.initial_master_nodes: ["es-node-1", "es-node-2","es-node-3"]
#节点等待响应的时间,默认值是30秒,增加这个值,从一定程度上会减少误判导致脑裂
#discovery.zen.ping_timeout: 30s

#配置集群最少主节点数目,通常为 (可成为主节点的主机数目 / 2) + 1
#discovery.zen.minimum_master_nodes: 2
#配置集群最少正常工作节点数
#gateway.recover_after_nodes: 2

#禁用交换内存,提升效率
bootstrap.memory_lock: true

需要修改的地方:

  • node.name 节点名称,不能重复
  • node.roles 节点角色,执行决定
  • network.publish_host 当前节点的主机IP,需要用于与其他节点通信,尽量不使用容器IP,因为跨节点无法通信。
  • xpack.security.transport.ssl.keystore.password keystore密码,在创建elastic-certificates.p12加密文件时设置。
  • xpack.security.transport.ssl.truststore.password truststore密码,在创建elastic-certificates.p12加密文件时设置。
es-node-1
vim /data/es/conf/elasticsearch.yml
#集群名称 所有节点名称一致
cluster.name: es-clusters

#当前该节点的名称,每个节点不能重复es-node-1,es-node-2,es-node-3
node.name: es-node-1

# 当前该节点的角色
node.roles: ["master", "data"]

#设置为公开访问
network.host: 0.0.0.0

#设置其它节点和该节点交互的本机器的ip地址,三台各自为
network.publish_host: 192.168.174.18

# 设置映射端口
http.port: 9200

# 内部节点之间沟通端口
transport.port: 9300

# 支持跨域访问
http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization

#开启xpack安全认证
xpack.security.enabled: true
# 启用xpack.security才能创建注册令牌
xpack.security.enrollment.enabled: true
# 启用xpack.security.transport.ssl才能使用xpack.security
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.keystore.type: PKCS12
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.type: PKCS12
xpack.security.transport.ssl.keystore.password: llodyi4TMmZD
xpack.security.transport.ssl.truststore.password: llodyi4TMmZD

# HTTP 层的 SSL 配置
xpack.security.http.ssl:
  enabled: true
  keystore.path: elastic-certificates.p12
  keystore.password: llodyi4TMmZD
  truststore.path: elastic-certificates.p12
  truststore.password: llodyi4TMmZD

#配置集群的主机地址
discovery.seed_hosts: ["192.168.174.18", "192.168.174.218", "192.168.174.112"]
#初始主节点,使用一组初始的符合主条件的节点引导集群
cluster.initial_master_nodes: ["es-node-1", "es-node-2","es-node-3"]
#节点等待响应的时间,默认值是30秒,增加这个值,从一定程度上会减少误判导致脑裂
#discovery.zen.ping_timeout: 30s

#配置集群最少主节点数目,通常为 (可成为主节点的主机数目 / 2) + 1
#discovery.zen.minimum_master_nodes: 2
#配置集群最少正常工作节点数
#gateway.recover_after_nodes: 2

#禁用交换内存,提升效率
bootstrap.memory_lock: true
es-node-2
vim /data/es/conf/elasticsearch.yml
#集群名称 所有节点名称一致
cluster.name: es-clusters

#当前该节点的名称,每个节点不能重复es-node-1,es-node-2,es-node-3
node.name: es-node-2

# 当前该节点的角色
node.roles: ["master", "data"]

#设置为公开访问
network.host: 0.0.0.0

#设置其它节点和该节点交互的本机器的ip地址,三台各自为
network.publish_host: 192.168.174.218

# 设置映射端口
http.port: 9200

# 内部节点之间沟通端口
transport.port: 9300

# 支持跨域访问
http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization

#开启xpack安全认证
xpack.security.enabled: true
# 启用xpack.security才能创建注册令牌
xpack.security.enrollment.enabled: true
# 启用xpack.security.transport.ssl才能使用xpack.security
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.keystore.type: PKCS12
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.type: PKCS12
xpack.security.transport.ssl.keystore.password: llodyi4TMmZD
xpack.security.transport.ssl.truststore.password: llodyi4TMmZD

# HTTP 层的 SSL 配置
xpack.security.http.ssl:
  enabled: true
  keystore.path: elastic-certificates.p12
  keystore.password: llodyi4TMmZD
  truststore.path: elastic-certificates.p12
  truststore.password: llodyi4TMmZD

#配置集群的主机地址
discovery.seed_hosts: ["192.168.174.18", "192.168.174.218", "192.168.174.112"]
#初始主节点,使用一组初始的符合主条件的节点引导集群
cluster.initial_master_nodes: ["es-node-1", "es-node-2","es-node-3"]
#节点等待响应的时间,默认值是30秒,增加这个值,从一定程度上会减少误判导致脑裂
#discovery.zen.ping_timeout: 30s

#配置集群最少主节点数目,通常为 (可成为主节点的主机数目 / 2) + 1
#discovery.zen.minimum_master_nodes: 2
#配置集群最少正常工作节点数
#gateway.recover_after_nodes: 2

#禁用交换内存,提升效率
bootstrap.memory_lock: true
es-node-3
vim /data/es/conf/elasticsearch.yml
#集群名称 所有节点名称一致
cluster.name: es-clusters

#当前该节点的名称,每个节点不能重复es-node-1,es-node-2,es-node-3
node.name: es-node-3

# 当前该节点的角色
node.roles: ["master", "data"]

#设置为公开访问
network.host: 0.0.0.0

#设置其它节点和该节点交互的本机器的ip地址,三台各自为
network.publish_host: 192.168.174.112

# 设置映射端口
http.port: 9200

# 内部节点之间沟通端口
transport.port: 9300

# 支持跨域访问
http.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization

#开启xpack安全认证
xpack.security.enabled: true
# 启用xpack.security才能创建注册令牌
xpack.security.enrollment.enabled: true
# 启用xpack.security.transport.ssl才能使用xpack.security
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.keystore.type: PKCS12
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: elastic-certificates.p12
xpack.security.transport.ssl.truststore.type: PKCS12
xpack.security.transport.ssl.keystore.password: llodyi4TMmZD
xpack.security.transport.ssl.truststore.password: llodyi4TMmZD

# HTTP 层的 SSL 配置
xpack.security.http.ssl:
  enabled: true
  keystore.path: elastic-certificates.p12
  keystore.password: llodyi4TMmZD
  truststore.path: elastic-certificates.p12
  truststore.password: llodyi4TMmZD

#配置集群的主机地址
discovery.seed_hosts: ["192.168.174.18", "192.168.174.218", "192.168.174.112"]
#初始主节点,使用一组初始的符合主条件的节点引导集群
cluster.initial_master_nodes: ["es-node-1", "es-node-2","es-node-3"]
#节点等待响应的时间,默认值是30秒,增加这个值,从一定程度上会减少误判导致脑裂
#discovery.zen.ping_timeout: 30s

#配置集群最少主节点数目,通常为 (可成为主节点的主机数目 / 2) + 1
#discovery.zen.minimum_master_nodes: 2
#配置集群最少正常工作节点数
#gateway.recover_after_nodes: 2

#禁用交换内存,提升效率
bootstrap.memory_lock: true

服务器优化/配置(所有节点)

#提高进程及资源使用限制上线
vim /etc/security/limits.conf

* soft nofile 65536
* hard nofile 65536
* soft nproc 32000
* hard nproc 32000
* hard memlock unlimited
* soft memlock unlimited

vim /etc/systemd/system.conf

DefaultLimitNOFILE=65536
DefaultLimitNPROC=32000
DefaultLimitMEMLOCK=infinity

#重载配置文件
systemctl daemon-reload
systemctl daemon-reexec 

#修改虚拟内存最大映射数
vim /etc/sysctl.conf

#添加参数
vm.max_map_count = 262144

#重新加载/etc/sysctl.conf配置
sysctl -p

创建证书elastic-certificates.p12文件

# 首先运行ES示例
root@rabbitmq-1-18:~# docker run -itd --name es-node-1  elasticsearch:8.10.4  /bin/bash
# 进入node1容器
root@rabbitmq-1-18:~# docker exec -it es-node-1 /bin/bash
# 生成CA文件,并输出到/tmp目录下
elasticsearch@f18f0742da3a:~$ /usr/share/elasticsearch/bin/elasticsearch-certutil ca --out /tmp/elastic-stack-ca.p12
This tool assists you in the generation of X.509 certificates and certificate
signing requests for use with SSL/TLS in the Elastic stack.

The 'ca' mode generates a new 'certificate authority'
This will create a new X.509 certificate and private key that can be used
to sign certificate when running in 'cert' mode.

Use the 'ca-dn' option if you wish to configure the 'distinguished name'
of the certificate authority

By default the 'ca' mode produces a single PKCS#12 output file which holds:
    * The CA certificate
    * The CA's private key

If you elect to generate PEM format certificates (the -pem option), then the output will
be a zip file containing individual files for the CA certificate and private key

# 输入密码,例如:123456
Enter password for elastic-stack-ca.p12 : 
# 指定/tmp目录的ca文件,生成证书文件到/tmp目录下,这里指定了可以使用证书的节点,如果有新增节点,需要重新生成并同步到其他节点。
elasticsearch@f18f0742da3a:~$ /usr/share/elasticsearch/bin/elasticsearch-certutil cert --ca /tmp/elastic-stack-ca.p12 --dns es-node-1,es-node-2,es-node-3 --ip 192.168.174.18,192.168.174.218,192.168.174.112 --out /tmp/elastic-certificates.p12
This tool assists you in the generation of X.509 certificates and certificate
signing requests for use with SSL/TLS in the Elastic stack.

The 'cert' mode generates X.509 certificate and private keys.
    * By default, this generates a single certificate and key for use
       on a single instance.
    * The '-multiple' option will prompt you to enter details for multiple
       instances and will generate a certificate and key for each one
    * The '-in' option allows for the certificate generation to be automated by describing
       the details of each instance in a YAML file

    * An instance is any piece of the Elastic Stack that requires an SSL certificate.
      Depending on your configuration, Elasticsearch, Logstash, Kibana, and Beats
      may all require a certificate and private key.
    * The minimum required value for each instance is a name. This can simply be the
      hostname, which will be used as the Common Name of the certificate. A full
      distinguished name may also be used.
    * A filename value may be required for each instance. This is necessary when the
      name would result in an invalid file or directory name. The name provided here
      is used as the directory name (within the zip) and the prefix for the key and
      certificate files. The filename is required if you are prompted and the name
      is not displayed in the prompt.
    * IP addresses and DNS names are optional. Multiple values can be specified as a
      comma separated string. If no IP addresses or DNS names are provided, you may
      disable hostname verification in your SSL configuration.


    * All certificates generated by this tool will be signed by a certificate authority (CA)
      unless the --self-signed command line option is specified.
      The tool can automatically generate a new CA for you, or you can provide your own with
      the --ca or --ca-cert command line options.


By default the 'cert' mode produces a single PKCS#12 output file which holds:
    * The instance certificate
    * The private key for the instance certificate
    * The CA certificate

If you specify any of the following options:
    * -pem (PEM formatted output)
    * -multiple (generate multiple certificates)
    * -in (generate certificates from an input file)
then the output will be be a zip file containing individual certificate/key files

# 输入CA的密码
Enter password for CA (/tmp/elastic-stack-ca.p12) : 
# 输入证书文件的密码
Enter password for elastic-certificates.p12 : 

Certificates written to /tmp/elastic-certificates.p12

This file should be properly secured as it contains the private key for 
your instance.
This file is a self contained file and can be copied and used 'as is'
For each Elastic product that you wish to configure, you should copy
this '.p12' file to the relevant configuration directory
and then follow the SSL configuration instructions in the product guide.

For client applications, you may only need to copy the CA certificate and
configure the client to trust this certificate.
# 生成后的证书与CA文件
elasticsearch@f18f0742da3a:~$ ls /tmp/
elastic-certificates.p12  elasticsearch-13473260200918243729  elasticsearch-641831696962769774   elasticsearch-9157611881811365698
elastic-stack-ca.p12      elasticsearch-18321848440285978544  elasticsearch-8563172779946024729  hsperfdata_elasticsearch
elasticsearch@f18f0742da3a:~$ exit
exit
# 将证书拷贝出来,准备分发到其他节点
root@rabbitmq-1-18:~# docker cp es-node-1:/tmp/elastic-certificates.p12 .
Successfully copied 5.63kB to /root/.
# 清理es-node-1容器
root@rabbitmq-1-18:~# docker rm -f es-node-1

拷贝加密文件到conf下(分发到所有节点)

cp elastic-certificates.p12 /data/es/conf/

数据目录授权

# 数据目录授权
chown -R 1000:1000 /data/es/data
chown -R 1000:1000 /data/es/logs
chown -R 1000:1000 /data/es/plugins
chmod -R 755 /data/es/data/
chmod -R 755 /data/es/logs/
chmod -R 755 /data/es/plugins/
# 加密文件授权
chown 1000:1000 /data/es/conf/elastic-certificates.p12
chmod 600 /data/es/conf/elastic-certificates.p12

关闭swap内存

swapoff -a
sed -i '/swap/s/^/#/' /etc/fstab

启动ElasticSearch集群

es-node-1
# 创建运维目录
mkdir /root/shell
# 创建es-node-1文件
vim /root/shell/es-node-1.yml
version: '3'

services:
  es-node-1:
    image: elasticsearch:8.10.4
    container_name: es-node-1
    restart: always
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - ES_JAVA_OPTS=-Xms16g -Xmx16g
      - bootstrap.memory_lock=true
    user: "1000:1000"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /data/es/conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
      - /data/es/data/:/usr/share/elasticsearch/data
      - /data/es/logs/:/usr/share/elasticsearch/logs
      - /data/es/plugins/:/usr/share/elasticsearch/plugins
      - /data/es/conf/elastic-certificates.p12:/usr/share/elasticsearch/config/elastic-certificates.p12

# es-node-1节点启动
docker-compose -p es -f shell/es-node-1.yml up -d
es-node-2
# 创建运维目录
mkdir /root/shell
# 创建ees-node-2文件
vim /root/shell/es-node-2.yml
version: '3'

services:
  es-node-2:
    image: elasticsearch:8.10.4
    container_name: es-node-2
    restart: always
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - ES_JAVA_OPTS=-Xms16g -Xmx16g
      - bootstrap.memory_lock=true
    user: "1000:1000"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /data/es/conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
      - /data/es/data/:/usr/share/elasticsearch/data
      - /data/es/logs/:/usr/share/elasticsearch/logs
      - /data/es/plugins/:/usr/share/elasticsearch/plugins
      - /data/es/conf/elastic-certificates.p12:/usr/share/elasticsearch/config/elastic-certificates.p12

# es-node-2节点启动
docker-compose -p es -f shell/es-node-2.yml up -d
es-node-3
# 创建运维目录
mkdir /root/shell
# 创建es-node-3文件
vim /root/shell/es-node-3.yml
version: '3'

services:
  es-node-3:
    image: elasticsearch:8.10.4
    container_name: es-node-3
    restart: always
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      - ES_JAVA_OPTS=-Xms16g -Xmx16g
      - bootstrap.memory_lock=true
    user: "1000:1000"
    ulimits:
      memlock:
        soft: -1
        hard: -1
    volumes:
      - /data/es/conf/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
      - /data/es/data/:/usr/share/elasticsearch/data
      - /data/es/logs/:/usr/share/elasticsearch/logs
      - /data/es/plugins/:/usr/share/elasticsearch/plugins
      - /data/es/conf/elastic-certificates.p12:/usr/share/elasticsearch/config/elastic-certificates.p12

# es-node-3节点启动
docker-compose -p es -f shell/es-node-3.yml up -d

设置密码

#进入其中一台进行设置
root@rabbitmq-1-18:~# docker exec -it es-node-1 /bin/bash
elasticsearch@f6c8c56bf477:~$ /usr/share/elasticsearch/bin/elasticsearch-setup-passwords interactive -u https://192.168.174.18:9200
06:37:08.153 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:08.159 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:08.165 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:08.166 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:08.810 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:08.811 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:08.813 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:08.813 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
******************************************************************************
Note: The 'elasticsearch-setup-passwords' tool has been deprecated. This       command will be removed in a future release.
******************************************************************************

Initiating the setup of passwords for reserved users elastic,apm_system,kibana,kibana_system,logstash_system,beats_system,remote_monitoring_user.
You will be prompted to enter passwords as the process progresses.
Please confirm that you would like to continue [y/N]y

# 填入需要设置的密码
Enter password for [elastic]: 
Reenter password for [elastic]: 
Enter password for [apm_system]: 
Reenter password for [apm_system]: 
Enter password for [kibana_system]: 
Reenter password for [kibana_system]: 
Enter password for [logstash_system]: 
Reenter password for [logstash_system]: 
Enter password for [beats_system]: 
Reenter password for [beats_system]: 
Enter password for [remote_monitoring_user]: 
Reenter password for [remote_monitoring_user]: 
06:37:55.614 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:55.614 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:55.616 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:55.616 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
Changed password for user [apm_system]
06:37:57.101 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.101 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.103 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.103 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
Changed password for user [kibana_system]
06:37:57.290 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.290 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.292 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.292 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
Changed password for user [kibana]
06:37:57.468 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.468 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.470 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.470 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
Changed password for user [logstash_system]
06:37:57.647 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.647 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.648 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.649 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
Changed password for user [beats_system]
06:37:57.824 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.824 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.825 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.826 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
Changed password for user [remote_monitoring_user]
06:37:57.999 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:57.999 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:58.000 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="keystore.password" message="[keystore.password] setting was deprecated in Elasticsearch and will be removed in a future release."
06:37:58.001 [main] WARN  org.elasticsearch.deprecation.common.settings.Settings - data_stream.dataset="deprecation.elasticsearch" data_stream.namespace="default" data_stream.type="logs" elasticsearch.event.category="settings" event.code="truststore.password" message="[truststore.password] setting was deprecated in Elasticsearch and will be removed in a future 
Changed password for user [elastic]

#自定义设置密码
./bin/elasticsearch-setup-passwords interactive
#生成密码
./bin/elasticsearch-setup-passwords auto

查看状态

# 集群节点
root@rabbitmq-1-18:~# curl -k  -u elastic:llodyi4TMmZD https://192.168.174.18:9200/_cat/nodes?v   
ip              heap.percent ram.percent cpu load_1m load_5m load_15m node.role master name
192.168.174.112            6          44   0    0.00    0.00     0.00 dm        -      es-node-3
192.168.174.18             4          47   0    0.13    0.08     0.03 dm        *      es-node-1
192.168.174.218            6          44   0    0.00    0.00     0.00 dm        -      es-node-2

# 集群状态
root@rabbitmq-1-18:~# curl -k -u elastic:llodyi4TMmZD https://192.168.174.18:9200/_cat/health?v
epoch      timestamp cluster     status node.total node.data shards pri relo init unassign pending_tasks max_task_wait_time active_shards_percent
1722842322 07:18:42  es-clusters green           3         3      2   1    0    0        0             0                  -                100.0%

Elasticsearch 集群已经成功搭建并且正在正常运行。具体来看:

  • Cluster Status : green 表示集群的状态良好,所有主分片和副本分片都正常分配。
  • Node Total : 你的集群中有 3 个节点。
  • Node Data : 3 个节点都被标记为数据节点。
  • Shards : 总共有 2 个分片,其中 1 个是主分片,没有副本分片 (relo, init, unassign 都是 0)。
  • Active Shards Percent : 100.0% 表示所有的分片都已经处于活动状态。

部署可视化kibana工具

为Kibana生成注册令牌

root@rabbitmq-1-18:~# curl -X POST "https://192.168.174.18:9200/_security/service/elastic/kibana/credential/token" -u elastic:llodyi4TMmZD -k -H 'Content-Type: application/json'
{"created":true,"token":{"name":"token_F0mBIZEBK8qkrUMde71A","value":"AAEAAWVsYXN0aWMva2liYW5hL3Rva2VuX0YwbUJJWkVCSzhxa3JVTWRlNzFBOlhyWloxQnUtUlVLOXNUWEtuUDNyeXc"}}

替换IP地址和你的elastic密码信息。

创建kibana.yaml文件

mkdir /data/kibana/
chown 1000 -R /data/kibana/
vim /data/kibana/kibana.yaml

server.name: kibana
server.host: "0.0.0.0"
server.port: 5601
elasticsearch.hosts: [ "https://192.168.174.18:9200" ]
elasticsearch.requestTimeout: 60000
monitoring.ui.container.elasticsearch.enabled: true
monitoring.ui.ccs.enabled: false
i18n.locale: "zh-CN"
elasticsearch.serviceAccountToken: "AAEAAWVsYXN0aWMva2liYW5hL3Rva2VuX0YwbUJJWkVCSzhxa3JVTWRlNzFBOlhyWloxQnUtUlVLOXNUWEtuUDNyeXc"
elasticsearch.ssl.verificationMode: "none"  # 添加此行以禁用 SSL 验证
xpack.reporting.encryptionKey: "a_random_string"
xpack.security.encryptionKey: "something_at_least_32_characters"

运行kibana

docker run -d --restart=always --name kibana -p5601:5601 -v /data/kibana/kibana.yaml:/usr/share/kibana/config/kibana.yml kibana:8.10.4

访问验证

登录kibana http://192.168.174.18:5601,用户名为elasic,密码为之前设置密码。

登录

1722845600983

集群状态

1722846240030

部分接口
#查看集群节点
http://192.168.174.18:9200/_cat/nodes?v
#节点磁盘分配情况
http://192.168.174.18:9200/_cat/allocation?v
#查看ES集群的整体情况
http://192.168.174.18:9200/_cat/health?v
#查看ES集群的索引情况
http://192.168.174.18:9200/_cat/indices?v
#输入ES账户密码

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/914236.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

28.医院管理系统(基于springboot和vue)

目录 1.系统的受众说明 2. 相关技术和开发环境 2.1 相关技术 2.1.1 Java语言 2.1.2 HTML、CSS、JavaScript 2.1.3 Redis 2.1.4 MySQL 2.1.5 SSM框架 2.1.6 Vue.js 2.1.7 SpringBoot 2.2 开发环境 3. 系统分析 3.1 可行性分析 3.1.1 经济可行性 3.1.2 技术…

高性能分布式缓存Redis-高可用部署

一、主从架构搭建 为什么要进行主从架构搭建,一台redis不行吗? ①、持久化后的数据只在一台机器上,因此当硬件发生故障时,比如主板或CPU坏了,这时候无法重启服务器,有什么办法可以保证服务器发生故障时数…

Profinet转CanOpen网关连接与CanOpen协议磁轨道实现高效连接

该项目旨在展示如何通过开疆智能Profinet转Canopen网关实现西门子1200PLC与磁轨道之间的连接。以下是项目实施的步骤概要:安装必要的GSD文件到西门子组态软件中,确保系统能够识别并使用Profinet转Canopen网关设备。 进行设备配置,包括将PLC和…

openai Realtime API (实时语音)

https://openai.com/index/introducing-the-realtime-api/ 官方demo https://github.com/openai/openai-realtime-console 官方demo使用到的插件 https://github.com/openai/openai-realtime-api-beta?tabreadme-ov-file 装包配置 修改yarn.lock 这个包是从github下载的 &q…

Docker--Docker是什么和对Docker的了解

Docker 的本质 Docker的本质是LXC(Linux容器)之类的增强版,它本身不是容器,而是容器的易用工具。 Docker通过虚拟化技术,将代码、依赖项和运行环境打包成一个容器,并利用隔离机制来使得容器之间互相独立、…

【报错记录】Steam迁移(移动)游戏报:移动以下应用的内容失败:XXX: 磁盘写入错误

前言 由于黑神话悟空,导致我的2TB的SSD系统盘快满了,我又买了一块4TB的SSD用来存放游戏,我就打算把之前C盘里的游戏移动到D盘,结果Steam移动游戏居然报错了,报的还是“磁盘写入错误”,如下图所示&#xff…

攻防世界37-unseping-CTFWeb

攻防世界37-unseping-CTFWeb <?php highlight_file(__FILE__);class ease{private $method;private $args;function __construct($method, $args) {$this->method $method;$this->args $args;}function __destruct(){if (in_array($this->method, array("…

LabVIEW 版本控制

在软件开发中&#xff0c;版本控制系统&#xff08;VCS&#xff09; 是管理代码版本变化的核心工具。对于 LabVIEW 用户&#xff0c;虽然图形化编程带来高效开发体验&#xff0c;但由于其特有的二进制 VI 文件格式&#xff0c;传统文本比较工具无法直接用于 LabVIEW 项目。这时…

Cesium着色器的创意和方法(五——Polyline)

不接受反驳&#xff0c;线段在三维里面的渲染比多边形的渲染更复杂。因为线是没有宽度的&#xff0c;并且还需要时时刻刻向着你。 首先看下Cesium的线段的一些效果。这条线段非常宽&#xff08;20个像素&#xff09;&#xff0c;有两个需要留意观察的。一是线段并非实时面对我…

独立开发者赚钱心法

一、独立开发者的身份转变 开发者到多重角色&#xff1a;独立开发者不仅是程序员&#xff0c;还是产品经理、设计师、文案、销售、运营、客服&#xff0c;最重要的是成为“老板”。思维转变&#xff1a;将开发程序视为一门生意&#xff0c;而非单纯的技术实现。 二、赚钱的核…

Hook小程序

下载&#xff1a; https://github.com/JaveleyQAQ/WeChatOpenDevTools-Python 配置&#xff1a; pip install -r requirements 实现&#xff1a; 开启小程序开发者模式&#xff0c;类似浏览器F12 效果&#xff1a; 使用&#xff1a; 退出微信&#xff0c;进入安装的目录…

【Spring Security系列】10分钟实现 SpringSecurity + CAS 完美单点登录方案

作者&#xff1a;后端小肥肠 &#x1f347; 我写过的文章中的相关代码放到了gitee&#xff0c;地址&#xff1a;xfc-fdw-cloud: 公共解决方案 &#x1f34a; 有疑问可私信或评论区联系我。 &#x1f951; 创作不易未经允许严禁转载。 姊妹篇&#xff1a; 【Spring Security系列…

Spring Boot编程训练系统:构建可扩展的应用

摘要 随着信息技术在管理上越来越深入而广泛的应用&#xff0c;管理信息系统的实施在技术上已逐步成熟。本文介绍了编程训练系统的开发全过程。通过分析编程训练系统管理的不足&#xff0c;创建了一个计算机管理编程训练系统的方案。文章介绍了编程训练系统的系统分析部分&…

提升AI性能的关键大型语言模型(LLM)压缩策略

每周跟踪AI热点新闻动向和震撼发展 想要探索生成式人工智能的前沿进展吗&#xff1f;订阅我们的简报&#xff0c;深入解析最新的技术突破、实际应用案例和未来的趋势。与全球数同行一同&#xff0c;从行业内部的深度分析和实用指南中受益。不要错过这个机会&#xff0c;成为AI领…

「IDE」集成开发环境专栏目录大纲

✨博客主页何曾参静谧的博客&#x1f4cc;文章专栏「IDE」集成开发环境&#x1f4da;全部专栏「Win」Windows程序设计「IDE」集成开发环境「UG/NX」BlockUI集合「C/C」C/C程序设计「DSA」数据结构与算法「UG/NX」NX二次开发「QT」QT5程序设计「File」数据文件格式「UG/NX」NX定…

关于 npm 更新镜像源问题

npm&#xff08;Node Package Manager&#xff09;&#xff0c;是一个NodeJS包管理和分发工具&#xff0c;已经成为了非官方的发布Node模块&#xff08;包&#xff09;的标准。&#xff09; 查看当前npm版本 npm -v 10.9.0 执行以下命令报错 npm install --registryhttp…

Worldly平台更新Higg FEM 2024模块价格及购买指南

近日&#xff0c;LEVERAGE供应链管理从美国可持续服装联盟&#xff08;Cascale&#xff09;验证官方Worldly平台模块订阅更新中获悉&#xff0c;FEM2024模块价格更新的重要信息。此次更新涉及工厂环境模块&#xff08;FEM&#xff09;和工厂社会劳工模块&#xff08;FSLM&#…

MQ的实际使用

前言: 在这一篇文章当中我会以RcoketMQ来对其的使用的场景进行一个仔细地说明,这个里面也会涉及到一些额外的知识,看完之后对面试而言的话那么就是直接拿捏,当然在看这篇文章之前要先看MQ的基础知识-CSDN博客 毕竟基础才是王道,下面就是开始我们的正菜 在我的基础的那篇文章中就…

MFC图形函数学习08——绘图函数的重载介绍

在《MFC图形函数学习06——画椭圆弧线函数》中介绍了CPoint类、POINT结构体&#xff1b;在《MFC图形函数学习07——画扇形函数》中介绍了CRect类、RECT结构体。在介绍完后&#xff0c;没有介绍它们怎样使用。实际上&#xff0c;这些类和结构体对象或指针也是我们学习过的绘图函…

SAP-ABAP开发-BAPI

BAPI基于数据库表的操作函数传入传出数据&#xff0c;本身函数有接口与增强无关 目录 一、BAPI接口定义 二、业务对象 三、查询方法 四、调用 五、BAPI创建 &#xff08;1&#xff09;在DDIC中创建一个结构 &#xff08;2&#xff09;创建BAPI函数模块和函数或API方法 …