ElasticSearch5.0的安装

来源:互联网 发布:横道图 软件 编辑:程序博客网 时间:2024/06/05 23:49

ElasticSearch5.0的安装

我在安装5.0版本的时候 和1.4版本不一样
出现了特别多的问题 下面总结一下:
注意 jdk 必须1.8,centos6以上 linux系统低会报错但不影响使用

1.启动必须是新建的用户 不能是root用户,这是安全机制引起的

groupadd -g 600  esuseradd -u 600 -g 600 espasswd es 设置密码

2.将elasticSearch设置用户用户组

sudo -R chown es:es elasticSearch

3.修改config中的yml文件

# ---------------------------------- Cluster -----------------------------------## Use a descriptive name for your cluster:#cluster.name: hr_es## ------------------------------------ Node ------------------------------------## Use a descriptive name for the node:#node.name: es_1node.master: truenode.data: false## Add custom attributes to the node:##node.attr.rack: r1## ----------------------------------- Paths ------------------------------------## Path to directory where to store the data (separate multiple locations by comma):#path.data: /home/software/esdata## Path to log files:#path.logs: /home/software/eslogs## ----------------------------------- Memory -----------------------------------## Lock the memory on startup:##bootstrap.memory_lock: truebootstrap.memory_lock: falsebootstrap.system_call_filter: false# ---------------------------------- Network -----------------------------------network.host: 0.0.0.0http.port: 9200

4.系统中的设置

1. vi /etc/security/limits.conf   添加内容* soft nofile 65536* hard nofile 131072* soft nproc 2048* hard nproc 40962. vi /etc/security/limits.d/90-nproc.conf  修改内容 *          soft    nproc     1024-》改成20483. vi /etc/sysctl.conf  添加内容   vm.max_map_count=655360   并执行 :sysctl -p

5.最后在es用户下执行启动,启动前先创建yml中配置的目录

以上是单节点的

集群的配置:

1.在yml中添加如下的字段:

discovery.zen.ping.unicast.hosts: ["192.168.80.11:9300","192.168.80.12:9300"]指定集群节点discovery.zen.minimum_master_nodes: 1有几个主节点(老大)
原创粉丝点击