OpenKylin安装Elastic Search8

一、环境准备

Java安装

安装过程此处不做赘述,使用以下命令检查是否安装成功。

bash 复制代码
java -version

注意:Elasticsearch 自 7.0 版本起内置了 OpenJDK,无需单独安装。但如需自定义 JDK,可设置 JAVA_HOME。

二、安装Elasticsearch

1、下载解压

bash 复制代码
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-8.17.0-linux-x86_64.tar.gz
tar -zxvf elasticsearch-8.17.0-linux-x86_64.tar.gz

2、系统配置

修改文件描述符限制,编辑 /etc/security/limits.conf,添加以下内容:

bash 复制代码
[用户名] soft memlock unlimited
[用户名] hard memlock unlimited
例如:
elasticsearch soft memlock unlimited
elasticsearch hard memlock unlimited

修改虚拟内存区域限制:编辑 /etc/sysctl.conf,添加以下内容:

bash 复制代码
vm.max_map_count=262144

3、创建专有用户

Elasticsearch 不允许以 root 运行

bash 复制代码
useradd elasticsearch
chown -R elasticsearch:elasticsearch ./elasticsearch

三、配置Elasticsearch

1、修改配置文件 config/elasticsearch.yml

bash 复制代码
# 集群名称(同一集群需一致)
cluster.name: my-application
# 节点名称
node.name: node-1
# 数据存储路径
path.data: /var/data/elasticsearch
# 日志存储路径
path.logs: /var/log/elasticsearch
# 绑定 IP(允许外部访问)
network.host: 0.0.0.0
# HTTP 端口
http.port: 9200
# 集群初始主节点(单节点时配置)
discovery.seed_hosts: ["127.0.0.1"]
cluster.initial_master_nodes: ["node-1"]
# 启用安全功能(8.x 默认开启),可以关闭,使用Kibana同步关闭
xpack.security.enabled: false

2、配置 JVM 参数(可选)

编辑 config/jvm.options,调整堆内存(建议不超过物理内存的 50%):

bash 复制代码
-Xms4g
-Xmx4g

四、启动Elasticsearch

1、启动

bash 复制代码
# 切换用户
su elasticsearch

# 前台启动
cd /path/elasticsearch
bin/elasticsearch

# 后台启动
bin/elasticsearch -d

2、访问:http://IP:9200进行验证

五、Kibana集成(可选)

1、下载解压

bash 复制代码
wget https://artifacts.elastic.co/downloads/kibana/kibana-8.17.0-linux-x86_64.tar.gz
tar -zxvf kibana-8.17.0-linux-x86_64.tar.gz

2、修改配置

bash 复制代码
server.port: 5601
server.host: "0.0.0.0"
elasticsearch.hosts: ["https://localhost:9200"]

3、启动Kibana

bash 复制代码
前台启动
./bin/kibana
后台启动
nohup ./bin/kibana > /dev/null 2>&1 &

4、验证

访问http://IP:5601/app/home#/

相关推荐
Elasticsearch7 小时前
Elastic 获得全新的 AWS 数据能力认证
elasticsearch
Elasticsearch7 小时前
Elastic 安全借助 NVIDIA Nemotron 为物理隔离的安全运营中心提供智能体人工智能
elasticsearch
Elasticsearch7 小时前
NVIDIA Nemotron 现已在 Elastic 推理服务(EIS)中可用
elasticsearch
岳涛8 小时前
考古|ES 5.1 给别名补上校验,长度上限文档里写 100 字节、5.6.16 源码是 255
elasticsearch
约书亚的博客11 小时前
Elasticsearch 常用命令速查:从集群健康到索引与查询
大数据·elasticsearch·搜索引擎
Elasticsearch1 天前
为什么你的 agent 会忘事:值得在其基础上继续开发的记忆系统必须完成的五项任务
elasticsearch
岳涛1 天前
ES 9.2 起 ReadOnly 会设 indexing_complete,此前它要单独配
elasticsearch
喜欢吃燃面2 天前
Git 原理与使用(三):标签、多人协作与 Git Flow 落地
大数据·git·elasticsearch
喜欢吃燃面2 天前
Git 原理与使用(二):分支是平行宇宙,远程仓库是共享时空
大数据·git·elasticsearch
Elasticsearch2 天前
PHP 运行时指标:找出导致每个请求增加 24 毫秒耗时的 OPcache
elasticsearch