【Docker】安装ELK(Docker Compose)

一、创建挂载目录


mkdir -p /docker/elk/elasticsearch/{plugins,data}
mkdir -p /docker/elk/logstash


二、给目录授权


chmod 777 /docker/elk/elasticsearch/data

创建logstash配置文件
vim /docker/elk/logstash/logstash.conf

input {
tcp {
mode => "server"
host => "0.0.0.0"
port => 4560
codec => json_lines
}
}

output {
elasticsearch {
hosts => "es:9200"
index => "logstash-service-%{+YYYY.MM.dd}"
}
}



三、创建docker-compose配置文件


vim /docker/elk/docker-compose.yml
1.
version: '3'
services:
elasticsearch:
image: elasticsearch:6.4.0
container_name: elasticsearch
environment:
- "cluster.name=elasticsearch" #设置集群名称为elasticsearch
- "discover

你可能感兴趣的:(云原生,Docker,技术研发,docker,elk,jenkins)