elasticsearch7.10集群搭建

elasticsearch7.10集群搭建

环境准备

  1. 解压安装包

     tar -xvf /app/elasticsearch-7.10.1-linux-x86_64.tar.gz
     mv /app/elasticsearch-7.10.1 /app/elasticsearch	
     mkdir -p /app1/elasticsearch/log
     mkdir -p /app1/elasticsearch/data
    
  2. 添加es用户

     useradd -u 80 es
     passwd es
     chown -R es:es /app/elasticsearch
    
  3. 安装JDK并修改环境变量

     vi .bash_profile
    
     export JAVA_HOME=/usr/java/jdk1.8.0_261
     export PATH=$PATH:$JAVA_HOME/bin:
    
  4. 修改limits.conf

     vi /etc/security/limits.conf
     
     * soft nproc  100000
     * hard nproc  100000
     * soft nofile 102400
     * hard nofile 102400
     * hard memlock unlimited
     * soft memlock unlimited
     hadoop soft nproc  100000
     hadoop hard nproc  100000
     hadoop soft nofile 102400
     hadoop hard nofile 102400
     hadoop hard memlock unlimited
     hadoop soft memlock unlimited
    
  5. 修改/etc/sysctl.conf

     fs.file-max=655360
     vm.max_map_count=655360
     sysctl -p
    

elasticsearch集群配置文件修改

vi /app/elasticsearch/config/elasticsearch.yml

cluster.name: spark-cluster
node.name: sparkdis9 # 每台节点的机器名
bootstrap.memory_lock: true
network.host: 0.0.0.0
http.port: 9200
discovery.seed_hosts: ["sparkdis9", "sparkdis10","sparkdis11"]
cluster.initial_master_nodes: ["sparkdis9", "sparkdis10"]

vi /app/elasticsearch/config/jvm.options

# 最大值和最小值必须一致

-Xms6g
-Xmx6g

启动ES集群

/app/elasticsearch/bin/elasticsearch -d -p /app/elasticsearch/es-pid

你可能感兴趣的:(hadoop)