Elasticsearch入门安装

1、下载安装

(1)安装Elasticsearch

下载地址:https://www.elastic.co/cn/downloads/elasticsearch

解压后运行 /bin/elasticsearch.bat

运行后访问 http://127.0.0.1:9200/即可

ps1:若无法访问且控制台打印

复制代码
received plaintext http traffic on an https channel, closing connection Netty4HttpChannel{localAddress=/127.0.0.1:9200, remoteAddress=/127.0.0.1:54622}

原因是高版本Elasticsearch在Windows下开启了安全认证。

修改配置文件 /config/elasticsearch.yml中两处:

复制代码
xpack.security.enabled: false
xpack.security.http.ssl:
  enabled: false

ps2:低版本es对jdk有要求,高版本8.+会自动忽略本地环境不合适的jdk

ps3:低版本没有自带ingest-attachment插件,需要使用文件检索时,需要到安装目录下执行elasticsearch-plugin install ingest-attachment 安装

ps4:文件上传时定义文本抽取管道:

复制代码
PUT /_ingest/pipeline/attachment
{
    "description": "Extract attachment information",
    "processors": [
        {
            "attachment": {
                "field": "content",
                "ignore_missing": true
            }
        },
        {
            "remove": {
                "field": "content"
            }
        }
    ]
}

在 attachment 中指定要过滤的字段为 content,所以写入 es时需要将文档内容放在 content 字段。

比如文档:

复制代码
PUT /fileindex
{
  "mappings": {
    "properties": {
      "id":{
        "type": "keyword"
      },
      "name":{
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "type":{
        "type": "keyword"
      },
      "attachment": {
        "properties": {
          "content":{
            "type": "text"
          }
        }
      },
      "caseId":{
        "type": "text"
      },
      "caseArea":{
        "type": "text"
      },
      "caseName":{
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "caseType":{
        "type": "text",
        "analyzer": "ik_max_word"
      },
      "startDate":{
        "type": "date"
      },
      "endDate":{
        "type": "date"
      },
      "signDate":{
        "type": "date"
      }
    }
  }
}

(2)安装分词器ik(按需)

下载地址:https://release.infinilabs.com/analysis-ik/stable/

解压到es目录/plugins下 ,重启es即可

2、安装elasticsearch-head

(1)安装nodejs

下载地址:https://nodejs.org/en/download/

cmd输入 node -v 命令,输出了版本号,则node安装成功。

(2)安装grunt

下载地址:CMD中执行 npm install -g grunt-cli

(3)安装

下载地址:elasticsearch-head

https://download.csdn.net/download/weixin_45003809/89510856

解压后进入安装目录,执行 npm install

再执行 npm run start 启动服务

即可通过 http://localhost:9100/ 访问

ps:如果无法发现ES节点,尝试在ES配置文件/config/elasticsearch.yml中配置允许跨域

http.cors.enabled: true

http.cors.allow-origin: "*"

3、安装kibana

下载地址:https://www.elastic.co/cn/downloads/past-releases#kibana

解压后运行 /bin/kibana.bat

ps1:

可以在配置文件 /config/kibana.yml 中更改语言
i18n.locale: "zh-CN"

相关推荐
阿里云大数据AI技术1 小时前
ES Serverless 8.17王牌发布:向量检索「火力全开」,智能扩缩「秒级响应」!
大数据·运维·serverless
Mikhail_G1 小时前
Python应用变量与数据类型
大数据·运维·开发语言·python·数据分析
G皮T2 小时前
【Elasticsearch】映射:null_value 详解
大数据·elasticsearch·搜索引擎·映射·mappings·null_value
大霸王龙3 小时前
软件工程的软件生命周期通常分为以下主要阶段
大数据·人工智能·旅游
点赋科技3 小时前
沙市区举办资本市场赋能培训会 点赋科技分享智能消费新实践
大数据·人工智能
YSGZJJ4 小时前
股指期货技术分析与短线操作方法介绍
大数据·人工智能
Doker 多克4 小时前
Flink CDC —部署模式
大数据·flink
Guheyunyi4 小时前
监测预警系统重塑隧道安全新范式
大数据·运维·人工智能·科技·安全
Channing Lewis5 小时前
如果科技足够发达,是否还需要维持自然系统(例如生物多样性)中那种‘冗余’和‘多样性’,还是可以只保留最优解?
大数据·人工智能·科技
禺垣5 小时前
区块链技术概述
大数据·人工智能·分布式·物联网·去中心化·区块链