环境准备:JDk是1.8以上版本
1、官方下载Elasticsearch部署安装
访问官网,进入主页下载。
2、在下载页面,可以看到选择操作系统,选择系统后点击下载。(我这里下载的Windows版本)
3下载完成后,解压文件,找到下载位置
4、配置环境变量
# 换个集群的名字,免得跟别人的集群混在一起
cluster.name: el-m
# 换个节点名字
node.name: el_node_m1
# 修改一下ES的监听地址,这样别的机器也可以访问
network.host: 0.0.0.0
#设置对外服务的http端口,默认为9200
http.port: 9200
#设置索引数据的存储路径
path.data: E:\elasticsearch-8.1.2\data #换成自己的路径
#设置日志文件的存储路径
path.logs: E:\elasticsearch-8.1.2\logs #换成自己的路径
# 关闭http访问限制
xpack.security.enabled: false
# 增加新的参数,head插件可以访问es
http.cors.enabled: true
http.cors.allow-origin: "*"
#----------------------- BEGIN SECURITY AUTO CONFIGURATION -----------------------
# Enable security features
#xpack.security.enabled: false
xpack.security.enrollment.enabled: true
# Enable encryption for HTTP API client connections, such as Kibana, Logstash, and Agents
xpack.security.http.ssl:
enabled: false
keystore.path: certs/http.p12
# Enable encryption and mutual authentication between cluster nodes
xpack.security.transport.ssl:
enabled: true
verification_mode: certificate
keystore.path: certs/transport.p12
truststore.path: certs/transport.p12
# Create a new cluster with the current node only
# Additional nodes can still join the cluster later
cluster.initial_master_nodes: ["el_node_m1"] #注意,这个要与node.name填写一致
#----------------------- END SECURITY AUTO CONFIGURATION -------------------------
123456789101112131415161718192021222324252627282930313233343536373839404142434445
6、启动服务,
cmd打开窗口,在命令行中cd进入路径
cd /d E:\elasticsearch-8.1.2\bin
1
进入到bin路径下后输入:elasticsearch.bat
看到starting则启动成功
注:若未启动成功,可参考《win10安装elasticSearch8.1.2,报错解决方案》
浏览器访问网址:http://localhost:9200/,显示如下。