一. Windows安裝Elastic Search和Head外掛程式

來源:互聯網
上載者:User

標籤:elastics   nodejs   跨域   cors   mob   star   hub   tar   local   

一.安裝包下載

  • Node: https://nodejs.org/en/download/

  • ES: https://www.elastic.co/downloads/elasticsearch

  • Head: https://github.com/mobz/elasticsearch-head


二.安裝Node

    安裝Node是為了後續安裝Head外掛程式,Node安裝比較簡單,需要配置環境變數


三.安裝ES

    1.將ES安裝包解壓到指定目錄

    2.修改config下的elasticsearch.yml

    注意:在elasticsearch.yml中必須加入http.cors.enabled: true和http.cors.allow-origin: "*",不然Head串連不上ES,請求跨域問題


四.安裝Head外掛程式

    1.將Head外掛程式解壓後放到ES跟目錄下,5.x之前版本放在plugin下

    2.修改_site/app.js

    this.prefs = services.Preferences.instance();
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
if( this.base_uri.charAt( this.base_uri.length - 1 ) !== "/" ) {
// XHR request fails if the URL is not ending with a "/"
this.base_uri += "/";
    }


    3.修改Gruntfile.js

    connect: {
server: {
    options: {
port: 9100,
hostname: '*',
base: '.',
keepalive: true
}
}
}

    4.執行命令

    進入到head根目錄

    npm install

    npm run start

五.測試

    1.先npm run start啟動Head:127.0.0.1:9100

    2.在直接運行elasticsearch.bat啟動ES: 127.0.0.1:9200


一. Windows安裝Elastic Search和Head外掛程式

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.