docker安装其他常用软件

Elasticsearch

搜索资源:
docker search elasticsearch

NAME DESCRIPTION STARS OFFICIAL AUTOMATED
elasticsearch Elasticsearch is a powerful open source se… 2992 [OK]
kibana Kibana gives shape to any kind of data —… 1219 [OK]
nshou/elasticsearch-kibana Elasticsearch-6.3.1 Kibana-6.3.1 78 [OK]
itzg/elasticsearch Provides an easily configurable Elasticsea… 66 [OK]
mobz/elasticsearch-head elasticsearch-head front-end and standalon… 33
kubernetes/fluentd-elasticsearch An image that ingests Docker container log… 25
lmenezes/elasticsearch-kopf elasticsearch kopf 17 [OK]
tutum/elasticsearch Elasticsearch image - listens in port 9200. 16 [OK]
monsantoco/elasticsearch ElasticSearch Docker image 11 [OK]
bitnami/elasticsearch Bitnami Docker Image for Elasticsearch 9 [OK]
mesoscloud/elasticsearch [UNMAINTAINED] Elasticsearch 8 [OK]
justwatch/elasticsearch_exporter Elasticsearch stats exporter for Prometheus 6
visity/elasticsearch-curator Automated build for docker-elasticsearch-c… 6 [OK]
blacktop/elasticsearch Alpine Linux based Elasticsearch Docker Image 5 [OK]
frodenas/elasticsearch A Docker Image for Elasticsearch 3 [OK]
centerforopenscience/elasticsearch Elasticsearch 3 [OK]
phenompeople/elasticsearch Elasticsearch is a powerful open source se… 1 [OK]
thingswise/elasticsearch Elasticsearch + etcd2 peer discovery 1 [OK]
jetstack/elasticsearch-pet An elasticsearch image for kubernetes PetSets 1 [OK]
barchart/elasticsearch-aws Elasticsearch AWS node 1
barchart/elasticsearch-backup Elasticsearch backup runner 1
driveclutch/infra-elasticsearch-aws Elasticsearch Docker for use in AWS 0 [OK]
18fgsa/elasticsearch Built from https://github.com/docker-libra… 0
backplane/elasticsearch-curator Elasticsearch Curator (https://github.com/… 0
forkdelta/fluentd-elasticsearch fluent/fluentd with fluent-plugin-elastics… 0 [OK]

拉取镜像:
docker pull elasticsearch
未配置加速可以:
docker pull registry.docker-cn.com/library/elasticsearch

查看安装情况:
docker images

REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
elasticsearch latest f28f9f9d9ae3 4 days ago 485.8 MB
rabbitmq 3.6-management 3660cf2e0a4e 2 weeks ago 148.8 MB

部署与启动ES:注意ES启动需要2G内存,所以虚拟机测试用需要限制下内存
docker run -e ES_JAVA_OPTS="-Xms256m -Xmx256m" -d -p 9200:9200 -p 9300:9300 --name ES01 f28f9f9d9ae3

查看启动是否成功:
docker ps
或者访问:http://192.168.25.134:9200/

之后启动与停止:
docker start ES01
docker stop ES01

ES的操作:
官方文档:https://es.xiaoleilu.com/
https://www.elastic.co/guide/cn/elasticsearch/guide/current/index.html
使用postman存入数据:需要用put请求发送
http://192.168.25.134:9200/megacorp/employee/1

{
    "first_name" : "John",
    "last_name" :  "Smith",
    "age" :        25,
    "about" :      "I love to go rock climbing",
    "interests": [ "sports", "music" ]
}

docker安装其他常用软件_第1张图片

名字 说明
megacorp 索引名
employee 类型名
1 这个员工的ID

保存成功得到反馈

{
  "_index": "megacorp",
  "_type": "employee",
  "_id": "1",
  "_version": 1,
  "result": "created",
  "_shards": {
    "total": 2,
    "successful": 1,
    "failed": 0
  },
  "created": true
}

插入更多测试数据

{
    "first_name" :  "Jane",
    "last_name" :   "Smith",
    "age" :         32,
    "about" :       "I like to collect rock albums",
    "interests":  [ "music" ]
}

{
    "first_name" :  "Douglas",
    "last_name" :   "Fir",
    "age" :         35,
    "about":        "I like to build cabinets",
    "interests":  [ "forestry" ]
}

搜索数据:发送get请求
http://192.168.25.134:9200/megacorp/employee/1
docker安装其他常用软件_第2张图片

我们通过HTTP方法GET来检索文档,同样的,我们可以使用DELETE方法删除文档,使用HEAD方法检查某文档是否存在。如果想更新已存在的文档,我们只需再PUT一次。

搜索全部员工的请求:
http://192.168.25.134:9200/megacorp/employee/_search
带条件的查询:
http://192.168.25.134:9200/megacorp/employee/_search?q=last_name:Smith
DSL语句查询:
http://192.168.25.134:9200/megacorp/employee/_search
post请求体带上查询条件

{
    "query" : {
        "match" : {
            "last_name" : "Smith"
        }
    }
}

更复杂的查询:

{
    "query" : {
        "bool" : {
            "must" : {
                "match" : {
                    "last_name" : "smith" }
            },
            "filter" : {
                "range" : {
                    "age" : { "gt" : 30 } }
            }
        }
    }
}

全文检索:

{
    "query" : {
        "match" : {
            "about" : "rock climbing"
        }
    }
}

完全匹配:

{
    "query" : {
        "match_phrase" : {
            "about" : "rock climbing"
        }
    }
}

高亮搜索:

{
    "query" : {
        "match_phrase" : {
            "about" : "rock climbing"
        }
    },
    "highlight": {
        "fields" : {
            "about" : {}
        }
    }
}

Zookeeper

下载镜像:https://hub.docker.com/r/library/zookeeper/tags/
docker pull zookeeper:3.4.10

部署镜像,不做集群与选举:
docker run --name zk01 -p 2181:2181 --restart always -d b476cafc9102

springboot热部署插件(滑稽)

<dependency>
    <groupId>org.springframework.bootgroupId>
    <artifactId>spring-boot-devtoolsartifactId>
    <optional>trueoptional>
dependency>

你可能感兴趣的:(学习笔记)