信息:

  • 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. QQ邮箱验证码

    人的记忆有时候跟鱼一样,只有七秒钟,短暂的时间! .NET  Web窗体实现忘记密码,使用QQ邮箱验证修改 一.首先设置一下发送个人或企业发送的邮箱 二.登录邮箱进行设置,如图:  三.关闭邮箱 四. ...

  2. 使用concurrent.futures模块并发,实现进程池、线程池

    Python标准库为我们提供了threading和multiprocessing模块编写相应的异步多线程/多进程代码 从Python3.2开始,标准库为我们提供了concurrent.futures模 ...

  3. Linux 下安装配置 JDK7 配置环境(debian 7)

    自从从Oracle收购Sun近三年来,已经有很多变化.早在8月,甲骨文将“Operating System Distributor License for Java”许可证终结,这意味着第三方将不可以 ...

  4. 洛谷 P2045 方格取数加强版【费用流】

        题目链接:https://www.luogu.org/problemnew/show/P2045 题目描述 给出一个n*n的矩阵,每一格有一个非负整数Aij,(Aij <= 1000)现 ...

  5. 如何动态调用 C 函数

    JSPatch 支持了动态调用 C 函数,无需在编译前桥接每个要调用的 C 函数,只需要在 JS 里调用前声明下这个函数,就可以直接调用: require('JPEngine').addExtensi ...

  6. 在yii中使用memcache

    yii中可以很方便的使用memcache 一.配置在main.php的components中加入cache配置 array( 'components'=>array( 'cache'=>a ...

  7. Hive学习之路 (四)Hive的连接3种连接方式

    一.CLI连接 进入到 bin 目录下,直接输入命令: [hadoop@hadoop3 ~]$ hive SLF4J: Class path contains multiple SLF4J bindi ...

  8. 程序集(Assembly)和模块(Managed Module)

    前言 一直都用集成开发坏境(IDE),一直对模块和程序集的概念理解的不是很直观,因为一Build就把你的单个模块塞进程序集里面去了.当然,对你的编程也不会造成太大的影响.但有些东西你最好还是知道比较好 ...

  9. kubenetes 1.9 学习 pod - volume -- dashboard

    kubelet: the component that runs on all of the machines in your cluster and does things like startin ...

  10. Oracle 创建函数

    Oracle创建函数的方法如下: CREATE OR REPLACE FUNCTION FunctionName ( --传入参数 para NCHAR ) RETURN NUMBER IS --函数 ...