ElasticSearch

①解壓文件 tar -zxvf elasticsearch-6.2.1.tar.gz

②重命名 mv elasticsearch-6.2.1 /usr/local/elasticsearch

③創(chuàng)建數(shù)據(jù)存放路徑 mkdir /usr/local/elk/elasticsearch/data

④建立用戶并授權(quán)(es不能用root運(yùn)行)

#添加用戶??? useradd es???????? #設(shè)定密碼??? passwd es

#賦予文件夾權(quán)限???? chown -R es:es /usr/local/elasticsearch

⑤修改elasticsearch配置文件 ? ?vim /usr/local/elasticsearch/config/elasticsearch.yml

⑥調(diào)整jvm內(nèi)存 ? ?vim /usr/local/elasticsearch/config/jvm.options

#默認(rèn)是1g官方建議對(duì)jvm進(jìn)行一些修改,不然很容易出現(xiàn)OOM,參考官網(wǎng)改參數(shù)配置最好不要超過內(nèi)存的50%

-Xms200m

-Xmx200m

⑦使用非root用戶啟動(dòng)Elasticsearch

#切換至es賬戶????????? su es

#啟動(dòng) /usr/local/elasticsearch/bin/./elasticsearch

如果啟動(dòng)報(bào)如下錯(cuò)則:切回root用戶 exit? ,修改相應(yīng)配置

ERROR:?[3]?bootstrap?checks?failed??

[1]:?max?file?descriptors?[65535]?for?elasticsearch?process?is?too?low,?increase?to?at?least?[65536]??

[2]:?max?number?of?threads?[3895]?for?user?[elastic]?is?too?low,?increase?to?at?least?[4096]??

[3]:?max?virtual?memory?areas?vm.max_map_count?[65530]?is?too?low,?increase?to?at?least?[262144]??

【1】修改/etc/security/limits.conf,修改到提示值

[root@centos7.4-64?~]#?vim?/etc/security/limits.conf?

* soft nofile 65536

* hard nofile 65536

* soft memlock unlimited

* hard memlock unlimited

【2】修改/etc/security/limits.d/90-nproc.conf 文件

[root@centos7.4-64?~]#?vim?/etc/security/limits.d/90-nproc.conf???

將內(nèi)容改為:? *??????????soft????nproc?????4096

【3】修改/etc/sysctl.conf

[root@centos7.4-64?~]#?vim?/etc/sysctl.conf???

添加配置:vm.max_map_count=262144,然后執(zhí)行命令??

[root@centos7.4-64?~]#?sysctl?-p


1.es6安裝:

https://blog.csdn.net/cowbin2012/article/details/80717534

https://blog.csdn.net/qq_34021712/article/details/79333090

https://blog.csdn.net/fgf00/article/details/79571940

2.集群搭建
https://www.cnblogs.com/liuchuanfeng/articles/7059268.html

3.logstash使用rpm包安裝的時(shí)候沒有配置init的啟動(dòng)腳本(可無此步驟)

生成啟動(dòng)腳本,centos6使用sysv參數(shù),centos7使用systemd

# /usr/share/logstash/bin/system-install?/etc/logstash/startup.options sysv

4.es插件安裝:(node, grunt, elasticsearch-head)

https://blog.csdn.net/python36/article/details/80816707(不用單獨(dú)下載node)

https://www.cnblogs.com/hts-technology/p/8556279.html

5.啟動(dòng)es: ?/usr/local/elasticsearch-1/bin/elasticsearch

啟動(dòng)es-head插件:?/usr/local/elasticsearch-head/./node_modules/grunt/bin/grunt server &

訪問es-head插件:ip+9100



ES學(xué)習(xí)流程

(1)掌握 Elasticsearch 的基本概念,主要包括:

索引(index)

類型(type)

映射(mapping)

文檔(document)

倒排索引原理

文檔打分機(jī)制

集群(cluster)——單節(jié)點(diǎn)、集群安裝與部署

健康狀態(tài)(red/yellow/green)

數(shù)據(jù)存儲(chǔ)

數(shù)據(jù)類型(long/date/text、keyword/nested等)

數(shù)據(jù)展示(結(jié)合Head插件的基礎(chǔ)可視化)

……

(2)掌握 Elasitcsearch 的基本操作,主要包括:

新增(insert)

刪除(delete/deletebyquery)

修改(update/updatebyquery)

查找(search)

精確匹配檢索(term、terms、range、exists)

模糊匹配檢索(wildcard、prefix、negix正則)

分詞全文檢索(match/match_phrase等)

多條件 bool 檢索(must/must_not/should多重組合)

分詞(英文分詞、拼音分詞、中文分詞)

高亮

分頁查詢

指定關(guān)鍵詞返回

批量操作 bulk

scroll 查詢

reindex 操作

(3)掌握 Elasticsearch 高級(jí)操作,主要包括:

聚合統(tǒng)計(jì)(數(shù)量聚合、最大值、最小值、平均值、求和等聚合操作)

圖像化展示(hisgram 按照日期等聚合)

聚合后分頁

父子文檔

數(shù)組類型

nested 嵌套類型

ES 插件錯(cuò)誤排查(集群問題、檢索問題、性能問題)

ES 性能調(diào)優(yōu)(配置調(diào)優(yōu)、集群調(diào)優(yōu)等)

……

(4)掌握 Elasticsearch Java/Python 等API,主要包括:

Elasticsearch 原生自帶 API、JEST、Springboot 等 API 選型

Elasticsearch 多條件 bool 復(fù)雜檢索 API

Elasticsearch 分頁 API

Elasticsearch 高亮 API

Elasticsearch 聚合 API

Elasticsearch 相關(guān) JSON 數(shù)據(jù)解析

……

(5)Elasticsearch 結(jié)合場景開發(fā)實(shí)戰(zhàn),主要包括:

數(shù)據(jù)可視化(Kibana、Grafana 等 其中 Grafana 比較適合監(jiān)控類場景)

通過 logstash/beats 等導(dǎo)入數(shù)據(jù)

Elasticsearch 和 Kafka 結(jié)合的應(yīng)用場景

Elasticsearch 和 Mongo 結(jié)合的應(yīng)用場景

Elasticsearch 和 Hadoop 結(jié)合的應(yīng)用場景

結(jié)合業(yè)務(wù)需求的定制化應(yīng)用場景(日志分析、文檔檢索、全文檢索、金融等各行業(yè)檢索)

……

建議的第二學(xué)習(xí)優(yōu)先級(jí)為 Kibana。需要掌握的內(nèi)容如下。

Kibana 安裝與部署

ES 節(jié)點(diǎn)數(shù)據(jù)同步到 Kibana

Kibana Dev Tools 開發(fā)工具熟練使用

Kibana 圖像化組合展示

將 Kibana 圖像化展示效果圖應(yīng)用到自己的開發(fā)環(huán)境中

……

第三學(xué)習(xí)優(yōu)先級(jí)為 Logstash。需要掌握的內(nèi)容如下。

Logstash 的安裝與部署

Logstash 將本地文件導(dǎo)入 ES

logstashinputjdbc 插件(5.X后無需安裝)將 MySQL/Oracle 等關(guān)系型數(shù)據(jù)庫數(shù)據(jù)導(dǎo)入 ES,全量導(dǎo)入和增量導(dǎo)入實(shí)現(xiàn)。

logstashinputmongo插件將 Mongo 數(shù)據(jù)導(dǎo)入 ES

logstashinputkafaka 插件將 Kafak 數(shù)據(jù)導(dǎo)入 ES

logstashoutput* 插件將 ES 數(shù)據(jù)導(dǎo)入不同的數(shù)據(jù)庫和實(shí)時(shí)數(shù)據(jù)流中

……

第四學(xué)習(xí)優(yōu)先級(jí)為 Beats。需要掌握的內(nèi)容如下。

不同類型的 Beats 安裝與部署

將業(yè)務(wù)數(shù)據(jù)通過 Beats 導(dǎo)入 ES

……

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容