CentOS 7.3
1.在线安装es
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.5.1.zip
2.解压es.zip
unzip elasticsearch-5.5.1.zip
3.启动es
cd elasticsearch-5.5.1/
前台启动:
./bin/elasticsearch
后台启动:
./bin/elasticsearch -d
4.检测es运行情况
curl localhost:9200
5.设置远程访问
cd ../elasticsearch-5.5.1/config/
elasticsearch.ym
添加:http.host: 0.0.0.0
6.安装es head插件
cd /
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head/
npm install grunt -save() #需先安装npm
#yum install npm -y
ll node_modules/grunt #确认生成文件
npm install #执行安装
npm run start -d #后台启动服务
7.关闭es-head
查看es-head进程kill
ps -ef|grep head
kill -9 head-pid
8.es-head 集群健康值: 未连接
[1]../config/elasticsearch.yml
配置文件底部添加:
http.cors.enabled: true
http.cors.allow-origin: "*"
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
[2]../elasticsearch-head/Gruntfile.js
添加:hostname
connect: {
server: {
options: {
hostname: '0.0.0.0', #添加该行
port: 9100,
base: '.',
keepalive: true
}
}
}
[3]修改es地址
localhost 改为 具体ip
持续更新中….