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 中国社区官方博客3 小时前
使用 Discord 和 Elastic Agent Builder A2A 构建游戏社区支持机器人
人工智能·elasticsearch·游戏·搜索引擎·ai·机器人·全文检索
xuefuhe11 小时前
RHEL9 yum install etcd Error: Unable to find a match: etcd
linux·运维·centos
顾西爵霞13 小时前
远程访问centos7并连接Mariadb
数据库·centos·mariadb
*crzep15 小时前
Elasticsearch使用Apifox发送请求
elasticsearch·apifox
Dxy123931021615 小时前
告别重启!Elasticsearch 8.10 杀手级特性:动态同义词(Dynamic Synonyms)深度解析
大数据·elasticsearch·jenkins
宇神城主_蒋浩宇15 小时前
最简单的es理解 数据库视角看写 ES 加 java正删改查深度分页
大数据·数据库·elasticsearch
TongSearch16 小时前
TongSearch中分片从何而来,又解决了什么问题
java·elasticsearch·tongsearch
码农不惑17 小时前
systemd升级造成的centos-bootc系统的内核故障
linux·centos·bootc
hunter145017 小时前
docker 在centos和ubuntu的安装
linux·docker·centos
GeminiJM17 小时前
亿级向量检索:Elasticsearch vs. Milvus,性能鸿沟与架构抉择
elasticsearch·架构·milvus