拉取镜像:

[mall@VM_0_7_centos ~]$ sudo docker pull elasticsearch:6.4.
[sudo] password for mall:
6.4.: Pulling from library/elasticsearch
256b176beaff: Pull complete
6cb472d8b34a: Downloading [=================================================> ] .5MB/.4MB
6cb472d8b34a: Pull complete
3a4f4d86c1c1: Pull complete
d185a64a7692: Pull complete
bc4d63245d6d: Pull complete
c8e97292a30a: Pull complete
c1c1a056e791: Pull complete
69b6c77c3236: Pull complete
Digest: sha256:96345f6d73c0d615ddf8b9683848d625f211efacfe3b5b8765debbd1eebc5663
Status: Downloaded newer image for elasticsearch:6.4.
docker.io/library/elasticsearch:6.4.

  修改vm.max_map_count参数:

[mall@VM_0_7_centos ~]$ sudo sysctl -w vm.max_map_count=
[sudo] password for mall:
vm.max_map_count =

  启动容器elasticsearch:

[mall@VM_0_7_centos ~]$ sudo docker run -p : -p : --name elasticsearch \
> -e "discovery.type=single-node" \
> -e "cluster.name=elasticsearch" \
> -v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
> -v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
> -d elasticsearch:6.4.
606c0c45aa2693a23bf1a7de7be518b3022c5f107d2c7083f2590cba1589b9d9

  进入容器报错,提示启动失败:

[mall@VM_0_7_centos ~]$ sudo docker exec -it elasticsearch /bin/bash
Error response from daemon: Container 606c0c45aa2693a23bf1a7de7be518b3022c5f107d2c7083f2590cba1589b9d9 is not running

  修改数据文件权限,重启:

[mall@VM_0_7_centos ~]$ sudo chmod + /mydata/elasticsearch/data

[mall@VM_0_7_centos ~]$ sudo docker stop elasticsearch
elasticsearch
[mall@VM_0_7_centos ~]$ sudo docker start elasticsearch
elasticsearch

  测试一下:

[mall@VM_0_7_centos ~]$ curl -XGET 'localhost:9200'
{
"name" : "4FZrgc-",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "6JP7jV8wQhqiVCg680hP-w",
"version" : {
"number" : "6.4.0",
"build_flavor" : "default",
"build_type" : "tar",
"build_hash" : "595516e",
"build_date" : "2018-08-17T23:18:47.308994Z",
"build_snapshot" : false,
"lucene_version" : "7.4.0",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"
},
"tagline" : "You Know, for Search"
}

docker安装并运行elasticsearch的更多相关文章

  1. Docker安装以及运行第一个HelloWorld

      Docker安装以及运行第一个HelloWorld

  2. Docker安装+HelloWorld+运行Tomcat

    前言 只有光头才能变强. 文本已收录至我的GitHub仓库,欢迎Star:https://github.com/ZhongFuCheng3y/3y 上一篇已经讲解了为什么需要Docker?,相信大家已 ...

  3. Docker安装并运行mysql5.6数据库

    1.在/home目录下新建mysql目录 mysql目录中新建三个目录:conf目录.logs目录.data目录,建这些目录的目的是用来挂载docker中的mysql下的目录的. 结果如下: 1.1. ...

  4. docker安装并运行kibana

    拉镜像: [mall@VM_0_7_centos ~]$ : Pulling from library/kibana 256b176beaff: Already exists 88643bded09c ...

  5. docker安装并运行redis

    拉取镜像: [mall@VM_0_7_centos ~]$ sudo docker pull redis:3.2 [sudo] password for mall: 3.2: Pulling from ...

  6. docker安装并运行ngnix

    拉取nginx最新版本的镜像: [mall@VM_0_7_centos ~]$ sudo docker pull nginx:latest [sudo] password for mall: late ...

  7. Docker 安装并运行 Redis

    说明 在Windows下运行Redis主要有以下几种方式: 使用微软官方构建的Windows版Redis,最新版本是3.0.504,发布于2016-07-01.https://github.com/m ...

  8. 使用docker安装和运行常用的数据库和中间件

    mysql: docker pull mysql: docker run --name mysql -p : -v /usr/share/zoneinfo/Asia/Shanghai:/etc/loc ...

  9. docker安装并运行mongo

    拉镜像: [mall@VM_0_7_centos ~]$ sudo docker pull mongo:3.2 [sudo] password for mall: 3.2: Pulling from ...

随机推荐

  1. Django-视图函数view

    目录 1.Django的视图函数view 1.1一个简单的视图 2.CBV和FBV 3.使用Mixin(了解) 4.给视图加装饰器 4.1使用装饰器装饰FBV 4.2使用装饰器装饰CBV 5.requ ...

  2. jquery获取元素的display属性是不是none?

    1.代码: $(".max_find_wl_info").click(function(){ if($('.max_wuliu').css('display') === 'none ...

  3. Justice(HDU6557+2018年吉林站+二进制)

    题目链接 传送门 题意 给你\(n\)个数,每个数表示\(\frac{1}{2^{a_i}}\),要你把这\(n\)个数分为两堆,使得每堆的和都大于等于\(\frac{1}{2}\). 思路 首先我们 ...

  4. CSP-S 2019提高组训练 服务器需求

    时间限制:C/C++ 3秒 空间限制:C/C++ 262144K 题目描述 小多计划在接下来的n天里租用一些服务器,所有的服务器都是相同的.接下来n天中,第i天需要\(a_i\)台服务器工作,每台服务 ...

  5. 微信小程序——<scroll-view>滚动到最底部

    最近在做个直播间,有个这样的需要,就是进入到页面,<scroll-view>需要滚动到最底部,并且发送消息之后自动的滚动到底部. 开始想着计算里面内容的高度,然后通过设置 scroll-t ...

  6. OKR的两个基本原则

    <启示录>作者,前易贝高级副总裁,硅谷产品集团创始人马蒂·卡根在<OKR工作法>的序言中提到了目标管理法的两个原则: 不要告诉下属具体怎么做,要告诉他们你要什么,他们就会给你满 ...

  7. am335x system upgrade kernel tf(五)

    1      Scope of Document This document describes TF hardware design 2      Requiremen 2.1     Functi ...

  8. 关于System.ArgumentNullException异常

    什么是ArgumentNullException 当将 null 引用(Visual Basic 中为 Nothing)传递到不接受其作为有效参数的方法时引发的异常. 继承 Object Except ...

  9. 开源项目 07 AutoMapper

    using AutoMapper; using Newtonsoft.Json; using System; using System.Collections.Generic; using Syste ...

  10. 【后缀数组】【LuoguP4051】 [JSOI2007]字符加密

    题目链接 题目描述 喜欢钻研问题的JS 同学,最近又迷上了对加密方法的思考.一天,他突然想出了一种他认为是终极的加密办法:把需要加密的信息排成一圈,显然,它们有很多种不同的读法. 例如'JSOI07' ...