1.拉代码
git clone https://github.com/deviantony/docker-elk.git
2.docker-compose配置文件
[root@host7 docker-elk]# cat /root/docker-elk/docker-compose.yml|egrep -v '^$' version: '2' services: elasticsearch: build: context: elasticsearch/ args: ELK_VERSION: 7.1.0 volumes: - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro - /etc/localtime:/etc/localtime ports: - "9200:9200" - "9300:9300" environment: ES_JAVA_OPTS: "-Xmx1024m -Xms1024m" ELASTIC_PASSWORD: changeme networks: - elk logstash: build: context: logstash/ args: ELK_VERSION: 7.1.0 volumes: - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro - ./logstash/pipeline:/usr/share/logstash/pipeline:ro - /var/log:/var/log - /etc/localtime:/etc/localtime ports: - "5000:5000" - "9600:9600" environment: LS_JAVA_OPTS: "-Xmx1024m -Xms1024m" networks: - elk depends_on: - elasticsearch kibana: build: context: kibana/ args: ELK_VERSION: 7.1.0 volumes: - ./kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro - /etc/localtime:/etc/localtime ports: - "5601:5601" networks: - elk depends_on: - elasticsearch networks: elk: driver: bridge
3.修改版本号
sed -i '/:7.2.0/ s#:7.2.0#:7.1.0#' ./*.yml