Elasticsearch外掛程式head的安裝(有坑)__elasticsearch

來源:互聯網
上載者:User

Elasticsearch出了5.2.1版本之後,就去試試它的新版本的使用,為了以後的升級進行測試。

很遺憾的時候,在安裝的過程中就遇到了一個坑,就是elasticsearch-head外掛程式在安裝x-pack外掛程式之後就無法使用,原因是因為elastic公司在x-pack中加入了安全模組(security機制),就會出現下面的情況,如圖:

這個時候需要在elasticseach.yml中增加下面幾行配置即可解決。

http.cors.enabled: true
http.cors.allow-origin:’*’
http.cors.allow-headers: “Authorization”

然後在每次使用head外掛程式的時候,按照如下的格式輸入:

http://localhost:9100/?auth_user=elastic&auth_password=changeme”

其中elastic是預設帳號,changeme是初始密碼,均可以在x-pack外掛程式中進行修改。

然後就能正常使用head外掛程式了:

如果重啟elasticsearch之後出現如下錯誤:

Exception in thread "main" SettingsException[Failed to load settings from [elasticsearch.yml]]; nested: ElasticsearchParseException[malformed, expected settings to start with 'object', instead was [VALUE_STRING]];

意思是參數的冒號前後沒有加空格,加了之後就好,我找了好久這個問題

這個時候請不要在伺服器上VIM檢查這個設定檔,而是把檔案下載到本地,用編輯工具如atom來對比官方原版的設定檔。這個問題坑了好久。

參考地址:https://github.com/mobz/elasticsearch-head#url-parameters

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.