Elasticsearch介绍与安装

日常使用场景

  • 商城商品搜索
  • 百度关键字搜索展示高亮
  • GitHub项目搜索等

什么是Elasticsearch

Elasticsearch 是一个分布式RESTful 风格搜索和数据分析引擎,可以用来实现搜索、日志统计、分析、系统监控等功能。

Elastic Stack

什么是Elastic Stack(ELK)

如果你没有听说过Elastic Stack,那你一定听说过ELK,实际上ELK是三款软件的简称,分别是Elasticsearch、Logstash、Kibana组成,在发展的过程中,又有新成员Beats的加入,所以就形成了Elastic Stack。所以说,ELK是旧的称呼,Elastic Stack是新的名字。


Elastic Stack组成

ES的安装

  • 点击下载
  • 配置文件,进入config目录
  • 修改elasticsearch.yml文件
# ---------------------------------- Cluster -----------------------------------
#
# Use a descriptive name for your cluster:
# 设置集群名称 同一肌群名称相同即可
cluster.name: haohong-application
#
#
# ----------------------------------- Paths ------------------------------------
#
# Path to directory where to store the data (separate multiple locations by comma):
# 挂载逻辑卷,绑定es的数据目录
path.data: /data/es/data
#
# Path to log files:
# 挂载逻辑卷,绑定es的日志目录
path.logs: /data/es/logs
#
# ---------------------------------- Network -----------------------------------
#
# By default Elasticsearch is only accessible on localhost. Set a different
# address here to expose this node on the network:
# 非localhost为生产环境,会对环境的要求比较高 设置ip地址,任意网络均可访问
network.host: localhost
#
# By default Elasticsearch listens for HTTP traffic on the first free port it
# finds starting at 9200. Set a specific HTTP port here:
# 端口设置
#http.port: 9200
  • 修改jvm.options文件
## 根据自己机器情况修改
## -Xms2g
## -Xmx2g
  • 进入bin目录启动
  • 浏览器访问验证启动
http://localhost:9200/


{
    "name": "DESKTOP-FTIIK3E",
    "cluster_name": "haohong-application",
    "cluster_uuid": "ggJwIk7QS6WFex1_ybzwOA",
    "version": {
        "number": "7.15.0",
        "build_flavor": "default",
        "build_type": "zip",
        "build_hash": "79d65f6e357953a5b3cbcc5e2c7c21073d89aa29",
        "build_date": "2021-09-16T03:05:29.143308416Z",
        "build_snapshot": false,
        "lucene_version": "8.9.0",
        "minimum_wire_compatibility_version": "6.8.0",
        "minimum_index_compatibility_version": "6.0.0-beta1"
    },
    "tagline": "You Know, for Search"
}

你可能感兴趣的:(Elasticsearch介绍与安装)