Elasticsearch搭建与配置密码

下载ES

官网地址:https://www.elastic.co/cn/downloads/

解压部署ES(这里使用7.4)

tar -zxvf elasticsearch-7.4.0-linux-x86_64.tar.gz
vim  elasticsearch/config/elasticsearch.yml

image-1-pwby.pngimage-1-hnpw.png配置密码

#配置密码需要在最下面添加

xpack.security.enabled: true
xpack.license.self_generated.type: basic
xpack.security.transport.ssl.enabled: true

#启动ES
./bin/elasticsearch -d

#配置密码
./bin/elasticsearch-setup-passwords interactive
如果出现红色字体报错需更改:

vim  elasticsearch/config/elasticsearch.yml

#注释
discovery.seed_hosts
cluster.initial_master_nodes. 

添加
discovery.type: single-node