zoukankan      html  css  js  c++  java
  • docker安装es

    1.拉取镜像

    docker pull docker.elastic.co/elasticsearch/elasticsearch:6.3.2

    2.运行容器

    docker run -d --name es -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.3.2

    3.进入容器并修改配置

    docker exec -it es /bin/bash

    cd config

    vi elasticsearch.yml

    cluster.name: "docker-cluster"
    network.host: 0.0.0.0
    
    # minimum_master_nodes need to be explicitly set when bound on a public IP
    # set to 1 to allow single node clusters
    # Details: https://github.com/elastic/elasticsearch/pull/17288
    discovery.zen.minimum_master_nodes: 1

    4.重启容器

    docker restart es

    5.查看容器是否启动成功,显示如下表示启动成功

    http://ip:9200/

    {
      "name" : "C9GtLXP",
      "cluster_name" : "docker-cluster",
      "cluster_uuid" : "jqB6ru-vS82x9dMmA7B-lA",
      "version" : {
        "number" : "6.3.2",
        "build_flavor" : "default",
        "build_type" : "tar",
        "build_hash" : "053779d",
        "build_date" : "2018-07-20T05:20:23.451332Z",
        "build_snapshot" : false,
        "lucene_version" : "7.3.1",
        "minimum_wire_compatibility_version" : "5.6.0",
        "minimum_index_compatibility_version" : "5.0.0"
      },
      "tagline" : "You Know, for Search"
    }

     6.springboot连接环境与配置

            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
            </dependency>
    spring.data.elasticsearch.cluster-name=docker-cluster
    spring.data.elasticsearch.cluster-nodes = 192.168.94.135:9300

    7.常见错误

    https://blog.csdn.net/weixin_39902472/article/details/111037048

  • 相关阅读:
    LCD1602的第一个显示程序
    我的8*8点阵led做螺旋流水灯
    RS232电平TTL电平转换器MAX232相关
    如何自定义silverlight的加载页面
    关于一个页面中多个silverlight应用程序通信的总结
    ComboBox小技巧
    学习和分享的人
    转: 高效时间管理-介绍GTD
    转载:PHPexcel学习笔记2
    转载:PHPexcel学习笔记
  • 原文地址:https://www.cnblogs.com/XueTing/p/15056304.html
Copyright © 2011-2022 走看看