Windows安装Elasticsearch并安装elasticsearch-head 插件

安装前准备

jdk(版本不要低于1.8) :https://www.oracle.com/technetwork/java/javase/downloads/index.html.
Elasticsearch: https://www.elastic.co/downloads/elasticsearch.
elasticsearch-head : https://github.com/mobz/elasticsearch-head.
Node.js : https://nodejs.org/en/download/.
Node.js 没有安装可以参考:https://blog.csdn.net/Keith003/article/details/84792287

安装Elasticsearch

  1. 将下载后压缩包解压
  2. 打开bin 目录下elasticsearch.bat
  3. 检测是否安装成功 进入 http://localhost:9200/.
    在这里插入图片描述
  4. 打开 config/elasticsearch.yml
  5. 末尾添加(Elasticsearch 默认是不跨域的 所以需要设置跨域)
# 如果启用了 HTTP 端口,那么此属性会指定是否允许跨源 REST 请求。
http.cors.enabled: true
# 如果 http.cors.enabled 的值为 true,那么该属性会指定允许 REST 请求来自何处。
http.cors.allowed.origin: "*"
# 更多参数可以参考 (https://www.ibm.com/support/knowledgecenter/zh/SSFPJS_8.5.6/com.ibm.wbpm.main.doc/topics/rfps_esearch_configoptions.html)

安装elasticsearch-head

  1. 进入elasticsearch-head 解压目录
  2. 使用 npn install 将该目录下的相关文件解压并安装
  3. 执行 npm run start 启动
  4. 访问:http://localhost:9100/在这里插入图片描述

注:

  1. 如果设置其他机器可以访问 可以设置
     network.host: 0.0.0.0
    
  2. network.host 表示只允许指定的IP访问本机elasticsearch服务。因为有些时候本机可能会绑定多个IP地址,例如:本机可以同时绑定192.168.0.1; 192.168.0.2; 以及127.0.0.1环回地址这些,但是我们又想控制服务只能被192.168.0.2访问到,则可以通过这种方式进行配置限定。如果想本机绑定的所有IP都可访问此服务,则可将network.host设置为0.0.0.0。
  3. 如果配置后报如下错误
    [4]: the default discovery settings are unsuitable for production use; at least one of [discovery.seed_hosts, discovery.seed_providers, cluster.initial_master_nodes] must be configured
    
  4. 需要在 conf/elasticsearch.yml 配置
    cluster.initial_master_nodes: ["node-1"]
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值