Elasticsearch官网: https://www.elastic.co/products/elasticsearch

一、Linux单节点部署

1. 解压elasticsearch-5.6.1.tar.gz到安装目录下,这里使用的是/opt/module

  $ tar -zxvf elasticsearch-5.6.1.tar.gz -C /opt/module/

2. 在/opt/module/elasticsearch-5.6.1路径下创建data和logs文件夹

  $ mkdir data

  $ mkdir logs

3. 修改配置文件/opt/module/elasticsearch-5.2.2/config/elasticsearch.yml

  $ pwd

  /opt/module/elasticsearch-5.6.1/config

  $ vi elasticsearch.yml

# ---------------------------------- Cluster -------------------------

cluster.name: my-application

# ------------------------------------ Node --------------------------------------

node.name: node-102

# ----------------------------------- Paths ---------------------------------------

path.data: /opt/module/elasticsearch-5.6.1/data

path.logs: /opt/module/elasticsearch-5.6.1/logs

# ----------------------------------- Memory -----------------------------------

bootstrap.memory_lock: false

bootstrap.system_call_filter: false

# ---------------------------------- Network ------------------------------------

network.host: 192.168.1.102

# --------------------------------- Discovery ------------------------------------

discovery.zen.ping.unicast.hosts: ["hadoop102"]

解释:

(1)cluster.name:集群名称,如果要配置集群需要两个节点上的elasticsearch配置的cluster.name相同,都启动可以自动组成集群,这里如果不改cluster.name则默认是cluster.name=my-application。

(2)nodename:节点名称,随意取名字,但是集群内的各节点不能相同。

(3)修改后的每行前面不能有空格,修改后的“:”后面必须有一个空格

4.  配置linux系统环境(为了避免Elasticsearch在使用资源时受限,参考:http://blog.csdn.net/satiling/article/details/59697916)

(1)编辑limits.conf 添加类似如下内容

  $ sudo vi /etc/security/limits.conf

  添加如下内容:

  * soft nofile 65536

  * hard nofile 131072

  * soft nproc 4096

  * hard nproc 4096

(2)进入limits.d目录下修改配置文件。(看一下limits.d,可能名字并不是90-nproc.conf)

  $ sudo vi /etc/security/limits.d/90-nproc.conf

  修改如下内容:

    * soft nproc 1024

  修改为

    * soft nproc 4096

(3)修改配置sysctl.conf

  $ sudo vi /etc/sysctl.conf

  添加下面配置:

    vm.max_map_count=655360

  并执行命令:

    $ sudo sysctl -p

  然后,重新启动elasticsearch,即可启动成功。

5. 启动elasticsearch

  $ cd /opt/module/elasticsearch-5.6.1

  $ bin/elasticsearch

6. 测试elasticsearch

  curl http://hadoop102:9200

  curl -XGET 'localhost:9200/_cat/health?v&pretty'

二、安装Elasticsearch(多节点集群Linux环境)

1. 分发Elasticsearch安装包至hadoop103和hadoop104

  $ xsync elasticsearch-5.6.1/

2. 修改hadoop102配置信息

  $ vi elasticsearch.yml

  添加如下信息:

    node.master: true

    node.data: true

3. 修改hadoop103配置信息

(1)修改Elasticsearch配置信息

  $ vi elasticsearch.yml

    node.name: node-103

    node.master: false

    node.data: true

    network.host: 192.168.1.103

(2)修改Linux相关配置信息(同hadoop102)

4. 修改hadoop104配置信息

(1)修改Elasticsearch配置信息

 $ vi elasticsearch.yml

  node.name: node-104

  node.master: false

  node.data: true

  network.host: 192.168.1.104

(2)修改Linux相关配置信息(同hadoop102)

5. 分别启动三台节点的Elasticsearch

 三、启动异常

1. 使用root用户启动失败

  elasticsearch是不支持使用root账号启动程序的,会报错:“Caused by: java.lang.RuntimeException: can not run elasticsearch as root”:

  解决办法:切换到其他用户启动。

2. elasticsearch安装目录权限不对

  如果elasticsearch就是使用root账号部署的,启动时就会出报错:

  Exception in thread "main" 2018-06-03 17:36:23,881 main ERROR No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.

  Caused by: java.nio.file.AccessDeniedException: /usr/local/elasticsearch-5.6.0/config/elasticsearch.yml

  解决办法:

  查看文件权限,命令 # ll /usr/local/

    drwxr-xr-x  7 root root       123 4月   7 2018 elasticsearch-5.6.2

  说明这个文件夹属于root用于,其他用户没权限执行,修改文件权限命令如下,elk是用户名:

  chown  -R elk:elk elasticsearch-5.6.0

 

一、elasticsearch部署的更多相关文章

  1. ElasticSearch部署文档(Ubuntu 14.04)

    ElasticSearch部署文档(Ubuntu 14.04) 参考链接 https://www.elastic.co/guide/en/elasticsearch/guide/current/hea ...

  2. Centos7 Elasticsearch部署

    (1)ELKStack简介 1.elk介绍 ELK Stack包含:ElasticSearch.Logstash.Kibana ElasticSearch是一个搜索引擎,用来搜索.分析.存储日志.它是 ...

  3. elasticsearch 部署

    环境 ubuntu 12.04 64位 桌面版 jdk 1.7 elasticsearch 2.3.4 伪集群部署 elasticsearch 主目录在 /home/sdbadmin/es-clute ...

  4. Elasticsearch部署异常Permission denied

    异常描述 在Linux上部署ElasticSearch时抛出了一个异常如下: log4j:ERROR setFile(null,true) call failed. java.io.FileNotFo ...

  5. Elasticsearch 部署以及报错解决

    前言 Elasticsearch 是一个非常值得学习和使用的分布式存储 此次部署将采用 centos6.9 一.初步了解 ES 简谈概念 Elasticsearch 是一个开源的高扩展的分布式全文检索 ...

  6. 第一章·ELKstack介绍及Elasticsearch部署

    一.ELKstack课程大纲  二.ELKstack简介 什么是ELK? 通俗来讲,ELK是由Elasticsearch.Logstash.Kibana 三个开源软件的组成的一个组合体,这三个软件当 ...

  7. ElasticSearch部署安装

    测试版本:elasticsearch-5.1.1 1.Windows环境下安装(win10系统) 1)解压elasticsearch-5.1.1.zip. 2)执行elasticsearch.bat启 ...

  8. ELK日志管理之——elasticsearch部署

    1.配置官方yum源 [root@localhost ~]# rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch ...

  9. ElasticSearch部署

    安装jdk1.7 1.卸载Liunx自带的openjdk rpm -qa | grep jdk 查看当前的jdk版本 sudo yum -y remove java-1.7.0-openjdk-hea ...

随机推荐

  1. beautiful numbers树形dp or 数位dp

    题目找链接 题意: 如果数a能被a中的每一位数整除(0除掉),则称a是一个beautiful number,求一个区间内的beautiful numbers的个数. 分析: 首先,很显然,l到r的所有 ...

  2. MySQL 快速删除大量数据(千万级别)的几种实践方案

    笔者最近工作中遇见一个性能瓶颈问题,MySQL表,每天大概新增776万条记录,存储周期为7天,超过7天的数据需要在新增记录前老化.连续运行9天以后,删除一天的数据大概需要3个半小时(环境:128G, ...

  3. 云小课 | “VPC连接”知多少

    摘要:华为云提供了丰富的网络服务,可满足多种网络互连场景. 同Region的两个VPC怎么连通?” “跨Region的两个VPC又怎么连通?” “VPC内的ECS搭建了一个应用,需要访问Interne ...

  4. adb devices 不能连接设备 could not install *smartsocket* listener

    cmd以管理员身份运行命令adb devices  或adb reverse tcp:8081 tcp:8081,无法连接设备,出现上图信息. 输入命令:adb kill-server 再输入:adb ...

  5. WPF 2D纹理的准确映射

    TextureCoordinates定义了如何将一副2D纹理映射到所建立的3D网格上,TextureCoordinates为Positions集合中的每一个3D顶点提供了一个2D顶点. 映射时方向确定 ...

  6. CSS学习之选择器优先级与属性继承

    CSS学习之选择器优先级与属性继承 选择器优先级 其实选择器是具有优先级的,我们来看下面这一组案例: <!DOCTYPE html> <html lang="en" ...

  7. python 装饰器(六):装饰器实例(三)内置装饰器

    内置的装饰器和普通的装饰器原理是一样的,只不过返回的不是函数,而是类对象,所以更难理解一些. @property 在了解这个装饰器前,你需要知道在不使用装饰器怎么写一个属性. def getx(sel ...

  8. Active Directory - Creating Public and Personnel Share Folders via Script

    Create and save the following scripts on the DC folder \\Winsever2019\sysvol\pandabusiness.local\scr ...

  9. Python Ethical Hacking - NETWORK_SCANNER(2)

    DICTIONARIES Similar to lists but use key instead of an index. LISTS List of values/elements, all ca ...

  10. Python Ethical Hacking - BeEF Framework(2)

    Basic BeEF commands: Login the BeEF Control Panel, and go to Commands page. Create Alert Dialog: Run ...