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

相关推荐
蜡台5 小时前
VirtualBox Centos8 配置互联网访问和局域网访问
centos·虚拟机·vbox
Elastic 中国社区官方博客7 小时前
将 Vercel 数据导入 Elastic:无需安装任何东西的无服务器可观测性
大数据·运维·elasticsearch·搜索引擎·云原生·serverless·全文检索
Elasticsearch8 小时前
我们如何将 PromQL 构建到 Elasticsearch 中
elasticsearch
Elasticsearch8 小时前
你和你的 AI agent 不应该使用 curl:介绍 Elastic CLI 和 Agent Skills
elasticsearch
yunqiz1 天前
ELK Stack生产环境部署指南:Filebeat + Elasticsearch + Logstash + Kibana
elk·elasticsearch
闲云野鹤在人间1 天前
Docker入门|第3章 镜像详解
linux·网络·docker·容器·centos·云计算·php
dongsdh2 天前
部署python
大数据·elasticsearch·搜索引擎
听到微笑2 天前
Elasticsearch 如何存储与检索海量向量
数据库·elasticsearch
知福致福2 天前
【技术复盘】Git 分支污染与提交污染事故排查与解法
大数据·git·elasticsearch
闲云野鹤在人间2 天前
Docker入门|第1章 容器生态系统完整解析
运维·服务器·docker·容器·centos