1、安装ES Kibana

  1. #安装Es
  2. # 将docker里的目录挂载到linux的/mydata目录中
  3. # 修改/mydata就可以改掉docker里的
  4. mkdir -p /mydata/elasticsearch/config
  5. mkdir -p /mydata/elasticsearch/data
  6. # es可以被远程任何机器访问
  7. echo "http.host: 0.0.0.0" >/mydata/elasticsearch/config/elasticsearch.yml
  8. # 递归更改权限,es需要访问
  9. chmod -R 777 /mydata/elasticsearch/
  10. docker run --name elasticsearch -p 9200:9200 -p 9300:9300 \
  11. -e "discovery.type=single-node" \
  12. -e ES_JAVA_OPTS="-Xms64m -Xmx512m" \
  13. -v /mydata/elasticsearch/config:/usr/share/elasticsearch/config \
  14. -v /mydata/elasticsearch/data:/usr/share/elasticsearch/data \
  15. -v /mydata/elasticsearch/plugins:/usr/share/elasticsearch/plugins \
  16. -d elasticsearch:7.6.2
  17. # 设置开机启动elasticsearch
  18. docker update elasticsearch --restart=always
  19. #a安装Kibana 把他的配置文件映射
  20. 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
  21. # 设置开机启动kibana
  22. docker update kibana --restart=always