Elasticsearch7.2集群的詳細(xì)安裝過程

本篇內(nèi)容介紹了“Elasticsearch7.2集群的詳細(xì)安裝過程”的有關(guān)知識,在實(shí)際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

創(chuàng)新互聯(lián)是專業(yè)的濱湖網(wǎng)站建設(shè)公司,濱湖接單;提供做網(wǎng)站、成都網(wǎng)站制作,網(wǎng)頁設(shè)計(jì),網(wǎng)站設(shè)計(jì),建網(wǎng)站,PHP網(wǎng)站建設(shè)等專業(yè)做網(wǎng)站服務(wù);采用PHP框架,可快速的進(jìn)行濱湖網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴(kuò)展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團(tuán)隊(duì),希望更多企業(yè)前來合作!

1、配置文件

[root@es1 ~]# grep '^[a-zA-Z]'  /etc/elasticsearch/elasticsearch.yml
cluster.name: xing-application
node.name: node-1
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
cluster.initial_master_nodes: ["node-1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.seed_hosts: ["192.168.56.14", "192.168.56.15", "192.168.56.16"]
[root@es1 ~]#
[root@es2 ~]#  grep '^[a-zA-Z]'  /etc/elasticsearch/elasticsearch.yml
cluster.name: xing-application
node.name: node-2
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
cluster.initial_master_nodes: ["node-1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.seed_hosts: ["192.168.56.14", "192.168.56.15", "192.168.56.16"]
[root@es2 ~]# 
[root@es3 ~]#  grep '^[a-zA-Z]'  /etc/elasticsearch/elasticsearch.yml
cluster.name: xing-application
node.name: node-3
path.data: /var/lib/elasticsearch
path.logs: /var/log/elasticsearch
network.host: 0.0.0.0
cluster.initial_master_nodes: ["node-1"]
http.cors.enabled: true
http.cors.allow-origin: "*"
discovery.seed_hosts: ["192.168.56.14", "192.168.56.15", "192.168.56.16"]
[root@es3 ~]#

2、安裝命令

yum -y localinstall kibana-7.2.0-x86_64.rpm  elasticsearch-7.2.0-x86_64.rpm

參考下載地址

https://www.elastic.co/cn/downloads/past-releases

3、啟動(dòng)命令

/etc/init.d/elasticsearch start

4、參數(shù)說明

cluster.name: xing-application
配置es的集群名稱,默認(rèn)是elasticsearch,es會自動(dòng)發(fā)現(xiàn)在同一網(wǎng)段下的es,如果在同一網(wǎng)段下有多個(gè)集群,就可以用這個(gè)屬性來區(qū)分不同的集群。
node.name: node-1
節(jié)點(diǎn)名,默認(rèn)隨機(jī)指定一個(gè)name列表中名字,該列表在es的jar包中config文件夾里name.txt文件中,其中有很多作者添加的有趣名字。
path.data: /var/lib/elasticsearch
設(shè)置索引數(shù)據(jù)的存儲路徑,默認(rèn)是es根目錄下的data文件夾,可以設(shè)置多個(gè)存儲路徑,用逗號隔開。
path.logs: /var/log/elasticsearch
設(shè)置日志文件的存儲路徑,默認(rèn)是es根目錄下的logs文件夾
network.host: 0.0.0.0
設(shè)置綁定的ip地址,可以是ipv4或ipv6的
cluster.initial_master_nodes: ["node-1"]
參數(shù)設(shè)置一系列符合主節(jié)點(diǎn)條件的節(jié)點(diǎn)的主機(jī)名或 IP 地址來引導(dǎo)啟動(dòng)集群。手動(dòng)指定可以成為 mater 的所有節(jié)點(diǎn)的 name 或者 ip,這些配置將會在第一次選舉中進(jìn)行計(jì)算
http.cors.enabled: true
如果啟用了 HTTP 端口,那么此屬性會指定是否允許跨域 REST 請求。
http.cors.allow-origin: "*"
如果 http.cors.enabled 的值為 true,那么該屬性會指定允許 REST 請求來自何處。
discovery.seed_hosts: ["192.168.56.14", "192.168.56.15", "192.168.56.16"]
配置集群的主機(jī)地址,配置之后集群的主機(jī)之間可以自動(dòng)發(fā)現(xiàn)

防止腦裂:

discovery.zen.minimum_master_nodes=集群節(jié)點(diǎn)/2+1

5、集群最終效果

Elasticsearch7.2集群的詳細(xì)安裝過程

6、tar.gz 安裝錯(cuò)誤處理
6.1、啟動(dòng)報(bào)錯(cuò)

啟動(dòng)用戶需要非root,如果用root用戶啟動(dòng)了,需要?jiǎng)h除logs和config目錄下root生成文件

6.2、環(huán)境配置報(bào)錯(cuò)

錯(cuò)誤:

ERROR: [3] bootstrap checks failed
[1]: max file descriptors [4096] for elasticsearch process is too low, increase to at least [65535]
[2]: max number of threads [3869] for user [elasticsearch] 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]

對應(yīng)處理:

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

[root@es1 ~]# cat /etc/sysctl.conf 
* soft nofile 65536
* hard nofile 65536

[2]: max number of threads [3869] for user [elasticsearch] is too low, increase to at least [4096]

[root@es1 ~]# cat /etc/security/limits.d/20-nproc.conf 
*          soft    nproc     40960
*          hard    nproc     40960

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

[root@es1 ~]# cat /etc/sysctl.conf 
vm.max_map_count=655360

[root@es1 ~]# sysctl -p
vm.max_map_count = 655360
[root@es1 ~]#

“Elasticsearch7.2集群的詳細(xì)安裝過程”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!

網(wǎng)站欄目:Elasticsearch7.2集群的詳細(xì)安裝過程
網(wǎng)頁URL:http://muchs.cn/article0/ihgsoo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供ChatGPT全網(wǎng)營銷推廣用戶體驗(yàn)、外貿(mào)網(wǎng)站建設(shè)靜態(tài)網(wǎng)站、企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)