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

相关推荐
7***q6086 小时前
在linux(Centos)中Mysql的端口修改保姆级教程
linux·mysql·centos
q***65697 小时前
使用Canal将MySQL数据同步到ES(Linux)
linux·mysql·elasticsearch
toooooop88 小时前
CentOS 7 系统上安装 **Nginx + MySQL 5.7 + PHP 7.3 + Redis** 的完整步骤
redis·mysql·nginx·centos·php7
周全全9 小时前
基于ElasticSearch的语义检索学习-向量化数据、向量化相似度、向量化检索
大数据·学习·elasticsearch
TH_110 小时前
腾讯云-(10)-宝塔面板-Docker下安装Elasticsearch
elasticsearch·docker·容器
risc12345610 小时前
【Elasticsearch】AwarenessAllocationDecider 感知分片决策器的处理逻辑
elasticsearch
奔跑吧邓邓子13 小时前
CentOS 7性能飞升秘籍:实战系统优化与调优
linux·运维·centos·实战·系统优化·性能调优
艾莉丝努力练剑15 小时前
【Git:多人协作】Git多人协作实战:从同分支到多分支工作流
服务器·c++·人工智能·git·gitee·centos·项目管理
transitory_truth1 天前
es-api介绍
elasticsearch
q***47181 天前
使用Canal将MySQL数据同步到ES(Linux)
linux·mysql·elasticsearch