💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
<blockquote class="success">elasticsearch-head</blockquote> ``` elasticsearch-head是一款专门针对于elasticsearch的客户端工具 ``` ### 一、安装前准备 [1、centos7安装git](http://www.cnblogs.com/subendong/p/7667443.html) [2、centos7安装nodejs](http://www.cnblogs.com/subendong/p/7667496.html) >sudo yum install nodejs ### 二、elasticsearch-head安装 ``` 1、使用git拷贝elasticsearch-head到本地 cd /usr/local/ git clone git://github.com/mobz/elasticsearch-head.git 或者 unzip elasticsearch-head-master.zip -d /usr/local/elasticsearch-head/ 2、安装elasticsearch-head依赖包 cd /usr/local/elasticsearch-head/ npm install 3、修改Gruntfile.js cd /usr/local/elasticsearch-head/ vim Gruntfile.js 在connect-->server-->options下面添加:hostname:’*’,允许所有IP可以访问 ``` ![](http://cloud.ryloo.icu/48db8ed362c243b790f0ffb0a91ca3ef) ``` 4、修改elasticsearch-head默认连接地址 cd /usr/local/elasticsearch-head/_site/ vim app.js 将this.base_uri = this.config.base_uri || this.prefs.get("app-base_uri") || "http://localhost:9200";中的localhost修改成你es的服务器地址 5、配置elasticsearch允许跨域访问 进入elasticsearch服务器,打开elasticsearch的配置文件elasticsearch.yml,在文件末尾追加下面两行代码即可: http.cors.enabled: true http.cors.allow-origin: "*" 6、打开9100端口 如果想在别的机器上访问,防火墙必须开启9100端口,永久打开9100端口 firewall-cmd --zone=public --add-port=9100/tcp --permanent firewall-cmd --reload 7、 启动elasticsearch-head cd /usr/local/elasticsearch-head/ node_modules/grunt/bin/grunt server 8、后台启动 cd /usr/local/elasticsearch-head/ nohup npm run start >/usr/local/elasticsearch-head/nohup.out 2>&1 & 9、启动、停止 head 查看 9100 (head 端口)端口: lsof -i:9100 杀死进程: kill -9 pid 添加到开启自启: chmod +x elasticsearch-head # 赋予权限 chkconfig --add elasticsearch-head 测试: service elasticsearch-head start Ok,查看进程: ``` ![](http://cloud.ryloo.icu/ec859cfdee493f4b02158a11ddd4a98d) ![](http://cloud.ryloo.icu/db9f69aaf79e808ee6545705b326dba9)