Elasticsearch7.2集群的详细安装过程

  介绍

本篇内容介绍了“Elasticsearch7.2集群的详细安装过程”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

1,配置文件

 [root@es1  ~] #, grep  & # 39; ^ [a-zA-Z] & # 39;,,/etc/elasticsearch/elasticsearch.yml
  cluster.name: xing-application
  node.name:节点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:真实
  http.cors.allow-origin:,“*”;
  (“192.168.56.14" discovery.seed_hosts:,,,“192.168.56.15",,“192.168.56.16"】
  root@es1  ~ #
  (root@es2  ~) #,, grep  & # 39; ^ [a-zA-Z] & # 39;,,/etc/elasticsearch/elasticsearch.yml
  cluster.name: xing-application
  node.name:节点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:真实
  http.cors.allow-origin:,“*”;
  (“192.168.56.14" discovery.seed_hosts:,,,“192.168.56.15",,“192.168.56.16"】
  (root@es2  ~) #,
  (root@es3  ~) #,, grep  & # 39; ^ [a-zA-Z] & # 39;,,/etc/elasticsearch/elasticsearch.yml
  cluster.name: xing-application
  node.name:节点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:真实
  http.cors.allow-origin:,“*”;
  (“192.168.56.14" discovery.seed_hosts:,,,“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,启动命令

/etc/摆在elasticsearch 开始

4,参数说明

 cluster.name: xing-application
  配置es的集群名称,默认是elasticsearch, es会自动发现在同一网段下的,如果在同一网段下有多个集群,就可以用这个属性来区分不同的集群。
  node.name:节点1
  节点名,默认随机指定一个名字列表中名字,该列表在es的jar包中配置文件夹里name.txt文件中,其中有很多作者添加的有趣名字。
  path.data:/var/lib/elasticsearch
  设置索引数据的存储路径,默认是es根目录下的数据文件夹,可以设置多个存储路径,用逗号隔开。
  path.logs:/var/log/elasticsearch
  设置日志文件的存储路径,默认是es根目录下的日志文件夹
  network.host: 0.0.0.0
  设置绑定的ip地址,可以是ipv4或ipv6的
  cluster.initial_master_nodes: [“node-1"]
  参数设置一系列符合主节点条件的节点的主机名或,IP 地址来引导启动集群。手动指定可以成为,mater 的所有节点的,name 或者,ip,这些配置将会在第一次选举中进行计算
  http.cors.enabled:真实
  如果启用了,HTTP 端口,那么此属性会指定是否允许跨域,REST 请求。
  http.cors.allow-origin:,“*”;
  如果,http.cors.enabled 的值为,真的,那么该属性会指定允许,REST 请求来自何处。
  (“192.168.56.14" discovery.seed_hosts:,,,“192.168.56.15",,“192.168.56.16"】
  配置集群的主机地址,配置之后集群的主机之间可以自动发现

防止脑裂:

 discovery.zen。minimum_master_nodes=集群节点/2 + 1 

5,集群最终效果

 Elasticsearch7.2集群的详细安装过程

6,焦油。广州安装错误处理
6.1,启动报错

<>前启动用户需要非根,如果用根用户启动了,需要删除日志和配置目录下根生成文件

6.2,环境配置报错

错误:

<>之前错误:,[3],bootstrap  checks 失败了   [1]:max  file  descriptors  [4096], for  elasticsearch  process  is  too 低,,increase 用at  least  [65535]   [2]:max  number  of  threads  [3869], for  user  [elasticsearch], is  too 低,,increase 用at  least  [4096]   [3]:max  virtual  memory  areas  vm.max_map_count  [65530], is  too 低,,increase 用at  least  [262144]

对应处理:

 [1]:, max  file  descriptors  [4096], for  elasticsearch  process  is  too 低,,increase 用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 低,,increase 用at  least  [4096]
  
  (root@es1  ~) #, cat /etc/安全/limits.d/20-nproc.conf 
  *,,,,,,,,,,soft ,,, nproc ,,, 40960
  *,,,,,,,,,,hard ,,, nproc ,,, 40960
  
  [3]:max  virtual  memory  areas  vm.max_map_count  [65530], is  too 低,,increase 用at  least  [262144]
  
  (root@es1  ~) #, cat /etc/sysctl.conf 
  vm.max_map_count=655360
  
  (root@es1  ~) #, sysctl  - p
  vm.max_map_count =655360
  null

Elasticsearch7.2集群的详细安装过程