ES单机多节点搭建步骤

ES单机多节点搭建步骤

查看ip地址
yum install net-tools -y
安装yum
apt-get update
apt-get install vim -y
安装vim
yum install -y vim
配置telnet命令
yum install xinetd telnet telnet-server -y

ES单机多节点集群环境搭建步骤(41.22)

前提环境:
jdk必须1.8以上:
-----------------centos安装1.7jdk步骤----------------------
1.java -version
2.rpm -qa | grep java
3.
rpm -e --nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64a
rpm -e --nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64
rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64
rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
4.java -version
5.下载上传相应的jdk
6.tar -zxvf jdk-8u144-linux-x64.tar.gz
7.vim /etc/profile
#java environment
export JAVA_HOME=/usr/java/jdk1.8.0_144
export CLASSPATH=.: J A V A H O M E / j r e / l i b / r t . j a r : {JAVA_HOME}/jre/lib/rt.jar: JAVAHOME/jre/lib/rt.jar:{JAVA_HOME}/lib/dt.jar: J A V A H O M E / l i b / t o o l s . j a r e x p o r t P A T H = {JAVA_HOME}/lib/tools.jar export PATH= JAVAHOME/lib/tools.jarexportPATH=PATH:${JAVA_HOME}/bin
【注】:CentOS6上面的是JAVAHOME,CentOS7是{JAVA_HOME}
8.source /etc/profile
9.java -version

-----------------ReaHat安装1.7jdk步骤----------------------

4.java -version
5.下载上传相应的jdk
6.tar -zxvf jdk-8u144-linux-x64.tar.gz
7.vim 打开/etc/bashrc
export JAVA_HOME=/usr/java/jdk1.7.0_80
export JRE_HOME= J A V A H O M E / j r e e x p o r t C L A S S P A T H = . : {JAVA_HOME}/jre export CLASSPATH=.: JAVAHOME/jreexportCLASSPATH=.:{JAVA_HOME}/lib: J R E H O M E / l i b : {JRE_HOME}/lib: JREHOME/lib:CLASSPATH
export JAVA_PATH= J A V A H O M E / b i n : {JAVA_HOME}/bin: JAVAHOME/bin:{JRE_HOME}/bin
export PATH= J A V A P A T H : {JAVA_PATH}: JAVAPATH:PATH
source /etc/bashrc
java -version

修改配置文件
vim /etc/security/limits.conf

  • soft nofile 65536
  • hard nofile 131072
  • soft nproc 2048
  • hard nproc 4096
    vi /etc/security/limits.d/90-nproc.conf
  • soft nproc 2048
    vi /etc/sysctl.conf
    vm.max_map_count=655360
    sysctl -p
    1.利用root用户,创建es用户
    useradd es
    passwd primeton123
    创建ES用户,密码为primeton123
    2.为创建的用户目录授权
    chown es.es -R /home/es
    3.创建数据和日志目录
    mkdir /home/es/esdata
    mkdir /home/es/eslog
    4.解压es文件
    tar -zxvf elasticsearch-6.5.4.tar.gz
    cp -r elasticsearch-6.5.4 /home/es/app(安装目录自己定义无所谓,多节点复制多个到目录或者用分布部署工具)
    5.配置/es1/config/elasticsearch.yml
    cluster.name: es #集群名称节点必须一致
    node.name: node-3 #单节点名称,随便写
    node.master: false #是否为master,单机一个单节点master就够了,单机挂了多机无用
    node.data: true #数据存储节点
    path.data: /home/es/data/esdata2
    path.logs: /home/es/data/eslog2
    bootstrap.memory_lock: false
    bootstrap.system_call_filter: false
    network.host: 172.20.41.22
    http.port: 9202
    transport.tcp.port: 9302
    discovery.zen.ping.unicast.hosts: [“172.20.41.22:9300”, “172.20.41.22:9301”,“172.20.41.22:9302”] #集群的端口是9300—9400
    discovery.zen.minimum_master_nodes: 1 #单机一个足以,(n/2)+1
    http.cors.enabled: true #配置es-header
    http.cors.allow-origin: “*” #配置es-header

6.配置好分别启动节点:
一定要切换到es用户下面重启
nohup ./elasticsearch & tail -f nohup.out
若出现问题查看日志具体问题具体分析;

你可能感兴趣的:(ES)