【ES】elasticsearch8.3.3

这里仅实践操作并根据实际问题进行记录笔记。

运行 ES8

我们需要在自己的电脑上安装好 Docker Desktop。接着我们运行如下的命令:出现两个异常,一个是需要使用winpty因为我使用win的docker desktop,另外一个问题是docker启动elasticsearchERROR: Elasticsearch did not exit normally - check the logs at xxx。解决办法:在运行命令中添加 -e "discovery.type=single-node"。最终运行命令

shell 复制代码
$ docker network create elastic
$ docker pull docker.elastic.co/elasticsearch/elasticsearch:8.3.3
winpty docker run  -e ES_JAVA_OPTS="-Xms1024m -Xmx1024m" -e "discovery.type=single-node" --name es-node01 --net elastic -p 9200:9200 -p 9300:9300 -it docker.elastic.co/elasticsearch/elasticsearch:8.3.3

$ docker logs es-node01 -f --tail 1000

$ docker pull docker.elastic.co/kibana/kibana:8.3.3
$ winpty docker run --name kib-01 --net elastic -p 5601:5601 docker.elastic.co/kibana/kibana:8.3.3

最后显示图,如下:

验证访问

shell 复制代码
$ docker cp es-node01:/usr/share/elasticsearch/config/certs/http_ca.crt .
$ curl -X GET --cacert ./http_ca.crt -u elastic:8-u-CiRMc1FgM8k*fNRY https://localhost:9200/

{
  "name" : "80785c9c7f2e",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "yfxAwhuwSdiAXYgrXSfp-Q",
  "version" : {
    "number" : "8.3.3",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "801fed82df74dbe537f89b71b098ccaff88d2c56",
    "build_date" : "2022-07-23T19:30:09.227964828Z",
    "build_snapshot" : false,
    "lucene_version" : "9.2.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

安装 IK

复制代码
sh-5.0$ cd /usr/share/elasticsearch/
sh-5.0$ ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.3.3/elasticsearch-analysis-ik-8.3.3.zip^C
sh-5.0$ pwd
/usr/share/elasticsearch
sh-5.0$ ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.3.3/elasticsearch-analysis-ik-8.3.3.zip
-> Installing https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.3.3/elasticsearch-analysis-ik-8.3.3.zip
-> Downloading https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v8.3.3/elasticsearch-analysis-ik-8.3.3.zip
[=================================================] 100%??
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@     WARNING: plugin requires additional permissions     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
* java.net.SocketPermission * connect,resolve
See https://docs.oracle.com/javase/8/docs/technotes/guides/security/permissions.html
for descriptions of what these permissions allow and the associated risks.

Continue with installation? [y/N]y
-> Installed analysis-ik
-> Please restart Elasticsearch to activate any plugins installed

sh-5.0$ ./bin/elasticsearch-plugin list
analysis-ik

上面的命令显示我们的 IK 已经安装成功了。
这个时候需要我们重新启动一下我们的 Elasticsearch,以便这个 plugin 能装被加载。

验证访问

安装后没有重启

正确应该是

安装 KIB

验证访问

访问地址:http://localhost:5601

访问账号:elastic

访问密码:8-u-CiRMc1FgM8k*fNRY

首次验证:569 587 (KIB后台打印)

首次token:eyJ2ZXIiOiI4LjMuMyIsImFkciI6WyIxNzIuMjMuMC4yOjkyMDAiXSwiZmdyIjoiMGU3MDAzMmVlMjMxMzAyODA5ZWQ1MTg2YjI2ZjA1ZmEyODE5NzkwMTdiZjg4NGY3Nzc2NzIzZTBlNWM0MmEyNSIsImtleSI6IkF1QnZSWW9CTWRwSnl4VVZQYmowOjRPUG9lMlI0UjNlWXFLZGtmRHUyNlEifQ==




辅助参考

Elastic:开发者上手指南
Elasticsearch:使用 Docker compose 来一键部署 Elastic Stack 8.x
ElasticSearch
IK Analysis for Elasticsearch
elasticsearch-analysis-ik

相关推荐
Elasticsearch12 小时前
平衡尺度:利用权重使倒数排序融合 (RRF) 更加智能
elasticsearch
muyun28001 天前
Docker 下部署 Elasticsearch 8 并集成 Kibana 和 IK 分词器
elasticsearch·docker·容器
在未来等你2 天前
Elasticsearch面试精讲 Day 17:查询性能调优实践
大数据·分布式·elasticsearch·搜索引擎·面试
在未来等你2 天前
Elasticsearch面试精讲 Day 18:内存管理与JVM调优
大数据·分布式·elasticsearch·搜索引擎·面试
Elasticsearch2 天前
在 Elastic Observability 中使用 Discover 的追踪获取更深入的应用洞察
elasticsearch
婲落ヽ紅顏誶2 天前
测试es向量检索
大数据·elasticsearch·搜索引擎
咖啡Beans3 天前
Docker安装ELK(Elasticsearch + Logstash + Kibana)
后端·elasticsearch·docker
一勺菠萝丶3 天前
Jenkins 构建 Node 项目报错解析与解决——pnpm lockfile 问题实战
elasticsearch·servlet·jenkins
小花鱼20253 天前
Elasticsearch (ES)相关
大数据·elasticsearch
阿里嘎多哈基米3 天前
ES——(三)DSL高级查询
elasticsearch·搜索引擎·全文检索·kibana·倒排索引