ElasticSearch 5.0及head插件安裝

1、elasticsearch安裝配置node

1.官網下載源碼包git

https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.0.0.tar.gzgithub

2.解壓安裝npm

useradd elasticsearch瀏覽器

tar xf elasticsearch-5.0.0.tar.gz -C /usr/localcors

cd /usr/localelasticsearch

ln -sv elasticsearch-5.0.0 elasticsearchgrunt

mkdir -pv /data/elasticsearch/{data,logs}ui

chown -R elasticsearch.elasticsearch /data/elasticsearchspa

3.修改配置文件

cat /usr/local/elasticsearch/config/elasticsearch.yml

path.data:/data/elasticsearch/data

path.logs:/data/elasticsearch/logs

network.host:192.168.1.12

http.cors.enabled:true

http.cors.allow-origin:"*"


4.修改系統參數

cat /etc/security/limits.conf

*              soft    nproc          65536

*              hard    nproc          65536

*              soft    nofile          65536

*              hard    nofile          65536

cat /etc/sysctl.conf

vm.max_map_count= 262144

sysctl -p

5.啓動服務

su - elasticsearch -c "/usr/local/elasticsearch/bin/elasticsearch &"

瀏覽器訪問:http://192.168.1.12:9200/

2、head插件的安裝

在5.0版本中不支持直接安裝head插件,須要啓動一個服務

1.下載插件安裝

git clone git://github.com/mobz/elasticsearch-head.git

cd elasticsearch-head

npm install

在elasticsearch-head目錄下node_modules/grunt下若是沒有grunt二進制程序,須要執行

cd elasticsearch-head

npm install grunt --save

2.修改配置

修改elasticsearch-head下Gruntfile.js文件,默認監聽在127.0.0.1下9200端口

3.啓動服務

/usr/local/elasticsearch-head/node_modules/grunt/bin/grunt server

瀏覽器訪問 http://192.168.1.12:9100/

錯誤:

const escapeStringRegexp = require('escape-string-regexp');

解決:1 在項目根目錄下 npm install --save escape-string-regexp

    2 刪除你項目的/node_module,而後從新執行npm install

相關文章
相關標籤/搜索