部署环境
系统: Debian 11.1
elasticsearch: v7.17.1
JAVA: v11.0.14导入GPG Key
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo gpg --dearmor -o /usr/share/keyrings/elasticsearch-keyring.gpg
安装 apt-transport-https
sudo apt-get install apt-transport-https
添加软件源列表
sudo echo "deb [signed-by=/usr/share/keyrings/elasticsearch-keyring.gpg] https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-7.x.list
安装elasticsearch
sudo apt-get update && sudo apt-get install elasticsearch
配置elasticsearch
路径: /etc/elasticsearch
主要有以下几个配置文件:
elasticsearch.yml
这里我们主要按照seafile官方docker版的参数需求修改:
# 数据存放路径
path.data: /data/elasticsearch-data
# 其他相关参数
bootstrap.memory_lock: true
discovery.type: single-node
xpack.security.enabled: truejvm.options
官方建议不要直接修改jvm.options,而是在 jvm.options.d里创建 .options文件
# 创建文件
vim /etc/elasticsearch/jvm.option.d/seafile.options只是用于seafile的文件检索,服务器资源有限,这里我只填了限制内存使用的参数
-Xms256m
-Xmx256mlog4j2.properties
这个不用关注,用于配置elasticsearch日志功能