本次實驗使用3臺虛擬機

192.168.209.168
192.168.209.169
192.168.209.170
cp /usr/elasticsearch-6.2.3/config/elasticsearch.yml /usr/elasticsearch-6.2.3/config/elasticsearch.yml.bak
vi /usr/elasticsearch-6.2.3/config/elasticsearch.yml
cluster.name: ES_Cluster_Pcdog
node.name: 192.168.209.168
path.data: /usr/elasticsearch-6.2.3/data
path.logs: /usr/elasticsearch-6.2.3/logs
network.host: 192.168.209.168
node.master: true
node.data: true
discovery.zen.ping.unicast.hosts: ["192.168.209.168","192.168.209.169","192.168.209.170"]
discovery.zen.minimum_master_nodes: 3
discovery.zen.fd.ping_timeout: 120s
discovery.zen.fd.ping_retries: 6
discovery.zen.fd.ping_interval: 30s
cluster.routing.allocation.cluster_concurrent_rebalance: 40
cluster.routing.allocation.node_concurrent_recoveries: 40
cluster.routing.allocation.node_initial_primaries_recoveries: 40
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
檢查配置,過濾掉注釋
cat elasticsearch.yml | grep -v "^#"
node 168 啟動
./bin/elasticssearch

集群狀態(tài)yellow,因為其他2臺還沒起。。。
[2018-04-20T11:36:16,000][INFO ][o.e.c.r.a.AllocationService] [192.168.209.168] Cluster health status changed from [RED] to [YELLOW] (reason: [shards started [[logstash-2018.04.18][1]] ...]).
配置文件復(fù)制到其他2個節(jié)點
scp elasticsearch.yml 192.168.209.169:/usr/elasticsearch-6.2.3/config
scp elasticsearch.yml 192.168.209.170:/usr/elasticsearch-6.2.3/config


然后在各自的node啟動elasticssearch
node 002

node 003

在master node的目錄/usr/elasticsearch-6.2.3/logs

可以看到cluster日志
tail -f ES_Cluster_Pcdog.log
尼瑪日志毫無更新,去其他2個節(jié)點看,2個node都有報錯,難道是我克隆出來的機器的問題? 容我修個錯誤。
[2018-04-20T11:49:10,794][INFO ][o.e.d.z.ZenDiscovery ] [192.168.209.169] failed to send join request to master [{192.168.209.168}{-aU5102ETMW8isf85FWEHA}{V4flu0jLRfixBA0Yf9740w}{192.168.209.168}{192.168.209.168:9300}], reason [RemoteTransportException[[192.168.209.168][192.168.209.168:9300][internal:discovery/zen/join]]; nested: IllegalArgumentException[can't add node {192.168.209.169}{-aU5102ETMW8isf85FWEHA}{1IesX0gaSZWz2_O3eKDvfw}{192.168.209.169}{192.168.209.169:9300}, found existing node {192.168.209.168}{-aU5102ETMW8isf85FWEHA}{V4flu0jLRfixBA0Yf9740w}{192.168.209.168}{192.168.209.168:9300} with the same id but is a different node instance]; ]
原來是data里面有原來的數(shù)據(jù),干掉
[pactera@ELK_002 data]$ pwd
/usr/elasticsearch-6.2.3/data
[pactera@ELK_002 data]$ rm -rf nodes/
3個節(jié)點都正常了
node 168 ,發(fā)現(xiàn)master 角色169

node 169 ,狀態(tài)黃變綠

node 170 ,發(fā)現(xiàn)master 角色169

稍后我需要研究下如何選舉master過程,這個cluster 3個master 3個data,實際生產(chǎn)應(yīng)該是2個master然后多個data的。
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
分享名稱:ELK實驗(六)elasticsearch集群搭建-創(chuàng)新互聯(lián)
網(wǎng)頁網(wǎng)址:http://www.chinadenli.net/article8/dodhip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計、電子商務(wù)、云服務(wù)器、手機網(wǎng)站建設(shè)、服務(wù)器托管、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容