linux es数据库 head,elasticsearch安装es-sql插件
說明:本示例是在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)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: cross join 一张表没有值关联不
- 下一篇: Linux系统下安装CodeBlocks