当前位置: 首页 > news >正文

docker容器安装ES

1.拉取镜像

docker pull elasticsearch:6.5.4

2.修改别名

docker tag [容器ID] es65:6.5.4

2.启动应用


docker run -it -d -p 9200:9200 -p 9300:9300 --name es -e ES_JAVA_OPTS="-Xms128m -Xmx128m" es65:6.5.4

3.拷贝配置文件到宿主机

docker cp es:/usr/share/elasticsearch/ /Users/xumengmeng/Document/docker

4.删除刚启动的容器

docker stop es
docker rm es

5.重新运行

docker run -it -d -p 9200:9200 -p 9300:9300 --name es -e ES_JAVA_OPTS="-Xms128m -Xmx128m" -v /Users/xumengmeng/Document/docker/elasticsearch/config:/usr/share/elasticsearch/config -v /Users/xumengmeng/Document/docker/elasticsearch/data:/usr/share/elasticsearch/data -v /Users/xumengmeng/Document/docker/elasticsearch/plugins:/usr/share/elasticsearch/plugins es65:6.5.4

参数解释:

  1. -p 9200:9200 -p 9300:9300:为暴露两个端口。9200是发送http请求时向es发起请求的端口,9300是es在分布式集群状态下节点间的通信端口
  2. -e “discovery.type=single-node” :指定es以单节点运行
  3. -e ES_JAVA_OPTS=“-Xms64m -Xmx128m”:此参数很重要,如果不指定该参数,es启动会将虚拟机内存全部占用
    [报错]
    Exception in thread “main” java.nio.file.NotDirectoryException: /usr/share/elasticsearch/plugins/.DS_Store
    【处理】rm -rf .DS_store

6.验证

访问:宿主机ip:9200

You Know, for Search

7.相关命令

查看安装插件列表

http://localhost:9200/_cat/plugins

QIeB-qN analysis-ik 6.5.4
QIeB-qN ingest-geoip 6.5.4
QIeB-qN ingest-user-agent 6.5.4

8.管道建立

 curl -X PUT "http://localhost:9200/_ingest/pipeline/user_agent" -H 'Content-Type: application/json' -d' { "description" : "Add user agent information", "processors" : [ { "user_agent" : { "field" : "agent" } } ] }'1.删除attachment的pipeline
delete http://{{site}}:9200/_ingest/pipeline/attachment2.建立attachment的pipeline,每个节点都需要这样操作
curl -X PUT "http://localhost:9200/_ingest/pipeline/attachment" -H 'Content-Type: application/json' -d' { "description": "Extract attachment information from arrays", "processors": [ { "foreach": { "field": "attachments", "processor": { "attachment": { "target_field": "_ingest._value.attachment", "field": "_ingest._value.data" } } } } ] }'
http://www.lryc.cn/news/43493.html

相关文章:

  • Python Module — prompt_toolkit CLI 库
  • springboot mybatis-plus 调用 sqlserver 的 存储过程 返回值问题
  • 【0180】PG内核读取pg_hba.conf并创建HbaLine记录(1)
  • 【原型设计工具】​​上海道宁为您提供Justinmind,助力您在几分钟内形成原型,并现场测试,无需编写任何代码
  • 计算机网络中---HDLP协议和PPP协议
  • k8s之节点kubelet预留资源配置
  • 机器学习笔记之前馈神经网络(四)反向传播算法[数学推导过程]
  • vscode+elementui校园跑腿系统 nodejs+vue
  • [蓝桥杯单片机8]定时器的简单应用
  • node-HTTP协议
  • 基于springboot+vue的地方美食分享网站
  • 【Android】之【Aplication】
  • 社区之声|Grant Program支持Moonbeam生态壮大
  • GO实现Redis:GO实现Redis协议解析器(2)
  • Geoserver 发布wmts服务,以及cesium加载发布的wmts服务
  • 【微信小程序】selectComponent(#id)失败得到是null分析
  • JVM中引用计数法与可达性分析
  • JS-对象篇
  • 【Unity】创建一个自己的AR安卓程序
  • 游戏平台商店化的功能特点
  • 最新前端面试知识点总结-2023(3w+字,长篇幅)
  • 离线安装ffmpeg
  • 位置编码Positional Encoding
  • Java异步注解@Async详解
  • macOS Big Sur 11.7.5 (20G1225) 正式版 ISO、PKG、DMG、IPSW 下载
  • 硬件语言Verilog HDL牛客刷题day02 组合逻辑部分
  • 【LM401】ADC采集代码解读
  • CSDN 编程竞赛四十期题解
  • 【TypeScript学习之路】泛型
  • 数据分析学习项目:东京奥运会跳水评论分析