欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

yum安装ELK之Elasticsearch

程序员文章站 2022-07-09 15:46:10
...
Elasticsearch官网:点这里
Elasticsearch二进制文件安装:点这里

好的,下面进入正题:

1.在 /etc/yum.repos.d/目录下自定义一个 es.repo 文件 写入
[elasticsearch]
name=Elasticsearch repository for 7.x packages
baseurl=https://artifacts.elastic.co/packages/7.x/yum
gpgcheck=1
gpgkey=https://artifacts.elastic.co/GPG-KEY-elasticsearch
enabled=0
autorefresh=1
type=rpm-md
2.导入秘钥
rpm --import https://artifacts.elastic.co/GPG-KEY-elasticsearch
3.安装
sudo yum install --enablerepo=elasticsearch elasticsearch
4.更改配置-查询文件
whereis elasticsearch
5.这里只针对ELK环境下的单实例内网部署,不考虑开放公网的方式
vim /etc/elasticsearch/elasticsearch.yml


修改 network.host 为 127.0.0.1

对外访问端口为9200

elk场景使用无需开启外网访问,而增加复杂配置

端口随意
6.附上简单的操作命令
systemctl start elasticsearch
          status
          stop    
7.简单测试
curl http://localhost:9200/

响应

{
  "name" : "iZbp12g0dasdadasmddx3v9202Z",
  "cluster_name" : "elasticsearch",
  "cluster_uuid" : "LfCC3dadasiQumKY0x2bsHV3Q",
  "version" : {
    "number" : "7.13.4",
    "build_flavor" : "default",
    "build_type" : "rpm",
    "build_hash" : "c5f60e894ca0dadscdbae4f5a686d9f08bcefc942",
    "build_date" : "2021-07-14T18:33:36.673943207Z",
    "build_snapshot" : false,
    "lucene_version" : "8.8.2",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}