Docker部署 ES Kibana

  • Docker部署 ES Kibana

Run Elasticsearch:

$ docker run -d --name elasticsearch --net somenetwork -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:tag

一、启动elasticsearch

# docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.6.2

# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9baadd19b609 elasticsearch:7.6.2 "/usr/local/bin/dock…" 37 seconds ago Up 35 seconds 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp elasticsearch 

二、查询docker CPU内存使用情况

# docker stats

# docker stop 9baadd19b609
9baadd19b609

三、增加内存限制 

# docker run -d --name elasticsearch01 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx512m" elasticsearch:7.6.2
a071457ea8c0d8f2ca098ec6da52d6d268f1122511d9e57720b911d28c05ec5a
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a071457ea8c0 elasticsearch:7.6.2 "/usr/local/bin/dock…" 27 seconds ago Up 25 seconds 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 0.0.0.0:9300->9300/tcp, :::9300->9300/tcp elasticsearch01
# docker stats a071457ea8c0

测试:curl localhost:9200

# curl localhost:9200
{
  "name" : "a071457ea8c0",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "UCXl_SjhSoeLs5tL6vhdsw",
  "version" : {
    "number" : "7.6.2",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "ef48eb35cf30adf4db14086e8aabd07ef6fb113f",
    "build_date" : "2020-03-26T06:34:37.794943Z",
    "build_snapshot" : false,
    "lucene_version" : "8.4.0",
    "minimum_wire_compatibility_version" : "6.8.0",
    "minimum_index_compatibility_version" : "6.0.0-beta1"
  },
  "tagline" : "You Know, for Search"
}

 

posted on 2022-04-12 01:08  HelonTian  阅读(184)  评论(0编辑  收藏  举报