ElasticSearch和Head插件安装

1、ElasticSearch可以直接在官网下载最新版:

https://www.elastic.co/cn/downloads/

2、ElasticSearch-Head不能下载太高版本的,对于Elasticsearch 5.x,6.x和7.x:不支持插件

在这里提供我的下载地址:https://github.com/BFFat/elasticsearch-head

3、安装Node.js

因为head是一个Node.js项目,所以先要下载node.js。

在node.js官网就可以下载自己想要的版本,安装步骤一直点next即可

4、安装grunt

因为运行head需要借助grunt命令,所以需要安装grunt。进入Node.js目录下,执行命令npm install -g grunt-cli

5、修改ElasticSearch的配置文件

进入config文件夹下找到elasticsearch.yml

# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
#       Before you set out to tweak and tune the configuration, make sure you
#       understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
#
cluster.name: smallpang
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
#
node.name: master
#
# Add custom attributes to the node:
#
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
#
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 0.0.0.0
#
# Set a custom port for HTTP:
#
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when new node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
#discovery.zen.ping.unicast.hosts: ["host1", "host2"]
#
# Prevent the "split brain" by configuring the majority of nodes (total number of master-eligible nodes / 2 + 1):
#
#discovery.zen.minimum_master_nodes: 
#
# For more information, consult the zen discovery module documentation.
#
# ---------------------------------- Gateway -----------------------------------
#
# Block initial recovery after a full cluster restart until N nodes are started:
#
#gateway.recover_after_nodes: 3
#
# For more information, consult the gateway module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true
http.cors.enabled: true 
http.cors.allow-origin: "*"
node.master: true
node.data: true

这个文件我当时一开始不可以,还来修改了之后还是不行,后来又换回来就可以了。

这种踩坑bug还不懂原因是什么,碰到这种问题的小朋友,直接重新创建一个elasticsearch.yml就好了。

6、启动ElasticSearch

进入bin文件夹启动elasticsearch.bat

7、在浏览器上输入localhost:9200

如果有显示信息就都当做是成功

8、启动ElasticSearch-Head

进到ElasticSearch-Head目录底下按住shift+鼠标右键可以打开powershell窗口

在窗口里面输入grunt server命令

即可启动ElasticSearch-Head

9、在浏览器上输入localhost:9100

如果集群健康值为:green或者是yellow就算是成功

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值