天天看點

elasticsearch安裝和使用

1、概述

本次安裝和使用的是es2.1 的版本

2、安裝

1)下載下傳與安裝

首先需要去官網位址: https://www.elastic.co/downloads/past-releases

elasticsearch安裝和使用

下載下傳好elasticsearch-2.1.0.tar.gz 後再解壓并且修改elasticseacher.yml 檔案

具體如下所示:

## 叢集名稱
cluster.name: es-ucc

## 設定是以的IP可以綁定
network.host: 0.0.0.0

# this is sovle elasticsearch scripts of type [inline], operation [update] and lang # [groovy] are disabled
script.inline: true 
script.indexed: true
           

修改完成後啟動, 背景啟動:

先進入bin目錄在執行下面的指令:

非root使用者 :./elasticsearch -d

root使用者 : ./elasticsearch -Des.insecure.allow.root=true -d

驗證是否啟動成功: ps aux | grep elasticsearch

3、注意

上面添加的配置是因為, 不配置在擷取資料會有問題。 這個是es2.x的bug