elasticsearch 安裝


因為裝的JDK 是1.7. elasticsearch 版本0.9,1.3-2.4 ,1.3支持JDK1.7,1.3以上的都支持1.8了。所以下載安裝的是es 1.3版本;

 

下載 curl -L -O https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.3.9.tar.gz
解壓 tar -xvf elasticsearch-1.3.9.tar.gz
啟動 cd elasticsearch-1.3.9/bin ./elasticsearch
官網原話:

If everything goes well, you should see a bunch of messages that look like below:

./elasticsearch [2014-03-13 13:42:17,218][INFO ][node ] [New Goblin] version[1.3.9], pid[2085], build[5c03844/2014-02-25T15:52:53Z] [2014-03-13 13:42:17,219][INFO ][node ] [New Goblin] initializing ... [2014-03-13 13:42:17,223][INFO ][plugins ] [New Goblin] loaded [], sites [] [2014-03-13 13:42:19,831][INFO ][node ] [New Goblin] initialized [2014-03-13 13:42:19,832][INFO ][node ] [New Goblin] starting ... [2014-03-13 13:42:19,958][INFO ][transport ] [New Goblin] bound_address {inet[/0:0:0:0:0:0:0:0:9300]}, publish_address {inet[/192.168.8.112:9300]} [2014-03-13 13:42:23,030][INFO ][cluster.service] [New Goblin] new_master [New Goblin][rWMtGj3dQouz2r6ZFL9v4g][mwubuntu1][inet[/192.168.8.112:9300]], reason: zen-disco-join (elected_as_master) [2014-03-13 13:42:23,100][INFO ][discovery ] [New Goblin] elasticsearch/rWMtGj3dQouz2r6ZFL9v4g [2014-03-13 13:42:23,125][INFO ][http ] [New Goblin] bound_address {inet[/0:0:0:0:0:0:0:0:9200]}, publish_address {inet[/192.168.8.112:9200]} [2014-03-13 13:42:23,629][INFO ][gateway ] [New Goblin] recovered [1] indices into cluster_state [2014-03-13 13:42:23,630][INFO ][node ] [New Goblin] started啟動的時候 如果 端口9200被占用,es會默認啟用9201端口.這種方式啟動es,退出只需要 ctrl+C 即可。現有插件:

  1. elasticsearch 作為一個系統service應用 ,可以安裝elasticsearch-servicewrapper插件。

https://github.com/elasticsearch/elasticsearch-servicewrapper下載該插件后,解壓縮。將service目錄拷貝到elasticsearch目錄的bin目錄下。運行這個插件的好處是:elasticsearch需要的jvm參數和其它配置都已經配置好了,非常方便。

 安裝完啟動  cd bin/service                    sh elasticsearch start 即可 屬於 后台啟動。 官網命令如下:

 

Parameter Description
console Run the elasticsearch in the foreground.
start Run elasticsearch in the background.
stop Stops elasticsearch if its running.
install Install elasticsearch to run on system startup (init.d / service).
remove Removes elasticsearch from system startup (init.d / service).

2. 安裝es-head插件

進入elasticsearch/bin目錄,輸入命令./plugin –install mobz/elasticsearch-head 安裝head插件。 安裝成功以后 在瀏覽器中輸入http://localhost:9200http://localhost:9200/_plugin/head/如下圖所示則ES啟動成功。

 



 


免責聲明!

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



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