elasticsearch-head 配置
install node.js
-
Download node.js:
-
将下载的包,解压并配置环境变量
vim /etc/profile
#set for nodejs
export NODE_HOME=/opt/modules/node-v10.9.0-linux-x64
export PATH=$NODE_HOME/bin:$PATH
-
Install cnpm npm install cnpm -g --registry=https://registry.npm.taobao.org
-
npm taobao mirror
1.得到原本的镜像地址
npm get registry
https://registry.npmjs.org/
设成淘宝的
npm config set registry http://registry.npm.taobao.org/
yarn config set registry http://registry.npm.taobao.org/
2.换成原来的
npm config set registry https://registry.npmjs.org/
-
修改Gruntfile.js
[fan@master elasticsearch-head]$ cd /opt/modules/elasticsearch-head
[fan@master elasticsearch-head]$ vim Gruntfile.js
-
在connect-->server-->options下面添加:hostname:'*', 允许所有ip访问。
connect: {
server: {
options: {
hostname:'*',
port: 9100,
base: '.',
keepalive: true
}
}
}
-
修改默认连接地址
[fan@master _site]$ cd /opt/modules/elasticsearch-head/_site
[fan@master _site]$ vim app.js
# 将其中的localhost修改为自己的ip地址
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";
↓
this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://master:9200";
-
配置elasticsearch允许跨域访问
[fan@master config]$ cd /opt/modules/elasticsearch-6.5.0/config
[fan@master config]$ sudo vim elasticsearch.yml
# 在文件末尾追加,配置elasticsearch允许跨域访问
http.cors.enabled:true
http.cors.allow-origin:"*"
-
打开9100端口
# 如果使用的是centos7,则执行
[fan@master elasticsearch-head]$ firewall-cmd --zone=public --add-port=9100/tcp --parmanent
-
启动elasticsearch
-
启动 elasticsearch-head
npm run start &
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了