Elasticsearch8.4.0集群安装(ELK安装part1)

一,环境准备

由于资源有限,使用VirtulBox虚拟机进行搭建。

搭建集群的环境配置:
本集群使用Red Hat Enterprise Linux release 8.2 (Ootpa)操作系统,1C CPU,4G Memory,大于50G的Disk。

集群安装规划如下:
机器地址     节点名称    节点角色    节点功能
192.168.88.5 node-1    Master,data    主+数据节点
192.168.88.7 node-2    Master,data    主+数据节点
192.168.88.9 node-3    Master,data    主+数据节点

下载安装包:
https://www.elastic.co/cn/elasticsearch/
​当前最新版本为 8.4.0

创建用户:
#groupadd es
#useradd -g es es -m

JDK选择:
在elasticsearch7以上的版本中会自带Open JDK,因此建议用自带的JDK,当然也可以单独安装自定义的JDK。

修改进程最大打开文件数数量为65536,每台都执行:
vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 65536

查看:
[root@goya ~]# ulimit -a
......
open files                      (-n) 65536
......

修改/etc/sysctl.conf文件,增加配置vm.max_map_count=262144
vi /etc/sysctl.conf
# 最后增加一行:
vm.max_map_count = 262144
# 退出执行
sysctl -p

二,软件安装

安装方式选择:
ES的安装方式有如下几种:(官方参考https://www.elastic.co/guide/en/elasticsearch/reference/8.4/install-elasticsearch.html)
1,压缩文件包
2,RPM命令的方式
3,Docker
本文选择第一种方式。

解压压缩包到软件目录:

上传文件elasticsearch-8.4.0-linux-x86_64.tar到/app/install目录
tar -xvf /app/install/elasticsearch-8.4.0-linux-x86_64.tar -C /opt
chown -R es.es elasticsearch

修改环境变量:

vi /etc/profile
# 做如下修改:
export JAVA_HOME=/app/elasticsearch/jdk
export ES_HOME=/app/elasticsearch
export PATH=$ES_HOME/bin:$ES_HOME/jdk/bin:$PATH

创建数据目录:
mkdir -p /data/elasticsearch
chown es.es  /data/elasticsearch

修改hosts文件:
vi /etc/hosts
192.168.88.5 goya1
192.168.88.7 goya2
192.168.88.9 goya3

三,配置ES

3.1 编辑ES配置文件
$ cp /app/elasticsearch/config/jvm.options /app/elasticsearch/config/jvm.options.bak
$ vi jvm.options
去掉下面这两行的注释,并且根据自己的机器配置更改jvm内存大小
## -Xms4g
## -Xmx4g

3.2 在第一台服务器节点goya1设置集群多节点通信密钥:
es用户下, cd /app/elasticsearch/bin
[es@goya bin]$ ./elasticsearch-certutil ca
证书密码:changeit123(也可以设置为你想要的任何密码)
[es@goya bin]$ ./elasticsearch-certutil cert --ca elastic-stack-ca.p12
证书密码:changeit123(也可以设置为你想要的任何密码)
elastic-stack-ca.p12 就是上一步生成的(默认就在当前目录中),此时在当前目录生成名为 elastic-certificates.p12 的文件,它是单个PKCS#12密钥存储库,其中包括节点证书、节点密钥和CA证书。默认情况下,elasticsearch-certutil 生成没有主机名信息的证书(也就是说,它们没有任何主题可选名称字段)。这意味着可以对集群中的每个节点使用此证书,但您必须关闭主机名验证。
将生成的证书文件移动到 config/certs 目录中
mkdir -p /app/elasticsearch/config/certs
mv /app/elasticsearch/elastic-stack-ca.p12 /app/elasticsearch/elastic-certificates.p12 /app/elasticsearch/config/certs

在第一台服务器节点goya1设置集群多节点 HTTP 证书
[es@goya bin]$ ./elasticsearch-certutil http
warning: ignoring JAVA_HOME=/app/elasticsearch/jdk; using bundled JDK

## Elasticsearch HTTP Certificate Utility

The 'http' command guides you through the process of generating certificates
for use on the HTTP (Rest) interface for Elasticsearch.

This tool will ask you a number of questions in order to generate the right
set of files for your needs.

## Do you wish to generate a Certificate Signing Request (CSR)?

A CSR is used when you want your certificate to be created by an

  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

yangkei

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值