elasticsearch 8.17.3部署文档

elasticsearch 8.17.3部署文档

一、架构拓扑

ip主机名角色
192.168.241.151slave1master
192.168.241.152slave2node1
192.168.241.153slave3node2

二、安装包下载——分别下载上传至所有的节点

下载地址https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.17.3-linux-x86_64.tar.gz

##可以使用wget
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.17.3-linux-x86_64.tar.gz

三、master节点部署

3.1 调整服务器参数
 cat >> /etc/security/limits.conf << EOF
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
EOF
echo "vm.max_map_count=655360" >> /etc/sysctl.conf
sysctl  -p
useradd elastic
echo "elastic" | passwd --stdin elastic
3.2 解压并赋权
tar xf elasticsearch-8.17.3-linux-x86_64.tar.gz  -C /opt/
ln -s /opt/elasticsearch-8.17.3 /opt/elasticsearch
chown -R elastic:elastic /opt/elasticsearch*
su elastic
cd /opt/elasticsearch
3.3 修改配置文件

vi /opt/elasticsearch/config/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: myes
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: slave1
#
# 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/elastic/es/data
#
# Path to log files:
#
path.logs: /home/elastic/es/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: 0.0.0.0
#
# 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: ["slave1", "slave2", "slave3"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["slave1"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Allow wildcard deletion of indices:
#
#action.destructive_requires_name: false
3.4 启动es-master
/opt/elasticsearch/bin/elasticsearch

显示下图表示初始化成功,图中包含账号密码
在这里插入图片描述

浏览器输入https://192.168.241.150:9200验证
输入账号elastic
密码BOOIaTVR1B78EqALY*e1
在这里插入图片描述

3.5 调整配置

首次启动使用/opt/elasticsearch/bin/elasticsearch命令可以帮助我们自动生成证书以及账号密码,若使用其他命令需要自己使用bin/elasticsearch-reset-password -u elastic设置密码
启动后可以查看配置文件目录会生成certs目录
使用ctrl + c 退出 ,查看新的配置文件注释掉cluster.initial_master_nodes: [“slave1”]

# ======================== 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: myes
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: slave1
#
# 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/elastic/es/data
#
# Path to log files:
#
path.logs: /home/elastic/es/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: 0.0.0.0
#
# 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: ["slave1", "slave2", "slave3"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["slave1"]
#
# 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 11-03-2025 12:44:07
#
# --------------------------------------------------------------------------------# Enable security features
xpack.security.enabled: truexpack.security.enrollment.enabled: true# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:enabled: truekeystore.path: certs/http.p12# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:enabled: trueverification_mode: certificatekeystore.path: certs/transport.p12truststore.path: certs/transport.p12
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------
3.6 后台重新启动
cd /opt/elasticsearch
nohup ./bin/elasticsearch > logs/elasticsearch.log 2>&1 &

4 从节点部署

4.1 调整服务器参数

同3.1

4.2 解压并赋权

同3.2

4.3 修改配置文件

vi /opt/elasticsearch/config/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: myes
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: slave2
node.roles: [ data, ingest ]
#
# 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/elastic/es/data
#
# Path to log files:
#
path.logs: /home/elastic/es/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: 0.0.0.0
#
# 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: ["slave1", "slave2", "slave3"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["slave1"]
#
# 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 11-03-2025 12:44:07
#
# --------------------------------------------------------------------------------# Enable security features
xpack.security.enabled: truexpack.security.enrollment.enabled: true# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:enabled: truekeystore.path: certs/http.p12# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:enabled: trueverification_mode: certificatekeystore.path: certs/transport.p12truststore.path: certs/transport.p12
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------
4.4 获取master相关认证密码——master节点

在slave1节点把证书拷贝到其他节点

scp -r /opt/elasticsearch/config/certs slave2:/opt/elasticsearch/config/
/opt/elasticsearch/bin/elasticsearch-keystore list
/opt/elasticsearch/bin/elasticsearch-keystore show xpack.security.http.ssl.keystore.secure_password
/opt/elasticsearch/bin/elasticsearch-keystore show xpack.security.transport.ssl.keystore.secure_password
/opt/elasticsearch/bin/elasticsearch-keystore show xpack.security.transport.ssl.truststore.secure_password

在这里插入图片描述

4.5 slave节点加载密码——slave节点
/opt/elasticsearch/bin/elasticsearch-keystore add xpack.security.http.ssl.keystore.secure_password
/opt/elasticsearch/bin/elasticsearch-keystore add xpack.security.transport.ssl.keystore.secure_password
/opt/elasticsearch/bin/elasticsearch-keystore add xpack.security.transport.ssl.truststore.secure_password

在这里插入图片描述

4.6 启动slave节点
nohup /opt/elasticsearch/bin/elasticsearch > /opt/elasticsearch/logs/elasticsearch.log 2>&1 &

5 浏览器使用elasticvue查看es集群状态

5.1 在浏览器点击扩展,搜索elasticvue

在这里插入图片描述

5.2 获取添加扩展

在这里插入图片描述

5.3 连接集群

在这里插入图片描述

成功

##

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

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

PySide(PyQT),QGraphicsItem的pos()和scenePos()区别

在QGraphicsItem中&#xff0c;pos()和scenePos()是两个重要的方法&#xff0c;用于描述图形项的位置&#xff0c;但它们的含义和用途有所不同。理解它们的区别对于正确操作和管理QGraphicsItem的位置至关重要。 1. pos()方法 • 定义&#xff1a;pos()返回的是QGraphicsItem在…

Linux 进程控制:创建、终止、等待与程序替换全解析

亲爱的读者朋友们&#x1f603;&#xff0c;此文开启知识盛宴与思想碰撞&#x1f389;。 快来参与讨论&#x1f4ac;&#xff0c;点赞&#x1f44d;、收藏⭐、分享&#x1f4e4;&#xff0c;共创活力社区。 目录 1.进程创建 1-1 fork函数初识​ 1-2 fork函数返回值​ 1-3…

GStreamer —— 2.18、Windows下Qt加载GStreamer库后运行 - “播放教程 6:音频可视化“(附:完整源码)

运行效果 介绍 GStreamer 带有一组将音频转换为视频的元素。他们 可用于科学可视化或为您的音乐增添趣味 player 的本教程展示了&#xff1a; • 如何启用音频可视化 • 如何选择可视化元素 启用音频可视化实际上非常简单。设置相应的标志&#xff0c;当纯音频流为 found&#…

Excel多级联动下拉菜单设置

1.问题描述 现有数据表如下图所示&#xff1a; 该表中包括省、市、县三级目录。 现要将其整理成数据表模板&#xff0c;如下图所示&#xff1a; 要求制作成下拉菜单的形式&#xff0c;且每一级目录的下拉菜单列表要根据上一级目录的内容来确定。 如上图所示&#xff0c;只有…

Web基础:HTML快速入门

HTML基础语法 HTML&#xff08;超文本标记语言&#xff09; 是用于创建网页内容的 标记语言&#xff0c;通过定义页面的 结构和内容 来告诉浏览器如何呈现网页。 超文本&#xff08;Hypertext&#xff09; 是一种通过 链接&#xff08;Hyperlinks&#xff09; 将不同文本、图像…

VSTO(C#)Excel开发2:Excel对象模型和基本操作

初级代码游戏的专栏介绍与文章目录-CSDN博客 我的github&#xff1a;codetoys&#xff0c;所有代码都将会位于ctfc库中。已经放入库中我会指出在库中的位置。 这些代码大部分以Linux为目标但部分代码是纯C的&#xff0c;可以在任何平台上使用。 源码指引&#xff1a;github源…

PostgreSQL学习笔记:PostgreSQL vs MySQL

PostgreSQL 和 MySQL 都是广泛使用的关系型数据库管理系统&#xff0c;它们有以下一些对比&#xff1a; 一、功能特性 1. 数据类型支持 PostgreSQL&#xff1a;支持丰富的数据类型&#xff0c;包括数组、JSON、JSONB、范围类型、几何类型等。对于复杂数据结构的存储和处理非…

Matlab:矩阵运算篇——矩阵

目录 1.定义 实例——创建矩阵 实例——创建复数矩阵 2.矩阵的生成 实例——M文件矩阵 2.利用文本创建 实例——创建生活用品矩阵 3.创建特殊矩阵 实例——生成特殊矩阵 4.矩阵元素的运算 1.矩阵元素的修改 实例——新矩阵的生成 2.矩阵的变维 实例——矩阵维度修…

从0到1入门Docker

一、快速入门 Docker run命令中的常见参数 -d&#xff1a;让容器后台运行--name&#xff1a;给容器命名&#xff08;唯一&#xff09;-e&#xff1a;环境变量-p&#xff1a;宿主机端口映射到容器内端口镜像名称结构&#xff1a;Repository &#xff1a;TAG&#xff08;镜像名&…

Python的浮点数

在 Python 中&#xff0c;有四种内置数值类型&#xff0c;分别是整型整数类型&#xff08;int&#xff09;、布尔类型&#xff08;bool&#xff09;、浮点数类型&#xff08;float&#xff09;和复数类型&#xff08;complex&#xff09;。浮点数默认是双精度类型&#xff0c;占…

从零开始 | C语言基础刷题DAY1

❤个人主页&#xff1a;折枝寄北的博客 DAY1[2025.3.11] 1. 求两个数的较大值2.从键盘输入的两个数的大小关系3.一个整数的奇偶性&#xff0c;请判断4. 考试分数是否通过5.考试成绩是否完美&#xff0c;请判断 1. 求两个数的较大值 题目&#xff1a; 写一个函数求两个整数的较…

[pytest] 配置

这里写目录标题 PytestInitRun3. 根据命令行选项将不同的值传递给测试函数 Report1. 向测试报告标题添加信息2. 分析测试持续时间 pytest --durations33. 增量测试 - 测试步骤--junitxml{report}.xml1. testsuite1.1 在测试套件级别添加属性节点 record_testsuite_property 2. …

物联网商业模式

物联网商业模式是一种战略规划&#xff0c;它融合了物联网技术来创造价值并获取收入。它与传统商业模式的不同之处在于&#xff0c;它利用互联设备来改善运营、提升客户体验以及优化服务项目。在当今由科技驱动的世界中&#xff0c;这种商业模式通过利用实时数据来提供创新服务…

springboot432-基于SpringBoot的酒店管理系统(源码+数据库+纯前后端分离+部署讲解等)

&#x1f495;&#x1f495;作者&#xff1a; 爱笑学姐 &#x1f495;&#x1f495;个人简介&#xff1a;十年Java&#xff0c;Python美女程序员一枚&#xff0c;精通计算机专业前后端各类框架。 &#x1f495;&#x1f495;各类成品Java毕设 。javaweb&#xff0c;ssm&#xf…

Manus AI:开启Agent元年的ChatGPT时刻(附赠资料)

1. Manus AI&#xff1a;全球首个通用Agent Manus AI 是全球首个通用人工智能代理&#xff0c;连接思想与行动&#xff0c;不仅思考&#xff0c;还能交付成果。Manus 擅长处理工作和生活中的各种任务&#xff0c;帮助用户完成一切。其核心理念是“less structure, more intell…

vscode接入DeepSeek 免费送2000 万 Tokens 解决DeepSeek无法充值问题

1. 在vscode中安装插件 Cline 2.打开硅基流动官网 3. 注册并登陆&#xff0c;邀请码 WpcqcXMs 4.登录后新建秘钥 5. 在vscode中配置cline (1) API Provider 选择 OpenAI Compatible &#xff1b; (2) Base URL设置为 https://api.siliconflow.cn](https://api.siliconfl…

从零使用docker并安装部署mysql8.3.0容器

在开始使用docker到完成mysql的安装部署&#xff0c;中间有很多的坑等着 安装docker并配置 sudo yum install docker-ce 启动docker并设置开机启动项 sudo systemctl start docker sudo systemctl enable docker查看docker是否启动 sudo systemctl status docker 或者直接…

golang 静态库 Undefined symbol: __mingw_vfprintf

正常用golang编译一个静态库给 其他语言 调用&#xff0c;编译时报错 Error: Undefined symbol: __mingw_vfprintf 很是奇怪&#xff0c;之前用用golang写静态库成功过&#xff0c;编译也没问题&#xff0c;结果却是截然不同。 试了很多次&#xff0c;发现唯一的差别就是在 …

如何下载一些网上只提供了预览的pdf

有些网站上提供了pdf的预览&#xff0c;但是不提供下载入口 这时候用浏览器调出开发人员工具&#xff08;F12&#xff09;,找Fetch/XHR这个选项&#xff0c;里看启动器中有pdf的那个文件&#xff0c;点选 它。 然后就能找到它的网址了&#xff0c;直接把这个网址选中&#xff…

力扣-数组-34 在排序数组中查找元素的第一个和最后一个位置

思路和时间复杂度 思路&#xff1a;先找到中间数&#xff0c;如果没找到就返回{-1&#xff0c;-1}&#xff0c;如果找到了就以当前节点为中点&#xff0c;向两边扩时间复杂度&#xff1a; 代码 class Solution { public:vector<int> searchRange(vector<int…