阿里云服务器上安装ElasticSearch基于CentOS 7.8,并且在本地Windows上可以通过Kibana访问

首先,配置阿里云服务器。CentOS 7.8是已经安装好的镜像

导入 Elasticsearch GPG 密钥:

r 复制代码
sudo rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch

添加 Elasticsearch 仓库:

创建一个新的 .repo 文件,添加 Elasticsearch 仓库信息。使用文本编辑器(如 nano 或 vi 一般都是vi) 创建文件:

r 复制代码
sudo vi /etc/yum.repos.d/elasticsearch.repo

在文件中添加以下内容:

r 复制代码
[elasticsearch]
name=Elasticsearch repository
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=1
autorefresh=1
type=rpm-md

进入编辑模式:按下 i 键,此时光标左下角会显示 -- INSERT --

保存并退出:按下 Esc 键,然后输入 :wq 并按下 Enter 键。

安装 Elasticsearch:

r 复制代码
sudo yum install elasticsearch

配置 Elasticsearch:

打开 Elasticsearch 的配置文件:

r 复制代码
sudo nano /etc/elasticsearch/elasticsearch.yml

在配置文件中,你可能需要配置以下几个参数:

network.host : 设置为服务器的 IP 地址。
http.port : 设置 HTTP 访问的端口,默认是 9200。

设置discovery.type: single-node

设置discovery.type: single-node是为了告诉 Elasticsearch

在单节点环境中运行,因此它不需要进行集群发现(discovery)。在单节点环境中,不涉及到与其他节点通信的情况,因此关闭集群发现可以简化配置。

保存并退出。

启动 Elasticsearch 服务:

r 复制代码
sudo systemctl start elasticsearch

检查服务状态:

r 复制代码
sudo systemctl status elasticsearch

安装Kibanna

注意 :ES版本一定要于Kibana一致
这个是网址点进去选版本,然后下载解压

配置 Kibana:

解压后,在config文件中找到kibana.yml ,找到 elasticsearch.hosts 配置项

r 复制代码
elasticsearch.hosts: ["http://服务器公网IP:9200"]

然后启动

在安装目录下运行

r 复制代码
bin/kibana

然后访问http://localhost:5601

选择Dev Tools

试执行一个简单的 Elasticsearch 查询,例如:

r 复制代码
GET /_cluster/health
相关推荐
yongui4783432 分钟前
CentOS系统如何查看当前内存容量
linux·运维·centos
xzq_java37 分钟前
CentOS操作系统虚拟机安装以及连接工具下载和远程连接工具远程连接
linux·运维·centos
理智的煎蛋39 分钟前
CentOS/Ubuntu安装显卡驱动与GPU压力测试
大数据·人工智能·ubuntu·centos·gpu算力
赵孝正1 小时前
GitLab 分支管理与 Push 问题全解析
大数据·elasticsearch·gitlab
一刀到底2113 小时前
springboot3.3.5 集成elasticsearch8.12.2 ssl 通过 SSL bundle name 来实现
网络·elasticsearch·ssl·springboot3
Elasticsearch3 小时前
Elasticsearch:智能搜索的 MCP
elasticsearch
范紫涵-19期-工职大6 小时前
虚拟机之CentOS、网络设置的有趣问题
linux·网络·centos
Clownseven6 小时前
CN2 GIA线路深度解析:阿里云/腾讯云选哪个?(附三网评测)
阿里云·云计算·腾讯云
Linux运维技术栈6 小时前
Terraform 从入门到实战:历史、原理、功能与阿里云/Azure 上手指南
运维·阿里云·kubernetes·azure·terraform
uesowys8 小时前
阿里云Qwen3系列模型部署微调评测
阿里云·大模型部署微调评测