安裝JDK1.8(包括)以上版本
安裝ElasticSearch
ElasticSearch下載地址:
https://www.elastic.co/downloads/elasticsearch
雙擊elasticsearch.bat
http://localhost:9200
以windows服務啟動
dos窗口cd到es安裝目錄中執行elasticsearch-service.bat install
查看任務管理器,找到elastcisearch右擊選中開始,就能把服務啟動了
配置后台自動啟動
可以看到是自動的,點擊屬性
如果想要卸載此服務,運行如下命令
elasticsearch-service.bat remove
安裝Grunt
下載NodeJS
下載地址:
https://nodejs.org/en/download/
安裝NodeJS
下載完直接安裝,一直確定
安裝完成后配置環境變量
高級系統設置->高級->環境變量->編輯PATH
檢驗是否安裝成功:node -v
安裝grunt命令
安裝ElasticSearch-Head
下載ElasticSearch-Head
下載地址:https://github.com/mobz/elasticsearch-head
解壓
安裝pathomjs
進入head文件夾下,執行命令:npm install 進行安裝pathomjs
如果安裝失敗:設置成淘寶的鏡像重新安裝
npm config set registry https://registry.npm.taobao.org
啟動Head插件
在剛才的文件夾下啟動:grunt server
有時候會出現啟動報錯:
Gruntfile.js中引用的,分別執行下列安裝命令
npm install grunt-contrib-clean
npm install grunt-contrib-concat
npm install grunt-contrib-watch
npm install grunt-contrib-connect
npm install grunt-contrib-copy
npm install grunt-contrib-jasmine
然后再執行啟動命令:grunt server
修改elasticsearch.yml配置文件
打開elasticsearch安裝目錄/config/elasticsearch.yml,添加如下兩行
http.cors.enabled: true http.cors.allow-origin: "*"
然后訪問:http://localhost:9100/