推薦使用以集成配置好的ES版本 node
https://github.com/medcl/elasticsearch-rtf python
本系列博文針對原生版本的安裝使用,配置,及插件安裝等 linux
1、下載,目前最新版本是2.2.0 git
下載地址:https://www.elastic.co/downloads/elasticsearch github
提供了四個類型的安裝包,選擇本身須要的,我下載的事tar類型 express
2、安裝 curl
一、首先要安裝jdk,官方建議用1.7及以上版本,先要確認jdk安裝成功,並配置好環境變量 elasticsearch
二、將下載後的文件 elasticsearch-2.2.0.tar 解壓到你想要的位置, 測試
此處注意:linux系統最好用非root用戶來操做 一會說明緣由 ui
三、解壓完成後能夠簡單進行作一些配置,配置文件位置在config目錄下
elasticsearch.yml 是 elasticsearch的配置文件
logging.yml 是 日誌文件的配置
修改 elasticsearch.yml 配置文件以下內容,默認是被#註釋掉的,去掉#便可
node.name:節點名稱(自定義)
path.data: /home/yang/elasticsearch-2.2.0/data 數據文件存放路徑(自定義)
path.logs: /home/yang/elasticsearch-2.2.0/logs 日誌文件存放路徑(自定義)
四、啓動
運行bin目錄下的elasticsearch 便可
運行後顯示以下提示信息
[yang@localhost elasticsearch-2.2.0]$ ./bin/elasticsearch [2016-02-20 05:56:51,419][INFO ][node ] [node-1] version[2.2.0], pid[2666], build[8ff36d1/2016-01-27T13:32:39Z] [2016-02-20 05:56:51,421][INFO ][node ] [node-1] initializing ... [2016-02-20 05:56:54,734][INFO ][plugins ] [node-1] modules [lang-expression, lang-groovy], plugins [], sites [] [2016-02-20 05:56:54,886][INFO ][env ] [node-1] using [1] data paths, mounts [[/ (rootfs)]], net usable_space [16gb], net total_space [17.4gb], spins? [unknown], types [rootfs] [2016-02-20 05:56:54,886][INFO ][env ] [node-1] heap size [1015.6mb], compressed ordinary object pointers [true] [2016-02-20 05:57:04,513][INFO ][node ] [node-1] initialized [2016-02-20 05:57:04,514][INFO ][node ] [node-1] starting ... [2016-02-20 05:57:04,765][INFO ][transport ] [node-1] publish_address {127.0.0.1:9300}, bound_addresses {[::1]:9300}, {127.0.0.1:9300} [2016-02-20 05:57:04,812][INFO ][discovery ] [node-1] elasticsearch/KCweQyr1T2yIfCk2V1VoRw [2016-02-20 05:57:08,273][INFO ][cluster.service ] [node-1] new_master {node-1}{KCweQyr1T2yIfCk2V1VoRw}{127.0.0.1}{127.0.0.1:9300}, reason: zen-disco-join(elected_as_master, [0] joins received) [2016-02-20 05:57:08,432][INFO ][http ] [node-1] publish_address {127.0.0.1:9200}, bound_addresses {[::1]:9200}, {127.0.0.1:9200} [2016-02-20 05:57:08,433][INFO ][node ] [node-1] started [2016-02-20 05:57:08,476][INFO ][gateway ] [node-1] recovered [0] indices into cluster_state
[root@localhost elasticsearch-2.2.0]# curl -X get http://localhost:9200 { "name" : "node-1", "cluster_name" : "elasticsearch", "version" : { "number" : "2.2.0", "build_hash" : "8ff36d139e16f8720f2947ef62c8167a888992fe", "build_timestamp" : "2016-01-27T13:32:39Z", "build_snapshot" : false, "lucene_version" : "5.4.1" }, "tagline" : "You Know, for Search" }
注意:
運行elasticsearch 不能使用root用戶;
若是用其餘用戶須要有相關文件的權限,如bin,logs,data文件夾的權限
這也是以前爲何說下載後解壓安裝等操做盡可能不要用root用戶來作的緣由,
由於用root用戶可能須要你對執行elasticsearch 的用戶的權限進行受權
以上爲我的在安裝使用中的一些淺顯的認識,若是不足之處忘指正