1. 安装 es
docker pull elasticsearch:5.6.11
2. 启动es
docker run -id --name elasticsearch56 -d --restart=always -p 9200:9200 -p 9300:9300 -v /usr/share/elasticsearch/plugins:/usr/share/elasticsearch/plugins -e "discovery.type=single-node" elasticsearch:5.6.11
3. 访问:get 请求
`http://192.168.1.180:9200/_cat/`
=^.^=
/_cat/allocation
/_cat/shards
/_cat/shards/{index}
/_cat/master
/_cat/nodes
/_cat/tasks
/_cat/indices
/_cat/indices/{index}
/_cat/segments
/_cat/segments/{index}
/_cat/count
/_cat/count/{index}
/_cat/recovery
/_cat/recovery/{index}
/_cat/health
/_cat/pending_tasks
/_cat/aliases
/_cat/aliases/{alias}
/_cat/thread_pool
/_cat/thread_pool/{thread_pools}
/_cat/plugins
/_cat/fielddata
/_cat/fielddata/{fields}
/_cat/nodeattrs
/_cat/repositories
/_cat/snapshots/{repository}
/_cat/templates
4.创建索引
http://192.168.1.180:9200/wudl_es
5.插入数据:
http://192.168.1.180:9200/wudl_es/1
{
"title":"flink",
"category":"华为",
"images":"http://www.baidu.com",
"price":3999.00
}
6. 查询添加数据
http://192.168.1.180:9200/wudl_es/_search
{
"query": {
"match_all": {}
}
}