ElasticSearch的安装 | docker-compose

1. 安装elasticsearch&kibana

docker-compose.yml

version: '3.1'
services:
  elasticsearch:
    image: daocloud.io/library/elasticsearch:6.5.4
    restart: always
    container_name: elasticsearch
    ports:
      - 9200:9200
  kibana:
    image: daocloud.io/library/kibana:6.5.4
    restart: always
    container_name: kibana
    ports:
      - 5601:5601
    environment:
      - elasticsearch_url=http://192.168.1.104:9200
    depends_on:
      - elasticsearch

这里启动elasticsearch失败了,通过日志发现

Problem:
You want to run ElasticSearch using docker, but the container immediately stops again using this error message
elasticsearch exited with code 78
elasticsearch | [1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]

解决方法:
root目录下执行sysctl -w vm.max_map_count=262144,之后为了防止设置失效,可在/etc/sysctl.conf文件中最后一行添加

vm.max_map_count=262144

  • 通过浏览器访问9200

在这里插入图片描述


  • 通过浏览器访问5601

在这里插入图片描述


2. 安装IK分词器

github下载地址:https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.5.4/elasticsearch-analysis-ik-6.5.4.zip

#进入docker容器内部
docker exec -it elasticsearch bash
#进入bin目录运行如下命令
./elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.5.4/elasticsearch-analysis-ik-6.5.4.zip
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值