言简意赅 Linux部署elasticsearch7.15.2

devtools/2025/3/20 9:07:19/

目录

下载 zip 包

linux 里面解压

进入bin目录

创建用户useres

授权到es目录

切换到useres用户

bin 目录启动

配置 端口开放

配置 jdk

单节点启动 一定要配置

说明成功


byd折磨了我两天

下载 zip 包

通过网盘分享的文件:elasticsearch-7.15.2-linux-x86_64.tar.gz

链接: 百度网盘 请输入提取码

提取码: ke66

linux 里面解压

进入bin目录

cd /www/server/elasticsearch/elasticsearch-7.15.2/bin

创建用户useres

useradd useres

授权到es目录

要在elasticsearch-7.15.2 的父级目录授权

chown useres:useres -R elasticsearch-7.15.2

切换到useres用户

su useres

bin 目录启动

注意我的细节

找到 bin 目录

./elasticsearch -d

配置 端口开放

编辑conf/elasticsearch.yml文件

# 取消注释,默认只能本地访问,修改为0.0.0.0,外网也能访问
network.host: 0.0.0.0  

配置 jdk

elasticsearch 是 Java 强绑定应用

适配 java17

优先找系统目录下的 java

我们要修改绑定到elasticsearch 目录下的 java

1. 进入bin目录

2.修改elasticsearch-env配置

1. 进入bin目录cd /usr/local/elasticsearch-7.14.0/bin2.修改elasticsearch-env配置vim ./elasticsearch-env# 将jdk修改为es中自带jdk的配置目录,es自带的jdk位置/usr/local/es/elasticsearch-7.14.0/jdk# now make ES_HOME absolute
ES_HOME=`cd "$ES_HOME"; pwd`while [ "`basename "$ES_HOME"`" != "bin" ]; doES_HOME=`dirname "$ES_HOME"`
done
ES_HOME=`dirname "$ES_HOME"`# now set the classpath
ES_CLASSPATH="$ES_HOME/lib/*"# now set the path to java
if [ ! -z "$ES_JAVA_HOME" ]; thenJAVA="$ES_JAVA_HOME/bin/java"JAVA_TYPE="ES_JAVA_HOME"
elif [ ! -z "$JAVA_HOME" ]; then# fallback to JAVA_HOMEecho "warning: usage of JAVA_HOME is deprecated, use ES_JAVA_HOME" >&2#JAVA="$JAVA_HOME/bin/java"
# 将jdk修改为es中自带jdk的配置目录JAVA="/usr/local/es/elasticsearch-7.14.0/jdk/bin/java"JAVA_TYPE="JAVA_HOME"
else# use the bundled JDK (default)if [ "$(uname -s)" = "Darwin" ]; then# macOS has a different structure#JAVA="$ES_HOME/jdk.app/Contents/Home/bin/java"
# 将jdk修改为es中自带jdk的配置目录JAVA="/usr/local/es/elasticsearch-7.14.0/jdk/bin/java"else#JAVA="$ES_HOME/jdk/bin/java"
# 将jdk修改为es中自带jdk的配置目录JAVA="/usr/local/es/elasticsearch-7.14.0/jdk/bin/java"fiJAVA_TYPE="bundled JDK"
fi
# 将jdk修改为es中自带jdk的配置目录JAVA="/usr/local/es/elasticsearch-7.14.0/jdk/bin/java"

单节点启动 一定要配置

# ======================== 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:
#
#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):
#
#path.data: /path/to/data
#
# Path to log files:
#
#path.logs: /path/to/logs
#
# ----------------------------------- Memory -----------------------------------
#
# Lock the memory on startup:
#
#bootstrap.memory_lock: true
#
# 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.
#
# 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:
#
network.host: 0.0.0.0
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
#
#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]"]
#
#discovery.seed_hosts: ["host1", "host2"]
#
# Bootstrap the cluster using an initial set of master-eligible nodes:
#
#cluster.initial_master_nodes: ["node-1", "node-2"]
cluster.initial_master_nodes: ["node-1"]
#
# For more information, consult the discovery and cluster formation module documentation.
#
# ---------------------------------- Various -----------------------------------
#
# Require explicit names when deleting indices:
#
#action.destructive_requires_name: true

说明成功


http://www.ppmy.cn/devtools/168583.html

相关文章

【SpringCloud】服务注册/服务发现

文章目录 前言什么是注册中心CAP理论Eureka搭建Eureka Server服务注册服务发现 前言 在生活中,我们不可避免地与各种医院、学校、政府等机构打交道,那么要想与这些机构取得联系,就需要知道这些机构的电话号码,但是这些机构的电话…

掌握些许 IPv6 要点,windows 远程桌面安全便利两相宜!

掌握这些要点,Windows 远程桌面安全便利两相宜! 在日常办公中,许多人会用到 Windows 系统的远程桌面功能。但在实际使用时,会遇到内网计算机难以通过运营商的动态 ip 与多层 NAT 向互联网暴露端口的技术问题,和计算机…

Oracle ASM Failgroup故障组

Oracle ASM Failgroup故障组 1. 故障组的核心作用2. 故障组的配置规则3. 故障组的设计最佳实践4. 故障组的实际示例场景1:普通冗余(2个故障组)场景2:高冗余(3个故障组,跨数据中心) 关键注意事项…

pfsense部署三(snort各版块使用)

在上篇文章上我们已经进行了snort的基础配置了,接下来需要进行snort的具体配置,其中包括各板块的设置,例:白名单,警报,规则设置等 规则库配置 点击 service > snort > Global Settings ,在code值…

python函数的多种参数使用形式

目录 1. 位置参数(Positional Arguments) 2. 关键字参数(Keyword Arguments) 3. 默认参数(Default Arguments) 4. 可变参数(Variable Positional Arguments) 5. 关键字可变参数&…

openpnp - 如果安装面的钣金接触面不平,可以尝试加垫片

文章目录 openpnp - 如果安装面的钣金接触面不平,可以尝试加垫片概述吐槽备注END openpnp - 如果安装面的钣金接触面不平,可以尝试加垫片 概述 在X轴导轨上,架上百分表,打设备的工作平面的平面度,发现工作平面不平(和…

蓝桥杯刷题——第十五届蓝桥杯大赛软件赛省赛C/C++ 大学 B 组

一、0握手问题 - 蓝桥云课 算法代码&#xff1a; #include <iostream> using namespace std; int main() {int sum0;for(int i49;i>7;i--)sumi;cout<<sum<<endl;return 0; } 直接暴力&#xff0c;题意很清晰&#xff0c;累加即可。 二、0小球反弹 - 蓝…

Windows 图形显示驱动开发-WDDM 3.0功能- 硬件翻转队列(五)

翻转队列日志 DDI 添加了以下与翻转队列日志相关的回调和相关结构&#xff1a; DXGKDDI_SETFLIPQUEUELOGBUFFERDXGKARG_SETFLIPQUEUELOGBUFFERDXGK_FLIPQUEUE_LOG_ENTRYDXGKDDI_UPDATEFLIPQUEUELOGDXGKARG_UPDATEFLIPQUEUELOG KMD 提供了一个指向其在 DRIVER_INITIALIZATION…