Elasticsearch 7.2集羣安裝重要節點記錄

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 

3、啓動命令

/etc/init.d/elasticsearch start

4、參數說明

cluster.name: xing-application
配置es的集羣名稱,默認是elasticsearch,es會自動發現在同一網段下的es,如果在同一網段下有多個集羣,就可以用這個屬性來區分不同的集羣。
node.name: node-1
節點名,默認隨機指定一個name列表中名字,該列表在es的jar包中config文件夾裏name.txt文件中,其中有很多作者添加的有趣名字。
path.data: /var/lib/elasticsearch
設置索引數據的存儲路徑,默認是es根目錄下的data文件夾,可以設置多個存儲路徑,用逗號隔開。
path.logs: /var/log/elasticsearch
設置日誌文件的存儲路徑,默認是es根目錄下的logs文件夾
network.host: 0.0.0.0
設置綁定的ip地址,可以是ipv4或ipv6的
cluster.initial_master_nodes: ["node-1"]
參數設置一系列符合主節點條件的節點的主機名或 IP 地址來引導啓動集羣。手動指定可以成爲 mater 的所有節點的 name 或者 ip,這些配置將會在第一次選舉中進行計算
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"]
配置集羣的主機地址,配置之後集羣的主機之間可以自動發現

5、集羣最終效果

Elasticsearch 7.2集羣安裝重要節點記錄

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章