安装 elasticsearch

  1. $ docker pull docker.elastic.co/elasticsearch/elasticsearch:7.10.2
  2. $ docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.10.2
  3. $ docker ps
  4. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  5. 2249f918cc81 docker.elastic.co/elasticsearch/elasticsearch:7.10.2 "/tini -- /usr/local…" 8 minutes ago Up 7 minutes 0.0.0.0:9200->9200/tcp, 0.0.0.0:9300->9300/tcp nervous_jones
  6. # 重命名
  7. $ docker rename 2249f918cc81 es7

安装浏览器工具 ElasticSearch Head
image.png
下载地址 : https://chrome.google.com/webstore/detail/elasticsearch-head/ffmkiejjmecolpfloofpjologoblkegm
image.png

安装 Kibana

  1. $ docker pull docker.elastic.co/kibana/kibana:7.10.2
  2. $ docker run --link YOUR_ELASTICSEARCH_CONTAINER_NAME_OR_ID:elasticsearch -p 5601:5601 docker.elastic.co/kibana/kibana:7.10.2
  3. $ docker run --link es7:elasticsearch -p 5601:5601 docker.elastic.co/kibana/kibana:7.10.2
  4. $ docker ps
  5. CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
  6. 65a5e4739050 docker.elastic.co/kibana/kibana:7.10.2 "/usr/local/bin/dumb…" 36 seconds ago Up 5 seconds 0.0.0.0:5601->5601/tcp brave_hodgkin
  7. $ docker rename 65a5e4739050 kibana7

YOUR_ELASTICSEARCH_CONTAINER_NAME_OR_ID 这个地方写自己的 container_id 或者 name

运行结果
image.png