Elasticsearch7.17.5安装配置

文章目录

目录

文章目录

一、安装包官网下载地址

二、安装部署

1.环境准备

分发文件

修改/etc/sysctl.conf

支持https,则需要ssl环境

上传原生包至安装目录下

解压

elasticsearch.yml配置

服务启动

设置加密密码

生成证书

生成p12证书elastic-stack-ca.p12文件

生成证书和私钥elastic-certificates.p12文件

给证书赋权

移动证书到config文件夹下

修改elasticsearch.yml配置

浏览器访问

用户密码修改

总结

一、安装包官网下载地址

https://www.elastic.co/cn/downloads/past-releases#elasticsearch

二、安装部署

1.环境准备

分发文件

修改/etc/security/limits.conf

soft指的是当前系统生效的设置值,软限制也可以理解为警告值。

hard表明系统中所能设定的最大值。soft的限制不能比hard限制高。

在文件尾部添加

*                soft    nofile          65536

*                hard    nofile          65536

 

修改/etc/sysctl.conf

max_map_count文件包含限制一个进程可以拥有的VMA(虚拟内存区域)的数量

在文件中增加下面内容:vm.max_map_count=655360

支持https,则需要ssl环境

2.上传原生包至安装目录下

3.解压

tar -zxvf elasticsearch-7.17.5-linux-x86_64.tar.gz

4.elasticsearch.yml配置

5.服务启动

在bin目录下执行 ./elasticsearch -d

6.设置加密密码

在bin目录下执行 ./elasticsearch-setup-passwords interactive

依次设置以下密码

7.生成证书

生成p12证书elastic-stack-ca.p12文件

在bin目录下执行  ./elasticsearch-certutil ca

#1、文件名:  Please enter the desired output file [elastic-stack-ca.p12]: (不填写,直接回车)

#2、密码  :  Enter password for elastic-stack-ca.p12 : (不填写,直接回车)

生成证书和私钥elastic-certificates.p12文件

   在bin目录下执行  ./elasticsearch-certutil cert --ca elastic-stack-ca.p12

#1、CA密码 : Enter password for CA (elastic-stack-ca.p12) : (不填写,直接回车)

#2、文件名:  Please enter the desired output file [elastic-certificates.p12]: (不填写,直接回车)

#3、密码  :  Enter password for elastic-certificates.p12 : (不填写,直接回车)

给证书赋权

此时生成的证书目录是在/elasticsearch-7.17.5目录下

chmod 777 elastic-certificates.p12

chmod 777 elastic-stack-ca.p12

移动证书到config文件夹下

mv elastic-certificates.p12 config/elastic-certificates.p12

mv elastic-stack-ca.p12 config/elastic-stack-ca.p12

修改elasticsearch.yml配置

注释:

需要开启https时

修改xpack.security.enabled: true

修改xpack.security.http.ssl.enabled: true

否则设置为false

访问需要用户名密码时

修改xpack.security.enabled: true

修改xpack.security.transport.ssl.enabled: true

否则设置为false

8.浏览器访问

URL:https://127.0.0.1:9200/

展示如下即为部署成功

9.用户密码修改

比如修改kibana_system用户的密码   -- https请求免认证(-kv -X POST -k --tlsv1)

curl -kv -X POST -k --tlsv1 -H "Content-Type:application/json" -XPOST -u elastic 'https://127.0.0.1:9200/_xpack/security/user/kibana_system/_password' -d ' { "password" : "123456" }'

提示输入用户名为elastic的密码,准确输入后执行


总结

本文仅仅简单介绍了Elasticsearch7.17.5的安装配置,后面再介绍下Elasticsearch可视化界面如何操作,欢迎各位大佬指教。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值