东莞制作网站建设的公司,兰州企业网站优化,都昌县建设局网站,怎么让学生在网站上做问卷调查介绍 elasticsearch-head是一个用于管理Elasticsearch的web前端插件#xff0c;搞过ES的同学应该都了解。该插件在es5中可以以独立服务的形式进行安装使用。本文将介绍如何操作。 相关链接#xff1a;https://github.com/mobz/elasticsearch-headhttp://mobz.github.io/elast… 介绍 elasticsearch-head是一个用于管理Elasticsearch的web前端插件搞过ES的同学应该都了解。该插件在es5中可以以独立服务的形式进行安装使用。本文将介绍如何操作。 相关链接 https://github.com/mobz/elasticsearch-head http://mobz.github.io/elasticsearch-head/ 操作 Step1, 安装nodejs和npm yum -y install nodejs npmStep2, 下载源码并安装 git clone https://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head/
npm installStep3es配置修改elasticsearch-head插件源码修改 ① 修改elasticsearch.yml增加跨域的配置(需要重启es才能生效) http.cors.enabled: true
http.cors.allow-origin: * ② 编辑head/Gruntfile.js修改服务器监听地址增加hostname属性将其值设置为*。 以下两种配置都是OK的 # Type1 connect: {hostname: *,server: {options: {port: 9100,base: .,keepalive: true}}
}# Type 2 connect: {server: {options: {hostname: *,port: 9100,base: .,keepalive: true}}
}③ 编辑head/_site/app.js修改head连接es的地址将localhost修改为es的IP地址 # 原配置 this.base_uri this.config.base_uri || this.prefs.get(app-base_uri) || http://localhost:9200; # 将localhost修改为ES的IP地址 this.base_uri this.config.base_uri || this.prefs.get(app-base_uri) || http://YOUR-ES-IP:9200;Step4启动elasticsearch-head cd elasticsearch-head/ ./node_modules/grunt/bin/grunt server 注意 ① 此时elasticsearch-head为前台启动如果终端退出那么elasticsearch-head服务也会随之关闭。 ② 在非elasticsearch-head目录中启动server会失败因为grunt需要读取目录下的Gruntfile.js。 So你需要将之放到后台进行运行nohupscreen等各种方法请各位随意选择~ ps我会用screen来做类似的操作~ Others 另外开机启动、保持持久运行等可以考虑配置rc.local、supervisord等来实现(配置略) 效果 转载于:https://www.cnblogs.com/thatsit/p/6347693.html