ElasticSearch随笔(一)

简介

Elasticsearch 是一个建立在全文搜索引擎 Apache Lucene(TM) 基础上的搜索引擎,可以说 Lucene 是当今最先进,最高效的全功能开源搜索引擎框架。

环境安装配置

下载

官网下载地址

Docker安装

参考文档

拉取镜像

 [root@localhost network-scripts]# docker pull elasticsearch:7.12.1
 7.12.1: Pulling from library/elasticsearch
 7a0437f04f83: Pull complete 
 ed4a47ec20b2: Pull complete 
 74e4f4b7e738: Pull complete 
 ef2a2418a5f4: Pull complete 
 646dbf47f747: Pull complete 
 3ffbf21442fc: Pull complete 
 e04f00c0d464: Pull complete 
 Digest: sha256:622f854572780281bc85b5fde33be27e99670941ed8b7eea5ba4aaf533fa64ec
 Status: Downloaded newer image for elasticsearch:7.12.1
 docker.io/library/elasticsearch:7.12.1
 ​

创建目录

 [root@localhost service]# mkdir -p /home/service/elasticsearch
 ​
 [root@localhost elasticsearch]# mkdir -p{config,data,plugins}
 ​

创建临时容器

 [root@localhost config]# docker run --name elasticsearch -d -e ES_JAVA_OPTS="-Xms128m -Xmx512m" -e "discovery.type=single-node" -p 9200:9200 -p 9300:9300 elasticsearch:7.12.1
 ​

复制配置文件

 [root@localhost config]# docker cp elasticsearch:/usr/share/elasticsearch/config/elasticsearch.yml /home/service/elasticsearch/config

删除容器

 [root@localhost config]# docker stop elasticsearch
 elasticsearch
 [root@localhost config]# docker rm elasticsearch
 elasticsearch
 ​

启动ES

 [root@localhost config]# docker run -d \
             --name elasticsearch \
             -p 9200:9200 \
             -p 9300:9300  \
             -e "discovery.type=single-node" \
             -e ES_JAVA_OPTS="-Xms64m -Xmx128m" \
             -v /home/service/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml \
             -v /home/service/elasticsearch/data:/usr/share/elasticsearch/data \
             -v /home/service/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
             elasticsearch:7.12.1

注意事项

一定要给目录授权,否则可能启动失败,自动退出

 chmod 777 config&chmod 777 data&chmod 777 plugins

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值