我下载的是 5.2.0的包进行解压
-
先创建个 date 主要保存数据 在创建log 主要用来保存日志
-
Config 文件中 elasticsearch.yml 进行编译 vi elasticsearch.yml
需要编译的:
cluster.name: bolz 名称 三个服务器一样
node.name: b-2 节点 三个服务器必须不一样
path.data: /home/admin/java/install/es/data 数据存放的位置
path.logs: /home/admin/java/install/es/log 日志存放位置
network.host: 192.168.117.130 主机IP 本机
discovery.zen.ping.unicast.hosts: [“192.168.1.98”,“192.168.1.45”,“192.168.1.46”]
主要是三台服务器的IP -
修改 虚拟机内核参数 : 切换到 root 账户
(1) 修改vim /etc/security/limits.conf 文件,加入如下配 置- soft nofile 65536
- hard nofile 131072
- soft nproc 2048
- hard nproc 4096
(2) 修改vim /etc/security/limits.d/90-nproc.conf 文件,将 1024改为2048
(3)修改 vim /etc/sysctl.conf 来修改内核参数 吧文件中所有数据删除添加如 下数据:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
kernel.sysrq = 0
kernel.core_uses_pid = 1
kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.shmmax = 68719476736
kernel.shmall = 4294967296
net.ipv4.tcp_max_tw_buckets = 6000
net.ipv4.tcp_sack = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_rmem = 4096 87380 4194304
net.ipv4.tcp_wmem = 4096 16384 4194304
net.ipv4.tcp_max_syn_backlog = 262144
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_synack_retries = 1
net.ipv4.tcp_syn_retries = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_mem = 94500000 915000000 927000000
net.ipv4.tcp_fin_timeout = 5
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_keepalive_time = 5
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.ip_local_port_range = 1024 65000
net.core.wmem_default = 8388608
net.core.rmem_default = 8388608
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.core.netdev_max_backlog = 262144
net.core.somaxconn=65535
net.netfilter.nf_conntrack_max=655350
net.netfilter.nf_conntrack_tcp_timeout_established=1200
vm.overcommit_memory=1
vm.max_map_count =622144
报错就该成262144
fs.file-max = 102400
(4) 让文件生效 : sysctl -p
- 给es中 bin下面的文件变成 可执行 文件 chmod 755 bin/*
- 启动:
./elasticsearch 或者
./elasticsearch -d
jps 看进程