【ES】windows下安装ElasticSearch的Head插件
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了【ES】windows下安装ElasticSearch的Head插件,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含4507字,纯文字阅读大概需要7分钟。
内容图文
![【ES】windows下安装ElasticSearch的Head插件](/upload/InfoBanner/zyjiaocheng/940/a44cc8f0764f40df96188a3fa413d338.jpg)
?
ElasticSearch官方的模拟工具是控制台的curl,不是很直观,可以在chrome浏览器中安装head插件来作为请求的工具:head插件
上节已经阐述了curl的一些基本操作
详情可以点击查看:
2: CURL在windows中对ElasticSearch的一些简单的操作
ES5以上的版本安装head需要安装node和grunt
首先我们来安装node
下载地址:
https://nodejs.org/en/download/
下载相应系统的msi,双击安装
?
我选择的安装目录为:
D:\Program Files\ES
下面的所有的操作全部以这个目录为例。
下载完成后解压到文件夹
?
完成后用cmd进入安装目录 可以执行node -v 查看版本号以及是否安装成功
?
?
执行 npm install -g grunt-cli 安装grunt
?
安装成功后:
?
在cmd输入执行grunt -version 会显示版本号:
?
现在开始安装head
1:进入安装目录下的config目录,修改elasticsearch.yml文件.在文件的末尾加入以下代码
http.cors.enabled: true http.cors.allow-origin: "*" node.master: true node.data: true
elasticsearch.yml文件配置:
去掉network.host: 192.168.0.1的注释并改为network.host: 0.0.0.0,去掉cluster.name;node.name;http.port的注释(也就是去掉#)
# ======================== 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: my-application # # ------------------------------------ Node ------------------------------------ # # Use a descriptive name for the node: # node.name: node-1 # # 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
双击elasticsearch.bat重启es
2:下载head插件,选择下载zip
https://github.com/mobz/elasticsearch-head
?
3:解压到指定文件夹下,D:\Program Files\ES\elasticsearch-head-master 进入该文件夹,修改D:\Program Files\ES\elasticsearch-head-master\Gruntfile.js 在对应的位置加上hostname:'*'
?
?
4:在D:\Program Files\ES\elasticsearch-head-master 下执行npm install 安装
?
如下失败请重新检查配置,重新安装:
?
成功如下图:
?
完成后执行grunt server 或者npm run start 运行head插件
?
浏览器下访问http://localhost:9100/
?
欢迎关注摘星族,我们不仅仅是代码的搬运工,同时也是技术的分享者
?
内容总结
以上是互联网集市为您收集整理的【ES】windows下安装ElasticSearch的Head插件全部内容,希望文章能够帮你解决【ES】windows下安装ElasticSearch的Head插件所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。