一、JDK安裝配置 這里就不說了
二,安裝ElasticSearch
在安裝Java JDK,配置JAVA_HOME環境變量之后,就可以安裝Elasticsearch全文搜索引擎了,首先需要下載特定版本的ES安裝文件。
1,下載ElasticSearch
從官方下載中心 ElasticSearch Download 下載ElasticSearch安裝包,在樓主截圖時,ES的最新版本是7.0.1。
2,開啟ElasticSearch 服務
將zip文件解壓到C盤,進入 C:\elasticsearch-7.0.1\bin 目錄,雙擊執行 elasticsearch.bat,該腳本文件執行 ElasticSearch 安裝程序,稍等片刻,打開瀏覽器,輸入 http://localhost:9200 ,顯式以下畫面,說明ES安裝成
三、安裝ElasticSearch管理插件
安裝Head插件需要nodejs和grunt:
(1)nodejs安裝:nodejs官網下載,安裝版本與系統保持一致,這里選64位的window的msi安裝版本,安裝過程中只選擇安裝路徑即可。安裝完成后,使用node -v命令查看是否安裝成功。
(2)grunt安裝
cmd到nodejs根目錄下,輸入指令:npm install -g grunt-cli ,等待安裝完成。
(3)Head配置
下載Head配置插件:https://github.com/mobz/elasticsearch-head,解壓到Es的安裝根目錄下,比如D:\elasticsearch-6.3.0\elasticsearch-head。
1)修改elasticsearch-head中的文件Gruntfile.js,添加
2)修改ElasticSearch的配置文件elasticsearch.yml
a、在文件的最后添加如下配置:
http.cors.enabled: true
http.cors.allow-origin: "*"
node.master: true
node.data: true
b、開啟如下配置:
去除文件中本來就有的幾個注釋如下:
cluster.name: my-application #集群的名字
node.name: node-1 #節點名字
network.host: 0.0.0.0 #ES的監聽地址
http.port: 9200 #端口號,默認就好
3)npm安裝
cmd到elasticsearch-head目錄輸入命令npm install,若安裝報各種關於package.json的解析錯誤,使用'npm cache clean --force'命令清除緩存再安裝。接着輸入grunt server 啟動nodejs,出現下面的提示,就啟動成功。
在瀏覽器中輸入http://localhost:9100/,出現如下界面:
進入 Spring boot 整合 ElasticSearch