centos安装ES

  1. https://www.elastic.co/cn/downloads/past-releases#elasticsearch 选择elasticsearch+版本 下载
复制代码
   tar -zxvf elasticsearch-
   mv elasticsearch-8.0.0 /usr/local/elasticsearch-8.0
   cd /usr/local/elasticsearch-8.0/
   mkdir data
   mkdir log
   cd config/

   vim elasticsearch.yml
   path.data: /usr/local/elasticsearch-8.0/data
   path.logs: /usr/local/elasticsearch-8.0/log
   `#开启xpack`
   xpack.security.enabled: false 
   xpack.security.transport.ssl.enabled: false 
   `#允许跨域`
   http.cors.enabled: true 
   http.cors.allow-origin: "*" 
   http.cors.allow-headers: Authorization,X-Requested-With,Content-Type,Content-Length
  1. 在 /etc/systemd/system/ 目录中创建一个名为 elasticsearch.service 的文件

    vim /etc/systemd/system/elasticsearch.service

将以下内容复制进 'elasticsearch.service' 文件中:

复制代码
[Unit]
Description=elasticsearch
After=network.target

[Service]
Type=forking
User=es
ExecStart=/home/elasticsearch/bin/elasticsearch -d
PrivateTmp=true
# 进程可以打开的最大文件数
LimitNOFILE=65535
# 进程可以打开的最大进程数
LimitNPROC=65535
# 最大虚拟内存
LimitAS=infinity
# 最大文件大小
LimitFSIZE=infinity
# 超时设置 0-永不超时
TimeoutStopSec=0
# SIGTERM是停止java进程的信号
KillSignal=SIGTERM
# 信号只发送给给JVM
KillMode=process
# java进程不会被杀掉
SendSIGKILL=no
# 正常退出状态
SuccessExitStatus=143
# 开机自启动
[Install]
WantedBy=multi-user.target

重新加载服务的配置文件

复制代码
systemctl daemon-reload

注册启用服务:

复制代码
systemctl enable elasticsearch

使用以下命令来管理Elasticsearch服务:

复制代码
systemctl start elasticsearch
systemctl stop elasticsearch
  • 需要切换到User=es来使用启动命令

    systemctl restart elasticsearch
    systemctl status elasticsearch

相关推荐
追巨16 小时前
单节点elasticsearch安装笔记
大数据·elasticsearch·jenkins
鱼锦0.016 小时前
Coreseek和Elasticsearch 有什么区别
大数据·elasticsearch·jenkins
键盘上的猫头鹰16 小时前
【Linux 基础教程(一)】概述、安装与网络配置:VMware + CentOS + NAT + XShell 远程连接
linux·网络·centos
不做无法实现的梦~16 小时前
Git Clone 使用 Watt/Steam++ 加速时报证书错误的原因与解决方法
大数据·git·elasticsearch
隔窗听雨眠17 小时前
CentOS Stream 9 服务器 Docker 部署 KaiwuDB 实战
服务器·docker·centos
木卫二号Coding18 小时前
第八十五篇-CentOS-7 + Tesla V100 环境下 Docker 容器内编译部署 Qwen3.6-27B-MTP 大模型实战指南
linux·docker·centos
流觞 无依18 小时前
CentOS 7 系统中 systemd 组件的 CVE-2022-2526 漏洞修复
linux·运维·centos
逸Y 仙X18 小时前
文章七:ElasticSearch 集群监控指标
大数据·elasticsearch·搜索引擎
chushiyunen18 小时前
elasticsearch笔记
笔记·elasticsearch·jenkins