如果不是相同的版本会报错,页面会显示main问题
下载地址如下
Download X-Pack: Extend Elasticsearch and Kibana | Elastic


记住x-pack插件无需解压
cd /opt/elk/elasticsearch-6.2.0
安装插件
./bin/elasticsearch-plugin install file:/opt/elk/x-pack-6.2.0.zip
接下来中途会要你选择y即可。
编辑 config/ elasticsearch.yml文件
添加如下配置开启密码
xpack.security.enabled:true
查询之前启动的elastic
ps -ef | grep elastic
杀掉进程
kill -9 进程号
重启elstic
sh elasticsearch -d
curl -XPUT -u elastic:changeme 'http://localhost:9200/_xpack/security/user/elastic/_password' -d '{ "password" : "xxxxx" }'