安装ES

下载
jdk-8u161-linux-x64.rpm
elasticsearch-6.2.3.zip
node-v8.10.0-linux-x64.tar.xz
elasticsearch-head-master.zip

安装JDK
rpm -ivh jdk-8u161-linux-x64.rpm

安装ES
yum -y install unzip
unzip elasticsearch-6.2.3.zip
cd elasticsearch-6.2.3/bin
./elasticsearch
curl 127.0.0.1:9200
cd elasticsearch-6.2.3/config
vi elasticsearch.yml
配置network.host: 0.0.0.0
配置discovery.zen.ping.unicast.hosts: ["0.0.0.0"]
vi /etc/security/limits.conf
添加四行
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
重启系统
ulimit -n
vi /etc/sysctl.conf
添加一行
vm.max_map_count=655360
sysctl -p
关闭防火墙
systemctl stop firewalld.service
systemctl disable firewalld.service
firewall-cmd --state

安装head
unzip elasticsearch-head-master.zip
mv elasticsearch-head-master head

安装Node.js
tar -Jxv -f node-v8.10.0-linux-x64.tar.xz
mv node-v8.10.0-linux-x64 node
ln -s /home/liunancun/node/bin/node /usr/local/bin/node
ln -s /home/liunancun/node/bin/npm /usr/local/bin/npm
node -v
npm -v

安装Grunt

配置head
vi Gruntfile.js
connect > server > options下面增加hostname: '*',
vi elasticsearch.yml
添加两行
http.cors.enabled: true
http.cors.allow-origin: "*"

安装smartcn分词
进入elasticsearch的bin目录
./elasticsearch-plugin install analysis-smartcn
POST http://192.168.1.111:9200/_analyze/
{"analyzer":"standard","text":"我是中国人"}
{"analyzer":"smartcn","text":"我是中国人"}














猜你喜欢

转载自liunancun.iteye.com/blog/2414427
今日推荐