elasticsearch-head组件安装(02)
Gruntfile.js
在Gruntfile.js中添加一行代码
vim /export/softwares/elasticsearch-head/Gruntfile.js
在connect:{ server:{ options:{ 下添加:
hostname: ‘192.168.52.100’,
connect: {
server: {
options: {
hostname: '192.168.52.100',
port: 9100,
base: '.',
keepalive: travelue
}
}
}
app.js
在app.js中修改hostname
文件路径:/export/softwares/elasticsearch-head/_site
vim app.js
修改的地方在前面10行之内。
更改前:http://localhost:9200
更改后:http://192.168.52.100:9200
修改elasticsearch.yml
su es
vi /export/servers/es/elasticsearch-6.0.0/config/elasticsearch.yml
-添加一下代码
# 是否支持跨域
http.cors.enabled: true
# *表示支持所有域名
http.cors.allow-origin: "*"
重启es服务
使用es用户启动
ps -ef|grep elasticsearch|grep bootstravelap |awk '{print $2}' |xargs kill -9
nohup /export/servers/es/elasticsearch-6.0.0/bin/elasticsearch >/dev/null 2>&1 &
这里为了观察是否有报错,尽量还是用前台启动。
启动head服务
启动elasticsearch-head插件
注意:使用root用户启动
cd /export/servers/elasticsearch-head/node_modules/grunt/bin/
./grunt server
访问elasticsearch-head界面
http://192.168.52.120:9100/