当前位置: 首页 > news >正文

Elasticsearch7.14.2集群部署和elk部署

1.环境准备
wget \
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.14.2-linux-x86_64.tar.gz \
https://artifacts.elastic.co/downloads/kibana/kibana-7.14.2-linux-x86_64.tar.gz \
https://artifacts.elastic.co/downloads/logstash/logstash-7.14.2-linux-x86_64.tar.gz
 2、解压缩
tar -zxvf elasticsearch-7.14.2-linux-x86_64.tar.gz
3、复制解压文件到/user/local目录下(此步骤亦可以省略)
mv elasticsearch-7.14.2 /usr/local/
4、创建用户:修改密码:
useradd es
passwd es
5、root分配目录权限给es用户:
chown -R es:es elasticsearch-7.14.2
6、root用户设置系统参数
vim /etc/security/limits.conf 
es hard nofile 65536
es soft nofile 65536
保存并退出
vim /etc/sysctl.conf    # 在最后面追加下面内容
vm.max_map_count=655360
执行  sysctl -p

7、修改 elasticsearch-7.14.2/config文件夹下编辑 jvm.options,Xms和Xmx

8、进入elasticsearch-7.14.2/config文件夹下编辑elasticsearch.yml,cluster.name,和安全xpack

# ======================== 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: xinren-es-cluster
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: node-3
node.master: true
node.data: true
node.max_local_storage_nodes: 3
#
# 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: /opt/es/elasticsearch-7.14.2/data
#
# Path to log files:
#
path.logs:  /opt/es/elasticsearch-7.14.2/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
transport.tcp.port: 9300
#
# 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: ["1.1.1.1:9300", "1.1.1.2:9300", "1.1.1.3:9300"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
cluster.initial_master_nodes: ["node-1", "node-2", "node-3"]
gateway.recover_after_nodes: 2
gateway.recover_after_time: 5m
gateway.expected_nodes: 3
discovery.zen.ping_timeout: 60shttp.cors.enabled: true
http.cors.allow-origin: "*"
xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true
xpack.security.transport.ssl.verification_mode: certificate
xpack.security.transport.ssl.keystore.path: /opt/es/elasticsearch-7.14.2/config/elastic-certificates.p12
xpack.security.transport.ssl.truststore.path: /opt/es/elasticsearch-7.14.2/config/elastic-certificates.p12#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

9、生成 TLS 和身份验证,将会在 config 下生成 elastic-certificates.p12 文件,将此文件传到其他两个节点的 config 目录,注意文件权限

bin/elasticsearch-certutil cert -out config/elastic-certificates.p12 -pass ""

10、注意文件权限

su root
chown -R es:es elasticsearch-7.14.2

11、在节点 1 上执行如下命令,设置用户密码。设置完之后,数据会自动同步到其他节点。

bin/elasticsearch-setup-passwords interactive

TODO 持续更新

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • C#中通过TabControl控制MDI子窗体显示切换的实现过程
  • jmeter响应断言、json断言、断言持续时间、大小断言操作
  • pytest.mark简介
  • RabbitMQ中的死信交换机?(RabbitMQ延迟队列有了解过吗)
  • [Labview] 表格改值后单元格编辑功能,更改颜色、字体、颜色等
  • sqli-labs靶场通关攻略(五十一到五十六关)
  • 数据线性结构
  • Notepad++回车不自动补全
  • opencv之形态学
  • flutter 类似Android 中RelativeLayout在末尾居中
  • Golang | Leetcode Golang题解之第386题字典序排数
  • STM32(八):定时器——输入捕获实验
  • [译] APT分析报告:12.APT29利用spy软件供应商创建的IOS、Chrome漏洞
  • VSCode+debugpy远程调试
  • 第六课,模运算进阶,计算机存储单位
  • android 一些 utils
  • C# 免费离线人脸识别 2.0 Demo
  • co.js - 让异步代码同步化
  • Java编程基础24——递归练习
  • Spring Cloud(3) - 服务治理: Spring Cloud Eureka
  • Vue.js 移动端适配之 vw 解决方案
  • vue-loader 源码解析系列之 selector
  • win10下安装mysql5.7
  • 简析gRPC client 连接管理
  • 前端之React实战:创建跨平台的项目架构
  • 如何抓住下一波零售风口?看RPA玩转零售自动化
  • 微信开放平台全网发布【失败】的几点排查方法
  • 由插件封装引出的一丢丢思考
  • 怎么将电脑中的声音录制成WAV格式
  • 找一份好的前端工作,起点很重要
  • 走向全栈之MongoDB的使用
  • ​【原创】基于SSM的酒店预约管理系统(酒店管理系统毕业设计)
  • #每日一题合集#牛客JZ23-JZ33
  • $refs 、$nextTic、动态组件、name的使用
  • (2024)docker-compose实战 (8)部署LAMP项目(最终版)
  • (Redis使用系列) Springboot 使用redis实现接口Api限流 十
  • (附源码)ssm学生管理系统 毕业设计 141543
  • (含react-draggable库以及相关BUG如何解决)固定在左上方某盒子内(如按钮)添加可拖动功能,使用react hook语法实现
  • (三)mysql_MYSQL(三)
  • (四)stm32之通信协议
  • (五)IO流之ByteArrayInput/OutputStream
  • (一)基于IDEA的JAVA基础12
  • (转)机器学习的数学基础(1)--Dirichlet分布
  • (转)如何上传第三方jar包至Maven私服让maven项目可以使用第三方jar包
  • (转)项目管理杂谈-我所期望的新人
  • .NET 表达式计算:Expression Evaluator
  • .NET 应用架构指导 V2 学习笔记(一) 软件架构的关键原则
  • .NET中的Event与Delegates,从Publisher到Subscriber的衔接!
  • .py文件应该怎样打开?
  • @font-face 用字体画图标
  • [1127]图形打印 sdutOJ
  • [1525]字符统计2 (哈希)SDUT
  • [383] 赎金信 js
  • [52PJ] Java面向对象笔记(转自52 1510988116)
  • [ActionScript][AS3]小小笔记