Docker部署ES+Kibana

Docker部署ES+Kibana

#es暴露的端口很多
#es十分得耗内存
#es的数据一般需要放置到安全目录,挂载
#--net somenetwork 网络配置

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

#启动了 linux就卡住了 docker stats 查看cpu的状态
#es是十分耗内存的1.xG, 1核2G
#停止整个docker 或者重启服务器
#查看docker stats
#测试一下es是否成功了
[root@iZ2zedtw714kk6kmn4p41qZ ~]# curl localhost:9200
{
  "name" : "b0eb4af54cc0",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "hqyiEoJOSUa6IVhtuBYXbw",
  "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"
}

Docker部署ES+Kibana_第1张图片

#赶紧关闭,增加内存的限制 修改配置文件 -e环境配置修改
docker run -d --name elasticsearch02 -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx512m" elasticsearch:7.6.2
#查看docker stats
#测试
[root@iZ2zedtw714kk6kmn4p41qZ ~]# curl localhost:9200
{
  "name" : "b0eb4af54cc0",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "hqyiEoJOSUa6IVhtuBYXbw",
  "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"
}

Docker部署ES+Kibana_第2张图片

连接kibana就需要Linux内网去连接。

你可能感兴趣的:(docker,docker,elasticsearch,linux,centos)