Elasticsearch02:ES安装部署【单机】
一、ES安装部署【单机】
1、下载
ES支持单机和集群,在使用层面是完全一样的。
首先下载ES的安装包,目前ES最新版本是7.x,在这使用7.13.4版本。
(1)百度网盘地址:
链接:https://pan.baidu.com/s/1rnvMTGm5CYAh0GfdNDHx-g?pwd=d8xv
提取码:d8xv
(2)官网下载地址:
https://www.elastic.co/cn/downloads/past-releases#elasticsearch
选择ES的对应版本。
ES 7.13.4版本的安装包下载地址为:
https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.13.4-linux-x86_64.tar.gz
注意:目前ES中自带的有open JDK,不用单独安装部署Oracle JDK。
2、分析一下ES中的核心配置文件
在具体安装集群之前,先来分析一下ES中的核心配置文件:
在ES_HOME的config目录下有一个elasticsearch.yml配置文件,这个文件是一个yaml格式的文件。
elasticsearch.yml文件内容如下:
# ======================== Elasticsearch Configuration =========================
#
# NOTE: Elasticsearch comes with reasonable defaults for most settings.
# Before you set out to tweak and tune the configuration, make sure you
# understand what are you trying to accomplish and the consequences.
#
# The primary way of configuring a node is via this file. This template lists
# the most important settings you may want to configure for a production cluster.
#
# Please consult the documentation for further information on configuration options:
# https://www.elastic.co/guide/en/elasticsearch/reference/index.html
#
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
# 集群名称,默认是elasticsearch,如果想要将多个ES实例组成一个集群,那么它们的cluster.name必须一致
#cluster.name: my-application
#
# ------------------------------------ Node ------------------------------------
#
# Use a descriptive name for the node:
# 节点名称,可以手工指定,默认也会自动生成
#node.name: node-1
#
# Add custom attributes to the node:
# 给节点指定一些自定义的参数信息
#node.attr.rack: r1
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
# 可以指定ES的数据存储目录,默认存储在ES_HOME/data目录下
#path.data: /path/to/data
#
# Path to log files:
# 可以指定ES的日志存储目录,默认存储在ES_HOME/logs目录下
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
# 锁定物理内存地址,防止ES内存被交换出去,也就是避免ES使用swap交换分区中的内存
#bootstrap.memory_lock: true
# 确保ES_HEAP_SIZE参数设置为系统可用内存的一半左右
# Make sure that the heap size is set to about half the memory available
# on the system and that the owner of the process is allowed to use this
# limit.
# 当系统进行内存交换的时候,会导致ES的性能变的很差
# Elasticsearch performs poorly when the system is swapping the memory.
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
# 为ES设置绑定的IP,默认是127.0.0.1,也就是默认只能通过127.0.0.1 或者localhost才能访问
# ES 1.x版本默认绑定的是0.0.0.0,但是从ES 2.x版本之后默认绑定的是127.0.0.1
#network.host: 192.168.0.1
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
# 为ES服务设置监听的端口,默认是9200
# 如果想要在一台机器上启动多个ES实例,需要修改此处的端口号
#http.port: 9200
#
# For more information, consult the network module documentation.
#
# --------------------------------- Discovery ----------------------------------
#
# Pass an initial list of hosts to perform discovery when this node is started:
# The default list of hosts is ["127.0.0.1", "[::1]"]
#
# 当启动新节点时,通过这个ip列表进行节点发现,组建集群
# 默认ip列表:
# 127.0.0.1,表示ipv4的本地回环地址。
# [::1],表示ipv6的本地回环地址。
# 在ES 1.x中默认使用的是组播(multicast)协议,默认会自动发现同一网段的ES节点组建集群。
# 从ES 2.x开始默认使用的是单播(unicast)协议,想要组建集群的话就需要在这指定要发现的节点信息了。
#
# 指定想要组装成一个ES集群的多个节点信息
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
# 初始化一批具备成为主节点资格的节点【在选择主节点的时候会优先在这一批列表中进行选择】
#cluster.initial_master_nodes: ["node-1", "node-2"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
# 禁止使用通配符或_all删除索引, 必须使用名称或别名才能删除该索引。
#action.destructive_requires_name: true
1、上传安装包
将ES的安装包上传到bigdata01的/data/soft目录下
[root@bigdata01 soft]# ll elasticsearch-7.13.4-linux-x86_64.tar.gz
-rw-r--r--. 1 root root 327143992 Sep 2 2021 elasticsearch-7.13.4-linux-x86_64.tar.gz
2、创建es用户
在Linux中添加一个普通用户:es。
因为ES目前不支持root用户启动。
[root@bigdata01 soft]# useradd -d /home/es -m es
[root@bigdata01 soft]# passwd es
Changing password for user es.
New password: bigdata1234
Retype new password: bigdata1234
passwd: all authentication tokens updated successfully.
3、修改参数
修改Linux中最大文件描述符以及最大虚拟内存的参数
因为ES对Linux的最大文件描述符以及最大虚拟内存有一定要求,所以需要修改,否则ES无法正常启动。
[root@bigdata01 soft]# vi /etc/security/limits.conf
* soft nofile 65536
* hard nofile 131072
* soft nproc 2048
* hard nproc 4096
[root@bigdata01 soft]# vi /etc/sysctl.conf
vm.max_map_count=262144
4、重启系统
重启Linux系统。
前面修改的参数需要重启系统才会生效。
[root@bigdata01 soft]# reboot -h now
5、解压安装包
解压ES安装包
[root@bigdata01 soft]# tar -zxvf elasticsearch-7.13.4-linux-x86_64.tar.gz
6、配置java环境变量
配置ES_JAVA_HOME环境变量,指向ES中内置的JDK。
[root@bigdata01 soft]# vi /etc/profile
......
export ES_JAVA_HOME=/data/soft/elasticsearch-7.13.4/jdk
......
[root@bigdata01 soft]# source /etc/profile
7、修改目录权限
修改elasticsearch-7.13.4目录的权限
因为前面是使用root用户解压的,elasticsearch-7.13.4目录下的文件es用户是没有权限的。
[root@bigdata01 soft]# chmod 777 -R /data/soft/elasticsearch-7.13.4
8、切换用户
切换到es用户
[root@bigdata01 soft]# su es
9、修改配置文件
修改elasticsearch.yml配置文件内容
主要修改network.host、discovery.seed_hosts这两个参数。
注意:yaml文件的格式,参数和值之间需要有一个空格。
例如:network.host: bigdata01
bigdata01前面必须要有一个空格,否则会报错。
[es@bigdata01 soft]$ cd elasticsearch-7.13.4
[es@bigdata01 elasticsearch-7.13.4]$ vi config/elasticsearch.yml
......
network.host: bigdata01
discovery.seed_hosts: ["bigdata01"]
…
10、前台启动
启动ES服务【前台启动】
[es@bigdata01 elasticsearch-7.13.4]$ bin/elasticsearch
按ctrl+c停止服务。
11、后台启动
启动ES服务【后台启动】
在实际工作中需要将ES放在后台运行。
[es@bigdata01 elasticsearch-7.13.4]$ bin/elasticsearch -d
12、验证
验证ES服务。
通过jps命令验证进程是否存在。
[es@bigdata01 elasticsearch-7.13.4]$ jps
1849 Elasticsearch
通过web界面验证服务是否可以正常访问,端口为9200。
http://bigdata01:9200/
注意:需要关闭防火墙。
13、停止
停止ES服务。
使用kill命令停止。
[es@bigdata01 elasticsearch-7.13.4]$ jps
1849 Elasticsearch
[es@bigdata01 elasticsearch-7.13.4]$ kill
14、查看日志
日志排查方式。
如果发现ES服务启动有问题,需要查看ES的日志。
ES的相关日志都在ES_HOME的logs目录下,ES服务的核心日志在elasticsearch.log日志文件中。
[root@bigdata01 elasticsearch-7.13.4]# cd logs/
[root@bigdata01 logs]# ll
total 208
-rw-rw-r--. 1 es es 0 Feb 26 10:48 elasticsearch_audit.json
-rw-rw-r--. 1 es es 554 Feb 26 11:20 elasticsearch_deprecation.json
-rw-rw-r--. 1 es es 332 Feb 26 11:20 elasticsearch_deprecation.log
-rw-rw-r--. 1 es es 0 Feb 26 10:48 elasticsearch_index_indexing_slowlog.json
-rw-rw-r--. 1 es es 0 Feb 26 10:48 elasticsearch_index_indexing_slowlog.log
-rw-rw-r--. 1 es es 0 Feb 26 10:48 elasticsearch_index_search_slowlog.json
-rw-rw-r--. 1 es es 0 Feb 26 10:48 elasticsearch_index_search_slowlog.log
-rw-rw-r--. 1 es es 23653 Feb 26 11:10 elasticsearch.log
-rw-rw-r--. 1 es es 42094 Feb 26 11:10 elasticsearch_server.json
-rw-rw-r--. 1 es es 37878 Feb 26 11:10 gc.log
-rw-rw-r--. 1 es es 1996 Feb 26 10:48 gc.log.00
-rw-rw-r--. 1 es es 85728 Feb 26 11:37 gc.log.01
-rw-rw-r--. 1 es es 1996 Feb 26 11:10 gc.log.02
Elasticsearch02:ES安装部署【单机】相关推荐
- zookeeper 日志查看_Linux环境下安装部署单机Zookeeper
解压 tar -zxvf zookeeper-3.4.6.tar.gz https://pan.baidu.com/s/1mxpDlM3klCrSoxXiNjXyCQ 提取码:oztg 2. 重命名z ...
- windows 单机 - elasticsearch-7.11.1 、kibana-7.11.1 安装部署
文章目录 前言 windows 单机 - elasticsearch-7.11.1 .kibana-7.11.1 安装部署 01 elasticsearch-7.11.1 下载安装 01::01 下载 ...
- Storm 04_Storm单机模式搭建完全分布式安装部署集群drpc
一.环境要求 JDK 1.6+ java -version Python 2.6.6+ python -V ZooKeeper3.4.5+ storm 0.9.4+ ----------------- ...
- Spark笔记整理(一):spark单机安装部署、分布式集群与HA安装部署+spark源码编译...
[TOC] spark单机安装部署 1.安装scala 解压:tar -zxvf soft/scala-2.10.5.tgz -C app/ 重命名:mv scala-2.10.5/ scala 配置 ...
- Linux单机到Windows的OGG安装部署步骤
OGG安装部署步骤 (linux单机到windows) 检查 Goldengate通过抓取源端数据库重做日志进行分析,将获取的数据应用到目标端,实现数据同步.因此,源数据库需要必须处于归档模式,并启用 ...
- 使用Docker快速安装部署ES和Kibana并配置IK中文分词器以及自定义分词拓展词库
使用Docker快速安装部署ES和Kibana的前提:首先需要确保已经安装了Docker环境 如果没有安装Docker的话,可以参考上一篇的内容:Linux上安装Docker 有了Docker环境后, ...
- 产品迭代更新 | 阿列夫科技基于Linkis+DataSphere Studio的单机安装部署实战
作者:萧寒 GitHub ID :hx23840 阿列夫科技原来的技术平台是基于 Hadoop,Spark 平台搭建的,为了充分的满足业务需求,做了大量接口封装.但是随着业务发展,现有技术平台日渐满足 ...
- elasticsearch(ES)的安装部署及其插件安装
安装方式 curl -L -O https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-6.6.2.tar.gz 或者官网 ...
- nginx安装部署和配置管理
一.HTTP 介绍 HTTP协议是Hyper Text Transfer Protocol(超文本传输协议)的缩写,是用于从万维网(WWW:World Wide Web )服务器传输超文本到本地浏览器 ...
最新文章
- ACF:让控制台程序变得更为简单
- 【攻防世界016】re2-cpp-is-awesome
- 改进架构,实现动态数据源,减少java维护
- Wannafly挑战赛17
- 【题解】HAOI2007分割矩阵
- Hadoop的安装与配置——设置单节点群集
- Linux新建用户可以在shell中切换到该用户也能登录到图形桌面
- html怎么给没张图片添加单击事件,如何在Canvas上的图形/图像绑定事件监听的实现...
- 关闭 php opcache
- stauml工具怎么导入文件_小伙教大家怎么剪辑短视频,1小时就学会添加字幕,值得收藏哦...
- c++实验8 哈夫曼编码-译码器
- Node.js和io.js将合并到Node基金会下
- android 设置EditText光标位置
- MS SQL Server 游标及实例(四)
- 为什么那么多城市房价开始跌了,还是有人相信房价会一直涨?
- 面向问题编程-切面+反射实现字段级别权限控制
- LoRaWan 硬件和信道特点 TDMA的MAC协议优势
- BZOJ4698 Sdoi2008 Sandy的卡片
- Java基础语法学会了,JavaScript瞄一眼就行,瞅第二眼我看不起你!
- adb模拟三指划动,GKUI19+WHUD,全新智能三屏交互体验