1、安装ES Kibana
#安装Es
# 将docker里的目录挂载到linux的/mydata目录中
# 修改/mydata就可以改掉docker里的
mkdir -p /mydata/elasticsearch/config
mkdir -p /mydata/elasticsearch/data
# es可以被远程任何机器访问
echo "http.host: 0.0.0.0" >/mydata/elasticsearch/config/elasticsearch.yml
# 递归更改权限,es需要访问
chmod -R 777 /mydata/elasticsearch/
docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
-e "discovery.type=single-node" \
-e ES_JAVA_OPTS="-Xms64m -Xmx512m" \
-v /mydata/elasticsearch/config:/usr/share/elasticsearch/config \
-v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
-v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
-d elasticsearch:7.6.2
# 设置开机启动elasticsearch
docker update elasticsearch --restart=always
#a安装Kibana 把他的配置文件映射
docker run --name kibana -e ELASTICSEARCH_HOSTS=http://t.freefish.info:9200 -v /mydata/kibana/config:/usr/share/kibana/config -p 5601:5601 -d kibana:7.6.2
# 设置开机启动kibana
docker update kibana --restart=always