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

  • 相关阅读:
    vue开发环境搭建
    超出宽度省略号,css解决办法
    css平板手机pc媒体查询
    pc和移动端调用qq聊天
    fiddeler 抓包工具的配置使用
    给证件照换背景颜色
    markman高效的设计稿标注、测量工具
    画三角形和直角三角形
    vue中使用Ueditor编辑器 -- 1
    js获取浏览器缩放比例
  • 原文地址:https://www.cnblogs.com/XueTing/p/15056304.html
Copyright © 2011-2022 走看看