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

相关推荐
岳涛8 小时前
考古|ES 0.90 的 _ttl 让文档到期自动删,2.0 起引擎只做引擎,5.0 清掉内置字段
elasticsearch
wuyk5559 小时前
Spider-第14讲-表单提交与CSRF
前端·爬虫·python·elasticsearch·csrf
岳涛10 小时前
时序|ES 9.1 存下写坏的文档,响应码从 400 变成 201,写入端仍当它成功
elasticsearch
Elasticsearch12 小时前
九条 ES|QL 查询,揭示你的 Foundry agent 的词元消耗去向
elasticsearch
顧棟1 天前
【ES实战】 索引模板「可追溯、可校验」:一种模板治理的工程化思路
java·数据库·elasticsearch
新*2 天前
520 万数据迁移实战:Elasticsearch 索引重建与"改名"的完整踩坑记录
python·mysql·elasticsearch·数据迁移
阿里云大数据AI技术2 天前
云栖实录|倍思科技 × 阿里云:让VOC洞察从“生成报告”走向“业务可用”
人工智能·elasticsearch·agent
大雪冬至686061258872 天前
【一次 Elasticsearch 高基数聚合慢查询的定位与优化】
elasticsearch
Elasticsearch2 天前
Elasticsearch:如何使用 Connectors 接入数据到 Elastic Agent builder 里进行企业搜索
elasticsearch
wuyk5553 天前
Spider-第11讲-工程化改造与可维护性
大数据·爬虫·elasticsearch·搜索引擎