記ElasticSearch安裝教程
一、 ES安裝
1、單實例安裝
ES官方網站下載最新版本ES,放到伺服器上並解壓。
安裝環境:
MAVEN,JDK1.8
2、啟動:
進入ES目錄下的bin目錄執行./elasticsearch 啟動服務。瀏覽器可以訪問ip:9200訪問,採用./elasticsearch -d 可後台執行。
3、啟動過程中可能遇到的問題:
問題一:
max file descriptors [4096] for elasticsearch process likely too low, increase to at least [65536]
max number of threads [1024] for user [lishang] likely too low, increase to at least [2048]
解決:切換到root用戶,編輯limits.conf 添加類似如下內容
vi /etc/security/limits.conf
添加如下內容:
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
問題二:
max number of threads [1024] for user [lish] likely too low, increase to at least [2048]
vi /etc/security/limits.d/90-nproc.conf
修改如下內容:
* soft nproc 1024
#修改為
* soft nproc 2048
二、ElaticSearch-head插件
1、最簡單:
直接Chorm應用市場安裝ElaticSearch-head插件,即可使用。
2、gitHub上下載安裝
需要環境:
①Node.js
安裝wgethttps://npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz
配置環境變數,編輯/etc/profile
exportNODE_HOME=/usr/local/nodejs/node-v4.4.7-linux-x64
exportPATH=$PATH:$NODE_HOME/bin
exportNODE_PATH=$NODE_HOME/lib/node_modules
②安裝grunt
grunt是基於Node.js的項目構建工具,可以進行打包壓縮、測試、執行等等工作,elasticsearch-head插件就是通過grunt啟動的。
進入/usr/local/fast/elasticsearch-head-master/目錄下進行安裝。安裝完畢,我們可以檢查是否安裝成功。
npm install -g grunt-cli 安裝
grunt -version 查看是否安裝-版本號
修改elasticsearch-head-master文件下的Gruntfile.js文件中,添加一行"hostname: "0.0.0.0","
在elasticsearch-head-master目錄下執行
npm install
然後執行 npm run start 可以看到服務在9100埠啟動或者grunt server& 可以後台執行
③我們還要修改elasticsearch.yml
#增加參數,使head插件可以訪問es
重新啟動es即可
TAG:Java矽谷 |