Elasticsearch 5.x安装

本文详细介绍如何搭建Elasticsearch集群,包括环境准备、下载安装、配置文件设置、目录创建等步骤,并提供集群配置示例及elasticsearch-head的安装方法。
node1elasticsearch
node2elasticsearch
node3elasticsearch

 

前期准备

  • JDK1.8
  • 修改/etc/security/limits.conf
elasticsearch hard nofile 65536
elasticsearch soft nofile 65536

 1.下载并安装

wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.2.1.rpm
rpm -ivh elasticsearch-5.2.1.rpm

2.修改配置文件/etc/elasticsearch/elasticsearch.yml

cluster.name: test    #集群名称
node.name: es-node1    #(节点名称)每个节点不同
path.data:  /dfs/elasticsearch  #可以指定多个
path.logs:  /dfs/elasticsearch/logs
network.host: 0.0.0.0
http.cors.enabled: true
http.cors.allow-origin: "*"
bootstrap.memory_lock: false
bootstrap.system_call_filter: false
discovery.zen.ping.unicast.hosts: ["node1", "node2", "node3"]

如果调整内存,修改/etc/elasticsearch/jvm.options文件,两个值需要一致。

  -Xms2g
  -Xmx2g

3.创建数据和日志目录

mkdir -p  /dfs/elasticsearch/logs
chown elasticsearch.elasticsearch -R /dfs/elasticsearch

4.修改/etc/init.d/elasticsearch

定义JAVA_HOME
export JAVA_HOME=/path/java(按照实际路径修改)

启动,如果有错误查看日志排错

/etc/init.d/elasticsearch start

5.安装elasticsearch-head,5.x版本elasticsearch-head已经不能作为插件安装了

1.可以使用chrome安装elasticsearch-head插件
https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm

2.使用python启动
git clone git://github.com/mobz/elasticsearch-head.git
cd elasticsearch-head
python -m SimpleHTTPServer
会监听在8000端口,然后访问IP:8000

 

转载于:https://www.cnblogs.com/wsl222000/p/7550923.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值