阿里云服务器上安装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
相关推荐
一个程序猿老马13 分钟前
003、Git核心概念:仓库、工作区、暂存区、版本库
大数据·git·elasticsearch
披着羊皮不是狼16 分钟前
Git完整学习总结
git·学习·elasticsearch
一个程序猿老马30 分钟前
005、Git三板斧(1):git add - 将文件纳入版本管理
大数据·git·elasticsearch
云动课堂34 分钟前
【运维实战】企业级SFTP 文件服务 · 一键自动化部署方案 (适配AnolisOS /openEuler /CentOS)
运维·centos·自动化
diygwcom40 分钟前
jeecg验证码在centos报错
linux·运维·centos
Elivs.Xiang2 小时前
centos9中安装Jenkins
linux·运维·centos·jenkins
oLLI PILO2 小时前
在linux(Centos)中Mysql的端口修改保姆级教程
linux·mysql·centos
Elastic 中国社区官方博客3 小时前
自动化可靠性:自愈型企业的架构
运维·elasticsearch·搜索引擎·云原生·架构·自动化·serverless
枕布响丸辣3 小时前
万字详解 GlusterFS 分布式文件系统:原理 + 卷类型 + CentOS 7 集群部署
linux·运维·centos
ldj20203 小时前
Filebeat 采集数据到Elasticsearch
elasticsearch·filebeat