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

相关推荐
Elastic 中国社区官方博客18 小时前
Elastic 重大事件功能如何将 100 条日志样本转化为检测规则
大数据·运维·数据库·人工智能·elasticsearch·搜索引擎
Elasticsearch21 小时前
使用 OpenTelemetry 在 Elastic 中实现 Claude 平台的人工智能 agent 可观测性
elasticsearch
Linux界最忧郁之人21 小时前
OpenStack Victoria双节点实战|Packstack一键部署(CentOS‑Stream‑8)+华为云ECS实操
linux·运维·服务器·centos·华为云·openstack
keyipatience1 天前
Git学习(2)撤销与分支操作全指南
大数据·elasticsearch·搜索引擎
加洛斯2 天前
万字推演Elasticsearch修炼方法,从炼气到元婴
后端·elasticsearch·面试
oyzz1202 天前
CentOS Stream 9 配置静态 IP 口令是多少
linux·tcp/ip·centos
说实话起个名字真难啊2 天前
Git常用小问题笔记
笔记·git·elasticsearch
Elasticsearch2 天前
三个区域、三个 Kibana、一个视图:跨集群搜索登陆 Elastic 合成监测
elasticsearch
keyipatience2 天前
Git学习(3)合并冲突全解析:从原理到实战解决
大数据·elasticsearch·搜索引擎
_小许_2 天前
Linux 常用命令速查:CentOS 与 Ubuntu 双线对照
linux·ubuntu·centos