信息:

  • Docker版本($ docker --version):Docker版本18.06.1-ce,版本e68fc7a
  • 系统信息($ cat /etc/centos-release):CentOS Linux release 7.5.1804 (Core)

第一步:配置镜像加速

sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://registry.docker-cn.com/"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
阿里镜像加速地址

第二步:系统调优(必须)

.修改/etc/sysctl.conf,追加内容
$ vm.max_map_count=
$ fs.file-max=
$ sysctl -p

第三步: 部署EFK

$ mkdir my_efk
$ cd my_efk
$ mkdir conf
$ cd conf
vim fluent.conf
# my_efk/conf/fluent.conf
<source>
@type forward
port 24224
bind 0.0.0.0
</source>
<match *.**>
@type copy
<store>
@type elasticsearch
host elasticsearch
port 9200
logstash_format true
logstash_prefix fluentd
logstash_dateformat %Y%m%d
include_tag_key true
type_name access_log
tag_key @log_name
flush_interval 1s
</store>
<store>
@type stdout
</store>
</match>
vim Dockerfile
 # my_efk/Dockerfile
 FROM fluent/fluentd
 RUN ["gem", "install", "fluent-plugin-elasticsearch", "--no-rdoc", "--no-ri", "--version", "1.9.7"]
vim docker-compose.yml 
# my_efk/docker-compose.yaml
version: '3.1'

services:

  fluentd:
container_name: 'fluentd'
build: .
ports:
- :
- :/udp
networks:
- net_db
volumes:
- ./conf:/fluentd/etc
- ./log:/fluentd/log elasticsearch:
container_name: 'elasticsearch'
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.
environment:
- discovery.type=single-node
volumes:
- ./esdata:/usr/share/elasticsearch/data
ports:
- :
- :
networks:
- net_db kibana:
container_name: 'kibana'
image: docker.elastic.co/kibana/kibana:6.2.
ports:
- :
networks:
- net_db networks:
net_db:
external: true
docker network create net_db
docker-compose up -d

docker-compose 部署 EFK的更多相关文章

  1. Docker Compose部署 EFK(Elasticsearch + Fluentd + Kibana)收集日志

    简述 本文用于记录如何使用Docker Compose部署 EFK(Elasticsearch + Fluentd + Kibana) 收集Docker容器日志,使用EFK,可以无侵入代码,获得灵活, ...

  2. 使用Docker Compose部署基于Sentinel的高可用Redis集群

    使用Docker Compose部署基于Sentinel的高可用Redis集群 https://yq.aliyun.com/articles/57953 Docker系列之(五):使用Docker C ...

  3. Docker Compose 部署前后端分离应用

    部署前后端分离应用 容器化 Abp 应用 关于 Abp 应用的容器化,其实和普通的 ASP.NET Core 应用差不多,大家可以参考我此前的文章. 唯一需要注意的是:因为 Abp 解决方案中有多个项 ...

  4. Docker Compose部署项目到容器-基于Tomcat和mysql的项目yml配置文件代码

    场景 Docker-Compose简介与Ubuntu Server 上安装Compose: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/deta ...

  5. 在Windows Server 2019通过Docker Compose部署Asp.Net Core

    一.安装Docker Enterprise 安装文档是: https://docs.docker.com/install/windows/docker-ee/ 安装完成后,如下图 二.首先,拉取一个W ...

  6. 使用Docker Compose 部署Nexus后初次登录账号密码不正确,并且在nexus-data下没有admin,password

    场景 Ubuntu Server 上使用Docker Compose 部署Nexus(图文教程): https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/ ...

  7. Ubuntu Server 上使用Docker Compose 部署Nexus(图文教程)

    场景 Docker-Compose简介与Ubuntu Server 上安装Compose: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/deta ...

  8. Docker Compose部署Nexus3时的docker-compose,yml代码

    场景 Docker-Compose简介与Ubuntu Server 上安装Compose: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/deta ...

  9. Docker Compose部署GitLab服务,搭建自己的代码托管平台(图文教程)

    场景 Docker-Compose简介与Ubuntu Server 上安装Compose: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/deta ...

  10. 使用Docker Compose 部署Nexus后提示:Unable to create directory /nexus-data/instance

    场景 Ubuntu Server 上使用Docker Compose 部署Nexus(图文教程): https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/ ...

随机推荐

  1. Log Structured Merge Trees (LSM)

    1      概念 LSM = Log Structured Merge Trees 来源于google的bigtable论文. 2      解决问题 传统的数据库如MySql采用B+树存放数据,B ...

  2. November 18th 2016 Week 47th Friday

    Get a livelihood and then practise virtue. 先谋生,而后修身. If you can't earn a life, all the things you ha ...

  3. 51 nod 1682 中位数计数

    题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1682 1682 中位数计数 基准时间限制:1 秒 空间限制: ...

  4. 1491. [NOI2007]社交网络【最短路计数】

    Description 在社交网络(socialnetwork)的研究中,我们常常使用图论概念去解释一些社会现象.不妨看这样的一个问题. 在一个社交圈子里有n个人,人与人之间有不同程度的关系.我们将这 ...

  5. arcgis api for javascript本地部署加载地图

    最近开始学习arcgis api for javascript,发现一头雾水,决定记录下自己的学习过程. 一.下载arcgis api for js 4.2的library和jdk,具体安装包可以去官 ...

  6. C# winform webbrowser如何指定内核为IE11?

    1)假设你应用程序的名字为MyApplication.exe 2)运行Regedit,打开注册表,找到 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsof ...

  7. mongodb的学习-3-在Mac上的安装配置

    1.使用homebrew安装: brew install mongodb 查看安装好的版本: mongo --version MongoDB shell version v3.6.4 git vers ...

  8. 企业案例 【故障修复】mysql主从故障解决过程

    由于配置有zabbix监控,某日收到zabbix监控主从报警,,查看mysql状态, showslave status \G; slave复制状态有误,SLAVE_SQL_RUNNING为NO, 接着 ...

  9. no persistent volumes available for this claim and no storage class is set FailedBinding -- nfs --存储

    添加PV标签oc label pv registrypv disktype=registry oc get pv --show-labels NAME CAPACITY ACCESSMODES REC ...

  10. 第二章 Js语法

    来博客园已经有二年了,看了看自己发布的内容,少的可怜.完全背离了自己的初衷.how time fly,想着自己两年后,还是没写什么东西,岂不是白白浪费时间!有感于王宝强说的那句话,“好好活着,做有意义 ...