安裝elasticsearch-head外掛
環境
centos7
elastichsearch-6.2.3
node v8.11.1
安裝elasticsearch
安裝elasticsearch請檢視:https://blog.csdn.net/mjlfto/article/details/79769152
安裝node
安裝elasticsearch-head外掛需要nodejs的支援,所以此處講解一下安裝nodejs步驟
1.到nodejs官網現在最新nodejs,官網下載地址:https://nodejs.org/en/download/
2. 解壓壓縮包
3.在/etc/profile中配置好path環境變數
4.執行node -v驗證安裝
[root@localhost elasticsearch-head]# node -v
v8.11.1
[root@localhost elasticsearch-head]#
下載elastichsearch-head外掛
1.地址:https://github.com/mobz/elasticsearch-head
2.安裝git :yum install git
3.clone elasticsearch-head: git clone https://github.com/mobz/elasticsearch-head.git
安裝elastichsearch-head外掛
到elasticsearch-head目錄下, 執行npm install 命令, 執行該命名可能會出現以下錯誤:
[root@localhost elasticsearch-head]# npm install
> phantomjs-prebuilt@2.1.16 install /home/a123/elasticsearch-6.2.3/plugins/elasticsearch-head/node_modules/phantomjs-prebuilt
> node install.js
sh: node: command not found
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! phantomjs-prebuilt@2.1.16 install: `node install.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the phantomjs-prebuilt@2.1.16 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-03-31T11_39_28_566Z-debug.log
此時忽略phantomjs-prebuilt@2.1.16,執行命令如下
[root@localhost elasticsearch-head]# npm install phantomjs-prebuilt@2.1.16 --ignore-scripts
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN elasticsearch-head@0.0.0 license should be a valid SPDX license expression
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
+ phantomjs-prebuilt@2.1.16
added 66 packages and removed 4 packages in 18.237s
[root@localhost elasticsearch-head]# ls
啟動elastichsearch-head
npm run start
驗證elasticsearch-head,在瀏覽器中輸入主機地址和埠
重啟elastichsearch
1.當重啟elasticsearch可能會出現以下錯誤, 這個是因為不能將elasticsearch-head放到plugins資料夾下
[a123@localhost bin]$ ./elasticsearch
Picked up _JAVA_OPTIONS: -Xms64m -Xmx64m -Xmn32m
Picked up _JAVA_OPTIONS: -Xms64m -Xmx64m -Xmn32m
Picked up _JAVA_OPTIONS: -Xms64m -Xmx64m -Xmn32m
[2018-03-31T20:25:19,776][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalArgumentException: property [elasticsearch.version] is missing for plugin [head]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-6.2.3.jar:6.2.3]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.3.jar:6.2.3]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.3.jar:6.2.3]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.3.jar:6.2.3]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.3.jar:6.2.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.3.jar:6.2.3]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.2.3.jar:6.2.3]
Caused by: java.lang.IllegalArgumentException: property [elasticsearch.version] is missing for plugin [head]
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:226) ~[elasticsearch-6.2.3.jar:6.2.3]
at org.elasticsearch.plugins.PluginInfo.readFromProperties(PluginInfo.java:184) ~[elasticsearch-6.2.3.jar:6.2.3]
at org.elasticsearch.bootstrap.Spawner.spawnNativePluginControllers(Spawner.java:75) ~[elasticsearch-6.2.3.jar:6.2.3]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167) ~[elasticsearch-6.2.3.jar:6.2.3]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.3.jar:6.2.3]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.3.jar:6.2.3]
... 6 more
2.當重啟伺服器之後發現依舊如上圖, 還是無法正常連線到elasticsearch服務,這是因為elasticsearch服務與elasticsearch-head之間可能存在跨越,修改elasticsearch配置即可,在elastichsearch.yml中新增如下命名即可:
#allow origin
http.cors.enabled: true
http.cors.allow-origin: "*"
重新連線如下:
相關文章
- Elasticsearch5中安裝Elasticsearch-head外掛ElasticsearchH5
- 如何安裝es + 如何安裝elasticsearch-head外掛 親測可用,附相關軟體連結。Elasticsearch
- Elasticsearch-head外掛使用小結Elasticsearch
- Redmine外掛的安裝與解除安裝,知識庫外掛安裝。
- retdec 外掛安裝
- Elasticsearch外掛安裝Elasticsearch
- VIM 外掛安裝
- flash外掛怎麼安裝 電腦安裝flash外掛步驟
- Elasticsearch精進之路:elasticsearch-head外掛使用教程Elasticsearch
- elasticsearch-head離線安裝Elasticsearch
- ATOM 安裝外掛
- 如何安裝 Vim 外掛
- ubuntu 常用外掛安裝Ubuntu
- php常用外掛安裝PHP
- Sublime安裝PlantUML外掛
- Sublime使用,安裝外掛
- Python 外掛安裝Python
- vim 外掛的安裝
- vim外掛的安裝
- VS Code外掛安裝
- jmeter下載安裝及外掛安裝JMeter
- 剛安裝的sublime如何安裝外掛
- Eclipse安裝lombok外掛及外掛使用案例EclipseLombok
- 安裝Maltego預設外掛Go
- 如何給Wordpress安裝外掛
- Sublime 安裝外掛不生效
- vim外掛 NERDTree安裝使用
- 安裝nginx-kafka外掛NginxKafka
- IDEA安裝Scala外掛Idea
- Elasticsearch-sql 外掛安裝ElasticsearchSQL
- ElasticSearch安裝Head外掛Elasticsearch
- eclipse marketplace外掛安裝Eclipse
- Eclipse 安裝Groovy外掛Eclipse
- cacti安裝thold外掛
- 安裝JSEclipse外掛JSEclipse
- postgresql和postgis外掛安裝SQL
- Eclipse外掛安裝(一)Eclipse
- Eclipse外掛的安裝Eclipse