欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

EFK教程-ElasticSearch角色分離

EFK教程 - ElasticSearch角色分離

目前創(chuàng)新互聯(lián)已為上千的企業(yè)提供了網(wǎng)站建設(shè)、域名、虛擬主機、網(wǎng)站托管、企業(yè)網(wǎng)站設(shè)計、望江網(wǎng)站維護等服務(wù),公司將堅持客戶導(dǎo)向、應(yīng)用為本的策略,正道將秉承"和諧、參與、激情"的文化,與客戶和合作伙伴齊心協(xié)力一起成長,共同發(fā)展。

通過將elasticsearch的data、ingest、master角色進行分離,搭建起高性能+高可用的ES架構(gòu)

作者:“發(fā)顛的小狼”,歡迎轉(zhuǎn)載與投稿


目錄

? 用途
? 架構(gòu)
? 步驟說明
? elasticsearch-data部署
? elasticsearch-ingest部署
? elasticsearch-master部署


用途

在第一篇《EFK教程 - 快速入門指南》中,闡述了EFK的安裝部署,其中ES的架構(gòu)為三節(jié)點,即master、ingest、data角色同時部署在三臺服務(wù)器上。

在本文中,將進行角色分離部署,并且每個角色分別部署三節(jié)點,在實現(xiàn)性能最大化的同時保障高可用。

? elasticsearch的master節(jié)點:用于調(diào)度,采用普通性能服務(wù)器來部署
? elasticsearch的ingest節(jié)點:用于數(shù)據(jù)預(yù)處理,采用性能好的服務(wù)器來部署
? elasticsearch的data節(jié)點:用于數(shù)據(jù)落地存儲,采用存儲性能好的服務(wù)器來部署

若不知道去哪找《EFK教程 - 快速入門指南》,可在主流搜索引擎里搜索:
小慢哥 EFK教程 快速入門指南
或者
小慢哥 EFK教程 基于多節(jié)點ES的EFK安裝部署配置

架構(gòu)

EFK教程 - ElasticSearch角色分離

服務(wù)器配置

EFK教程 - ElasticSearch角色分離

注意:此處的架構(gòu)是之前的文章《EFK教程 - 快速入門指南》的拓展,因此請先按照《EFK教程 - 快速入門指南》完成部署


步驟說明

1?? 部署3臺data節(jié)點,加入原集群
2?? 部署3臺ingest節(jié)點,加入原集群
3?? 將原有的es索引遷移到data節(jié)點
4?? 將原有的es節(jié)點改造成master節(jié)點


elasticsearch-data部署

之前已完成了基礎(chǔ)的elasticsearch架構(gòu),現(xiàn)需要新增三臺存儲節(jié)點加入集群,同時關(guān)閉master和ingest功能

elasticsearch-data安裝:3臺均執(zhí)行相同的安裝步驟

tar -zxvf elasticsearch-7.3.2-linux-x86_64.tar.gz
mv elasticsearch-7.3.2 /opt/elasticsearch
useradd elasticsearch -d /opt/elasticsearch -s /sbin/nologin
mkdir -p /opt/logs/elasticsearch
chown elasticsearch.elasticsearch /opt/elasticsearch -R
chown elasticsearch.elasticsearch /opt/logs/elasticsearch -R
# 數(shù)據(jù)盤需要elasticsearch寫權(quán)限
chown elasticsearch.elasticsearch /data/SAS -R

# 限制一個進程可以擁有的VMA(虛擬內(nèi)存區(qū)域)的數(shù)量要超過262144,不然elasticsearch會報max virtual memory areas vm.max_map_count [65535] is too low, increase to at least [262144]
echo "vm.max_map_count = 655350" >> /etc/sysctl.conf
sysctl -p

elasticsearch-data配置

? 192.168.1.51 /opt/elasticsearch/config/elasticsearch.yml

cluster.name: my-application
node.name: 192.168.1.51
# 數(shù)據(jù)盤位置,如果有多個硬盤位置,用","隔開
path.data: /data/SAS
path.logs: /opt/logs/elasticsearch
network.host: 192.168.1.51

discovery.seed_hosts: ["192.168.1.31","192.168.1.32","192.168.1.33"]
cluster.initial_master_nodes: ["192.168.1.31","192.168.1.32","192.168.1.33"]
http.cors.enabled: true
http.cors.allow-origin: "*"

# 關(guān)閉master功能
node.master: false
# 關(guān)閉ingest功能
node.ingest: false
# 開啟data功能
node.data: true

? 192.168.1.52 /opt/elasticsearch/config/elasticsearch.yml

cluster.name: my-application
node.name: 192.168.1.52
# 數(shù)據(jù)盤位置,如果有多個硬盤位置,用","隔開
path.data: /data/SAS
path.logs: /opt/logs/elasticsearch
network.host: 192.168.1.52

discovery.seed_hosts: ["192.168.1.31","192.168.1.32","192.168.1.33"]
cluster.initial_master_nodes: ["192.168.1.31","192.168.1.32","192.168.1.33"]
http.cors.enabled: true
http.cors.allow-origin: "*"

# 關(guān)閉master功能
node.master: false
# 關(guān)閉ingest功能
node.ingest: false
# 開啟data功能
node.data: true

? 192.168.1.53 /opt/elasticsearch/config/elasticsearch.yml

cluster.name: my-application
node.name: 192.168.1.53
# 數(shù)據(jù)盤位置,如果有多個硬盤位置,用","隔開
path.data: /data/SAS
path.logs: /opt/logs/elasticsearch
network.host: 192.168.1.53

discovery.seed_hosts: ["192.168.1.31","192.168.1.32","192.168.1.33"]
cluster.initial_master_nodes: ["192.168.1.31","192.168.1.32","192.168.1.33"]
http.cors.enabled: true
http.cors.allow-origin: "*"

# 關(guān)閉master功能
node.master: false
# 關(guān)閉ingest功能
node.ingest: false
# 開啟data功能
node.data: true

elasticsearch-data啟動

sudo -u elasticsearch /opt/elasticsearch/bin/elasticsearch

elasticsearch集群狀態(tài)

curl "http://192.168.1.31:9200/_cat/health?v"

EFK教程 - ElasticSearch角色分離

elasticsearch-data狀態(tài)

curl "http://192.168.1.31:9200/_cat/nodes?v"

EFK教程 - ElasticSearch角色分離

elasticsearch-data參數(shù)說明

status: green  # 集群健康狀態(tài)
node.total: 6  # 有6臺機子組成集群
node.data: 6  # 有6個節(jié)點的存儲
node.role: d  # 只擁有data角色
node.role: i  # 只擁有ingest角色
node.role: m  # 只擁有master角色
node.role: mid  # 擁master、ingest、data角色

elasticsearch-ingest部署

現(xiàn)需要新增三臺ingest節(jié)點加入集群,同時關(guān)閉master和data功能

elasticsearch-ingest安裝:3臺es均執(zhí)行相同的安裝步驟

tar -zxvf elasticsearch-7.3.2-linux-x86_64.tar.gz
mv elasticsearch-7.3.2 /opt/elasticsearch
useradd elasticsearch -d /opt/elasticsearch -s /sbin/nologin
mkdir -p /opt/logs/elasticsearch
chown elasticsearch.elasticsearch /opt/elasticsearch -R
chown elasticsearch.elasticsearch /opt/logs/elasticsearch -R

# 限制一個進程可以擁有的VMA(虛擬內(nèi)存區(qū)域)的數(shù)量要超過262144,不然elasticsearch會報max virtual memory areas vm.max_map_count [65535] is too low, increase to at least [262144]
echo "vm.max_map_count = 655350" >> /etc/sysctl.conf
sysctl -p

elasticsearch-ingest配置

? 192.168.1.41 /opt/elasticsearch/config/elasticsearch.yml

cluster.name: my-application
node.name: 192.168.1.41
path.logs: /opt/logs/elasticsearch
network.host: 192.168.1.41

discovery.seed_hosts: ["192.168.1.31","192.168.1.32","192.168.1.33"]
cluster.initial_master_nodes: ["192.168.1.31","192.168.1.32","192.168.1.33"]
http.cors.enabled: true
http.cors.allow-origin: "*"

# 關(guān)閉master功能
node.master: false
# 開啟ingest功能
node.ingest: true
# 關(guān)閉data功能
node.data: false

? 192.168.1.42 /opt/elasticsearch/config/elasticsearch.yml

cluster.name: my-application
node.name: 192.168.1.42
path.logs: /opt/logs/elasticsearch
network.host: 192.168.1.42

discovery.seed_hosts: ["192.168.1.31","192.168.1.32","192.168.1.33"]
cluster.initial_master_nodes: ["192.168.1.31","192.168.1.32","192.168.1.33"]
http.cors.enabled: true
http.cors.allow-origin: "*"

# 關(guān)閉master功能
node.master: false
# 開啟ingest功能
node.ingest: true
# 關(guān)閉data功能
node.data: false

? 192.168.1.43 /opt/elasticsearch/config/elasticsearch.yml

cluster.name: my-application
node.name: 192.168.1.43
path.logs: /opt/logs/elasticsearch
network.host: 192.168.1.43

discovery.seed_hosts: ["192.168.1.31","192.168.1.32","192.168.1.33"]
cluster.initial_master_nodes: ["192.168.1.31","192.168.1.32","192.168.1.33"]
http.cors.enabled: true
http.cors.allow-origin: "*"

# 關(guān)閉master功能
node.master: false
# 開啟ingest功能
node.ingest: true
# 關(guān)閉data功能
node.data: false

elasticsearch-ingest啟動

sudo -u elasticsearch /opt/elasticsearch/bin/elasticsearch

elasticsearch集群狀態(tài)

curl "http://192.168.1.31:9200/_cat/health?v"

elasticsearch-ingest狀態(tài)

EFK教程 - ElasticSearch角色分離

curl "http://192.168.1.31:9200/_cat/nodes?v"

EFK教程 - ElasticSearch角色分離

elasticsearch-ingest參數(shù)說明

status: green  # 集群健康狀態(tài)
node.total: 9  # 有9臺機子組成集群
node.data: 6  # 有6個節(jié)點的存儲
node.role: d  # 只擁有data角色
node.role: i  # 只擁有ingest角色
node.role: m  # 只擁有master角色
node.role: mid  # 擁master、ingest、data角色

elasticsearch-master部署

首先,將上一篇《EFK教程 - 快速入門指南》中部署的3臺es(192.168.1.31、192.168.1.32、192.168.1.33)改成只有master的功能, 因此需要先將這3臺上的索引數(shù)據(jù)遷移到本次所做的data節(jié)點中

1?? 索引遷移:一定要做這步,將之前的索引放到data節(jié)點上

curl -X PUT "192.168.1.31:9200/*/_settings?pretty" -H 'Content-Type: application/json' -d'
{
  "index.routing.allocation.include._ip": "192.168.1.51,192.168.1.52,192.168.1.53"
}'

2?? 確認當前索引存儲位置:確認所有索引不在192.168.1.31、192.168.1.32、192.168.1.33節(jié)點上

curl "http://192.168.1.31:9200/_cat/shards?h=n"

EFK教程 - ElasticSearch角色分離

elasticsearch-master配置

注意事項:修改配置,重啟進程,需要一臺一臺執(zhí)行,要確保第一臺成功后,再執(zhí)行下一臺。重啟進程的方法:由于上一篇文章《EFK教程 - 快速入門指南》里,是執(zhí)行命令跑在前臺,因此直接ctrl - c退出再啟動即可,啟動命令如下

sudo -u elasticsearch /opt/elasticsearch/bin/elasticsearch

? 192.168.1.31 /opt/elasticsearch/config/elasticsearch.yml

cluster.name: my-application
node.name: 192.168.1.31
path.logs: /opt/logs/elasticsearch
network.host: 192.168.1.31

discovery.seed_hosts: ["192.168.1.31","192.168.1.32","192.168.1.33"]
cluster.initial_master_nodes: ["192.168.1.31","192.168.1.32","192.168.1.33"]
http.cors.enabled: true
http.cors.allow-origin: "*"

#開啟master功能
node.master: true
#關(guān)閉ingest功能
node.ingest: false
#關(guān)閉data功能
node.data: false

? 192.168.1.32 /opt/elasticsearch/config/elasticsearch.yml

cluster.name: my-application
node.name: 192.168.1.32
path.logs: /opt/logs/elasticsearch
network.host: 192.168.1.32

discovery.seed_hosts: ["192.168.1.31","192.168.1.32","192.168.1.33"]
cluster.initial_master_nodes: ["192.168.1.31","192.168.1.32","192.168.1.33"]
http.cors.enabled: true
http.cors.allow-origin: "*"

#開啟master功能
node.master: true
#關(guān)閉ingest功能
node.ingest: false
#關(guān)閉data功能
node.data: false

? 192.168.1.33 /opt/elasticsearch/config/elasticsearch.yml

cluster.name: my-application
node.name: 192.168.1.33
path.logs: /opt/logs/elasticsearch
network.host: 192.168.1.33

discovery.seed_hosts: ["192.168.1.31","192.168.1.32","192.168.1.33"]
cluster.initial_master_nodes: ["192.168.1.31","192.168.1.32","192.168.1.33"]
http.cors.enabled: true
http.cors.allow-origin: "*"

#開啟master功能
node.master: true
#關(guān)閉ingest功能
node.ingest: false
#關(guān)閉data功能
node.data: false

elasticsearch集群狀態(tài)

curl "http://192.168.1.31:9200/_cat/health?v"

EFK教程 - ElasticSearch角色分離

elasticsearch-master狀態(tài)

curl "http://192.168.1.31:9200/_cat/nodes?v"

EFK教程 - ElasticSearch角色分離

至此,當node.role里所有服務(wù)器都不再出現(xiàn)“mid”,則表示一切順利完成。

當前名稱:EFK教程-ElasticSearch角色分離
文章鏈接:http://chinadenli.net/article40/gdogho.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供企業(yè)網(wǎng)站制作、面包屑導(dǎo)航、做網(wǎng)站、網(wǎng)站制作、網(wǎng)頁設(shè)計公司、動態(tài)網(wǎng)站

廣告

聲明:本網(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)

成都網(wǎng)站建設(shè)公司