一、elasticsearch部署
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部署的更多相关文章
- ElasticSearch部署文档(Ubuntu 14.04)
ElasticSearch部署文档(Ubuntu 14.04) 参考链接 https://www.elastic.co/guide/en/elasticsearch/guide/current/hea ...
- Centos7 Elasticsearch部署
(1)ELKStack简介 1.elk介绍 ELK Stack包含:ElasticSearch.Logstash.Kibana ElasticSearch是一个搜索引擎,用来搜索.分析.存储日志.它是 ...
- elasticsearch 部署
环境 ubuntu 12.04 64位 桌面版 jdk 1.7 elasticsearch 2.3.4 伪集群部署 elasticsearch 主目录在 /home/sdbadmin/es-clute ...
- Elasticsearch部署异常Permission denied
异常描述 在Linux上部署ElasticSearch时抛出了一个异常如下: log4j:ERROR setFile(null,true) call failed. java.io.FileNotFo ...
- Elasticsearch 部署以及报错解决
前言 Elasticsearch 是一个非常值得学习和使用的分布式存储 此次部署将采用 centos6.9 一.初步了解 ES 简谈概念 Elasticsearch 是一个开源的高扩展的分布式全文检索 ...
- 第一章·ELKstack介绍及Elasticsearch部署
一.ELKstack课程大纲  二.ELKstack简介 什么是ELK? 通俗来讲,ELK是由Elasticsearch.Logstash.Kibana 三个开源软件的组成的一个组合体,这三个软件当 ...
- ElasticSearch部署安装
测试版本:elasticsearch-5.1.1 1.Windows环境下安装(win10系统) 1)解压elasticsearch-5.1.1.zip. 2)执行elasticsearch.bat启 ...
- ELK日志管理之——elasticsearch部署
1.配置官方yum源 [root@localhost ~]# rpm --import http://packages.elasticsearch.org/GPG-KEY-elasticsearch ...
- ElasticSearch部署
安装jdk1.7 1.卸载Liunx自带的openjdk rpm -qa | grep jdk 查看当前的jdk版本 sudo yum -y remove java-1.7.0-openjdk-hea ...
随机推荐
- Github 新玩法 -- Profile ReadMe
Github 新玩法 -- Profile ReadMe Intro 今天刷 Github 的时候偶然发现一个新的玩法,Github Profile ReadMe,可以在个人的 Profile 页面展 ...
- HTB::Postman
实验环境 渗透过程 0x01 信息搜集 masscan扫描 扫描结果目标服务开放了22(ssh),80(http),6379(redis),10000(webmin)端口 nmap扫描 nmap -s ...
- 数据可视化之DAX篇(二十六)Power BI度量值:滚动聚合
https://zhuanlan.zhihu.com/p/85996745 上一篇文讲了累计聚合,这篇文章继续讲一下滚动聚合,比如常用的MAT计算,Moving Annual Total,滚动年度总计 ...
- typeError:The value of a feed cannot be a tf.Tensor object.Acceptable feed values include Python scalars,strings,lists.numpy ndarrays,or TensorHandles.For reference.the tensor object was Tensor...
如上贴出了:错误信息和错误代码. 这个问题困扰了自己两天,报错大概是说输入的数据和接受的格式不一样,不能作为tensor. 后来问了大神,原因出在tf.reshape(),因为网络训练时用placeh ...
- 小谢第36问:elemet - table表格修改后表格行高亮显示且定位到当前行当前页
第一次做这个需求得时候很乱,总是在表格页和修改页徘徊,总觉得什么都会,但是就是做不出自己想要得效果 其实如果先把思路搞清楚,这个问题得知识点却是不多,以下是我对表格高亮显示得思路: 首先,我会从已知得 ...
- Python Ethical Hacking - Persistence(2)
Polish the Python code by adding the become_persistent function. #!/usr/bin/env python import json i ...
- HDOJ 1051. Wooden Sticks
题目 There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The ...
- CUDA Programming Guide 学习笔记
CUDA学习笔记 GPU架构 GPU围绕流式多处理器(SM)的可扩展阵列搭建,每个GPU有多个SM,每个SM支持数百个线程并发执行.目前Nvidia推出了6种GPU架构(按时间顺序,详见下图):Fer ...
- 时间序列知识图谱-《利用Python进行数据分析》
所有内容整理自<利用Python进行数据分析>,使用MindMaster Pro 7.3制作,emmx格式,源文件已经上传Github,需要的同学转左上角自行下载或者右击保存图片. 其他章 ...
- 【JVM之内存与垃圾回收篇】类加载子系统
类加载子系统 概述 完整图如下: 如果自己想手写一个 Java 虚拟机的话,主要考虑哪些结构呢? 类加载器 执行引擎 类加载器子系统作用 类加载器子系统负责从文件系统或者网络中加载 Class 文件, ...