日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

linux es数据库 head,elasticsearch安装es-sql插件

發(fā)布時(shí)間:2025/3/8 32 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux es数据库 head,elasticsearch安装es-sql插件 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

說明:本示例是在CentOs Linux7.4上運(yùn)行,安裝的es版本為6.8.0,對(duì)應(yīng)es-sql版本6.8.0,es-head版本5.0.0,需要安裝JDK

下載es安裝包

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.8.0.tar.gz

下載插件包

es-sql

es-sql-site-standalone.zip此包提供web服務(wù)

es-head

安裝es,前期系統(tǒng)級(jí)別準(zhǔn)備

#新建用戶

useradd es

#創(chuàng)建密碼

passwd es

#設(shè)置es的sudo權(quán)限

vim /etc/sudoers

#找到下面這一行

root ? ?ALL=(ALL) ? ? ? ALL

#增加這一行

es ? ?ALL=(ALL) ? ? ? ALL

#修改文件數(shù)和線程數(shù)

vim /etc/security/limits.conf

* soft nofile 65536

* hard nofile 65536

* soft nproc 4096

* hard nproc 4096

#修改sysctl.conf

vim /etc/sysctl.conf

vm.max_map_count=262144

#立即生效

sysctl -p

#解壓已經(jīng)下載的安裝包

tar -xvf xxx.tar.gz -C /home/es

chown es:es xxx

chmod 755 xxx

安裝es,配置文件設(shè)置

#找到elasticsearch.yml文件,并修改其中的參數(shù)

vim elasticsearch.yml

bootstrap.memory_lock: false

bootstrap.system_call_filter: false

#根據(jù)實(shí)際情況填寫IP地址

network.host: xxx.xxx.xxx.xxx

#根據(jù)實(shí)際情況填寫端口號(hào)

http.port: 9200

啟動(dòng)es之前,要保證系統(tǒng)安裝了JDK

啟動(dòng)es

#使用es用戶啟動(dòng)

nohup ./bin/elasticsearch >> es.log &

tail -f es.log

安裝es-sql

#安裝es-sql,記得相關(guān)的es操作要使用es用戶

./bin/elasticsearch-plugin install file:///home/es/elasticsearch-sql-xxx.zip

#安裝web服務(wù)

unzip es-sql-site-standalone.zip

cd site-server

#沒有npm,需要用yum安裝一下

npm install express --save

#啟動(dòng)web服務(wù)

node node-server.js &

#可以修改為es提供web服務(wù)的端口號(hào),默認(rèn)是8080

vim site_configuration.json

#要想使用此插件,需要修改es的配置文件,換句話說需要重啟es

vim elasticsearch.yml

http.cors.enabled: true

http.cors.allow-origin: "*"

瀏覽器訪問:http://xxx.xxx.xxx.xxx:8080

紅色方框內(nèi)填入你要查詢的es數(shù)據(jù)庫的IP地址和端口號(hào)

總結(jié)

以上是生活随笔為你收集整理的linux es数据库 head,elasticsearch安装es-sql插件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。