前言
介紹三種安裝es-head插件的方式
1、Google瀏覽器插件 安裝Google瀏覽器插件
,直接訪問(wèn)Elasticsearch
2、npm安裝 下載源碼
,編譯安裝,在nodejs環(huán)境下運(yùn)行插件
一、第一種 :
通過(guò)chrome安裝插件的方式提供一個(gè)可操作es的圖形化界面。
在chrome 瀏覽器中,通過(guò)“擴(kuò)展程序” 添加 elasticsearch head 插件的方式,這種方式無(wú)須開(kāi)啟
es的跨域
訪問(wèn)。
1、打開(kāi)鏈接
谷歌瀏覽器訪問(wèn)
http://extb.cqttech.com/search/elasticsearch%2520head
2、安裝下圖中插件(需要下載雙核瀏覽器)
3、點(diǎn)擊放大鏡圖標(biāo)使用插件
二、第二種 :
正如centos是使用yum命令安裝軟件的,ubuntu使用apt命令安裝軟件,python使用pip命令安裝插件,nodejs使用npm命令來(lái)安裝,所以我們需要先安裝npm軟件。
1、這里使用源碼安裝npm,解壓即用。
cd /opt/
wget https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz
tar xf node-v12.13.0-linux-x64.tar.xz
mv node-v12.13.0-linux-x64 node
echo 'export PATH=$PATH:/opt/node/bin'>>/etc/profile
source /etc/profile
npm -v
node -v
2、下載es-head插件
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head/
通過(guò)阿里巴巴源安裝cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install
3、啟動(dòng)es-head插件
#必須進(jìn)入es-head插件目錄運(yùn)行啟動(dòng)命令
cd elasticsearch-head/
cnpm run start
使用瀏覽器訪問(wèn)http://1.117.29.216:9100/即可訪問(wèn)到es-head插件,再使用es-head插件訪問(wèn)es數(shù)據(jù)庫(kù),效果如下
注意
9100端口是插件端口,9200是es端口
通過(guò)插件訪問(wèn)http://1.117.29.216:9200點(diǎn)擊連接還是失敗,是因?yàn)閑s有安全機(jī)制只允許服務(wù)器本地訪問(wèn),這時(shí)需要設(shè)置
4、設(shè)置跨域
設(shè)置跨域同時(shí)也適用于安裝的es-head插件跟es數(shù)據(jù)不在同一臺(tái)服務(wù)器上時(shí)的情況
#編輯es主配置文件,在文本末尾添加如下兩行配置
vim /etc/elasticsearch/elasticsearch.yml
# 是否支持跨域
http.cors.enabled: true
# *表示支持所有域名
http.cors.allow-origin: "*"
systemctl restart elasticsearch
cd elasticsearch-head/
cnpm run start
5、訪問(wèn)效果
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-485015.html
三、ElasticSearch7.9.0集群搭建詳細(xì)步驟
總結(jié)
注意 :別把es-head插件后放到 Elasticsearch的plugins目錄下,否則會(huì)報(bào)錯(cuò)!!!
文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-485015.html
到了這里,關(guān)于Elasticsearch-head插件的安裝的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!