拉取镜像:

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

  修改vm.max_map_count参数:

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

  启动容器elasticsearch:

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

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

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

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

  1. [mall@VM_0_7_centos ~]$ sudo chmod + /mydata/elasticsearch/data
  2.  
  3. [mall@VM_0_7_centos ~]$ sudo docker stop elasticsearch
  4. elasticsearch
  5. [mall@VM_0_7_centos ~]$ sudo docker start elasticsearch
  6. elasticsearch

  测试一下:

  1. [mall@VM_0_7_centos ~]$ curl -XGET 'localhost:9200'
  2. {
  3. "name" : "4FZrgc-",
  4. "cluster_name" : "elasticsearch",
  5. "cluster_uuid" : "6JP7jV8wQhqiVCg680hP-w",
  6. "version" : {
  7. "number" : "6.4.0",
  8. "build_flavor" : "default",
  9. "build_type" : "tar",
  10. "build_hash" : "595516e",
  11. "build_date" : "2018-08-17T23:18:47.308994Z",
  12. "build_snapshot" : false,
  13. "lucene_version" : "7.4.0",
  14. "minimum_wire_compatibility_version" : "5.6.0",
  15. "minimum_index_compatibility_version" : "5.0.0"
  16. },
  17. "tagline" : "You Know, for Search"
  18. }

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. filter-mutate过滤插件

    之前的nginx日志使用grok匹配,但是后来发现nginx的日志中每个值之间都使用了分隔符"|",这下就可以使用mutate来分隔出每个字段的含义,同时还减少了运算. 描述 mu ...

  2. react-native npm install

    --create project react-native init myapp --version 0.55.4 cd myapp -- react ui npm i react-native-el ...

  3. Codeforces I. Inna and Nine(组合)

    题目描述: Inna and Nine time limit per test 1 second memory limit per test 256 megabytes input standard ...

  4. hdu1384Intervals(差分约束)

    #include <bits/stdc++.h> using namespace std; ; const int inf = 0x3f3f3f3f; int n, head[maxn], ...

  5. wordpress调用缩略图/特色图url

    调用缩略图的url <a href="<?php the_post_thumbnail_url( 'full' ); ?>"><?php the_po ...

  6. 【Selenium-WebDriver实战篇】ScreenRecorder的实际输出路径设置(转)

    参考:https://www.cnblogs.com/yongfeiuall/p/4134139.html 我们可以用以下方式在Selenium Webdriver中capture video. 基本 ...

  7. django-带参数路由

    路由urls.py from django.conf.urls import url from goods.views import IndexView, DetailView, ListView u ...

  8. SUID提权

    查看tmp目录权限 ll -d /tmp 切换到tmp目录 cd /tmp 创建一个exploit目录 mkdir exploit 查看ping命令带suid权限 ll /bin/ping 创建tar ...

  9. C#线程池 ThreadPool

    什么是线程池 大家都知道,我们在打开一个应用的时候,操作系统是要做很多的事情的,动态链接.装载.分配虚拟空间.等等等等,其实一个应用的打开同时也伴随着一个进程的建立. 进程的建立是需要时间的,在进程上 ...

  10. CTF入门(一)

    ctf入门指南 如何入门?如何组队? capture the flag 夺旗比赛 类型: Web密码学pwn 程序的逻辑分析,漏洞利用windows.linux.小型机等misc 杂项,隐写,数据还原 ...