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"

相关推荐
不仙52018 分钟前
VMware Workstation 26.0.0 在 Ubuntu 24.04 (内核 6.17.0) 上的安装与内核模块编译问题
linux·ubuntu·elasticsearch
189228048611 小时前
NY352固态MT29F32T08GWLBHD6-24QJ:B
大数据·服务器·人工智能·科技·缓存
不开大的凯20771 小时前
麦当秀AiPPT战略转向:从SaaS订阅迈向Token经济,AI办公定价模式迎来新探索
大数据·人工智能
程序鉴定师1 小时前
西安小程序制作的可靠选择与发展前景
大数据·小程序
黎阳之光1 小时前
黎阳之光:以视频孪生重构智慧医院信息化,打造高标项目核心竞争力
大数据·人工智能·物联网·算法·数字孪生
qziovv2 小时前
Git 回退场景
大数据·git·elasticsearch
ZeroNews内网穿透3 小时前
面向 AI 协作的本地客户端能力:ZeroNews Agent Skills
大数据·人工智能·elasticsearch
SelectDB3 小时前
Agent 时代,为什么传统的可观测方案不适用了?
大数据·数据库·数据分析
Elastic 中国社区官方博客4 小时前
快 12 倍的 Elasticsearch 向量索引:使用 GPU 和 CPU 分层部署 NVIDIA cuVS
大数据·人工智能·elasticsearch·搜索引擎·ai·全文检索·nvidia
鹧鸪云光伏4 小时前
光伏设计软件:多屋脊房型如何设计?
大数据·信息可视化·光伏·光伏设计·光伏图纸