docker部署es+kibana
(核心:了解如何修改环境配置文件)
了解:
(1)es暴露的端口很多
(2)es十分耗内存
(3)es的数据一般需要放置到安全目录下!挂载
1,启动
官方文档:
docker run -d --name elasticsearch --net somenetwork -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:tag
--net somenetwork :网络配置
我们自己启动:
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" elasticsearch:7.6.2
2,测试
[root@CentOs home]# curl localhost:9200
{
"name" : "d41309bda016",
"cluster_name" : "docker-cluster",
"cluster_uuid" : "VfmUBIwfQsmZohvnjuQhyQ",
"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"
}
[root@CentOs home]#
3,
dcoker stats :查看CPU的状态
4,修改配置文件,增加内存限制
-e 环境配置修改,限制了运行环境
docker run -d --name elasticsearch -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" -e ES_JAVA_OPTS="-Xms64m -Xmx512" elasticsearch:7.6.2
es与kibana: