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] | |
backplane/elasticsearch-curator | 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 start ES01
docker stop ES01
{
"first_name" : "John",
"last_name" : "Smith",
"age" : 25,
"about" : "I love to go rock climbing",
"interests": [ "sports", "music" ]
}
名字 | 說明 |
---|---|
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" ]
}
我們通過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
部署映象,不做叢集與選舉:
docker run --name zk01 -p 2181:2181 --restart always -d b476cafc9102
springboot熱部署外掛(滑稽)
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>