Mac安裝Elasticsearch時提示:No Java runtime present, requesting install.


沒有安裝java的童鞋可以先去安裝一下,地址:https://www.java.com/zh_CN/

安裝之后還是提示如下錯誤:

1 ➜  elasticsearch-2.4.3 bin/elasticsearch 2 No Java runtime present, requesting install. 3 ➜  elasticsearch-2.4.3 java -version 4 No Java runtime present, requesting install.

執行如下解決方案:

 1 # 首先 cd elasticsearch-2.4.3(此處是指進入你下載並解壓后的elasticsearch文件)
 2 ➜  Downloads cd elasticsearch-2.4.3 
 3 ➜  elasticsearch-2.4.3 
 4 ➜  elasticsearch-2.4.3 vim .bash_profile  5 # 在文件中添加如下兩句:
 6 # export JAVA_HOME="/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home"
 7 # export PATH=${JAVA_HOME}/bin:$PATH
 8 ➜  elasticsearch-2.4.3 source .bash_profile  9 ➜  elasticsearch-2.4.3 java -version 10 java version "1.8.0_151"
11 Java(TM) SE Runtime Environment (build 1.8.0_151-b12) 12 Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)

至此,該問題解決。

繼續執行2步,即可驗證Elasticsearch是否安裝成功:

  第1步:運行elasticsearch文件,如下:

 1 ➜  elasticsearch-2.4.3 bin/elasticsearch  2 [2017-11-27 14:10:49,539][INFO ][node                     ] [Googam] version[2.4.3], pid[18853], build[d38a34e/2016-12-07T16:28:56Z]  3 [2017-11-27 14:10:49,539][INFO ][node ] [Googam] initializing ...  4 [2017-11-27 14:10:50,102][INFO ][plugins                  ] [Googam] modules [reindex, lang-expression, lang-groovy], plugins [], sites []  5 [2017-11-27 14:10:50,132][INFO ][env                      ] [Googam] using [1] data paths, mounts [[/ (/dev/disk1)]], net usable_space [185.6gb], net total_space [232.5gb], spins? [unknown], types [hfs]  6 [2017-11-27 14:10:50,132][INFO ][env                      ] [Googam] heap size [990.7mb], compressed ordinary object pointers [true]  7 [2017-11-27 14:10:50,133][WARN ][env                      ] [Googam] max file descriptors [10240] for elasticsearch process likely too low, consider increasing to at least [65536]  8 [2017-11-27 14:10:51,924][INFO ][node ] [Googam] initialized  9 [2017-11-27 14:10:51,924][INFO ][node ] [Googam] starting ... 10 [2017-11-27 14:10:51,989][INFO ][transport                ] [Googam] publish_address {127.0.0.1:9300}, bound_addresses {[fe80::1]:9300}, {[::1]:9300}, {127.0.0.1:9300} 11 [2017-11-27 14:10:51,993][INFO ][discovery                ] [Googam] elasticsearch/TxOmRFiySBWHhJAAr8N59g 12 [2017-11-27 14:10:55,026][INFO ][cluster.service          ] [Googam] new_master {Googam}{TxOmRFiySBWHhJAAr8N59g}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received) 13 [2017-11-27 14:10:55,039][INFO ][http                     ] [Googam] publish_address {127.0.0.1:9200}, bound_addresses {[fe80::1]:9200}, {[::1]:9200}, {127.0.0.1:9200} 14 [2017-11-27 14:10:55,039][INFO ][node ] [Googam] started 15 [2017-11-27 14:10:55,060][INFO ][gateway                  ] [Googam] recovered [0] indices into cluster_state

  第2步:打開瀏覽器訪問:http://localhost:9200/,看到如下json結果集,表明安裝成功:

{ "name" : "Googam", "cluster_name" : "elasticsearch", "cluster_uuid" : "lqQ7DANKR3C3skh1JKJBdA", "version" : { "number" : "2.4.3", "build_hash" : "d38a34e7b75af4e17ead16f156feffa432b22be3", "build_timestamp" : "2016-12-07T16:28:56Z", "build_snapshot" : false, "lucene_version" : "5.5.2" }, "tagline" : "You Know, for Search" }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM