Docker版EKL安装记录文档

  • 拉取已下三个镜像
docker.io/logstash        7.5.2               b6518c95ed2f        6 months ago        805 MB
docker.io/kibana 7.5.2 a6e894c36481 6 months ago 950 MB
docker.io/elasticsearch 7.5.2 929d271f1798 6 months ago 779 MB

部署ES

  • 修改系统配置文件

官方参考链接

注意一

️准备 config,data,logs三个文件夹,文件夹里需要有配置的就config文件夹。

注意二

️ config 是elasticsearch容器默认的配置文件,我们需要修改elasticsearch.yml文件,不然还是启动不了,配置如下:

#cluster.name: "docker-cluster"
#network.host: 0.0.0.0
cluster.name: "docker-cluster"
node.name: node-1
network.host: 0.0.0.0
bootstrap.system_call_filter: false
cluster.initial_master_nodes: ["node-1"]
xpack.license.self_generated.type: basic

注意三

️ data,logs文件夹可手动创建,需要给他们root账号的读写执行权限,我这给的是775 权限足够了,权限可参考如下:

[root@localhost elasticsearch]# ls -al
总用量 0
drwxr-xr-x 6 root root 89 7月 21 16:45 .
drwxr-xr-x 5 root root 73 7月 21 16:25 ..
drwxr-xr-x 2 root root 178 7月 21 16:44 config
drwxrwxr-x 3 root root 27 7月 21 16:53 data
drwxrwxr-x 10 root root 283 7月 21 16:40 elasticsearch.bak
drwxrwxr-x 2 root root 133 7月 21 16:55 logs
  • 最后docker run
docker run --name elasticsearch -p 9200:9200 -v /data/EKL/elasticsearch/config:/usr/share/elasticsearch/config  -v /data/EKL/elasticsearch/data:/usr/share/elasticsearch/data  -v /data/EKL/elasticsearch/logs:/usr/share/elasticsearch/logs   -v /etc/localtime:/etc/localtime:ro   -itd elasticsearch:7.5.2

注意四

️端口可以自己改,我这就默认了

确认一下是否起来了

[root@localhost elasticsearch]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
1b0763e52708 elasticsearch:7.5.2 "/usr/local/bin/do..." 14 minutes ago Up 9 minutes 0.0.0.0:9200->9200/tcp, 9300/tcp elasticsearch

起来了后用浏览器访问一下 127.0.0.1:9200 (127.0.0.1是你自己宿主机的IP地址)

部署kibana

  • 准备 kibana的 config 文件夹,配置内容如下
#
## ** THIS IS AN AUTO-GENERATED FILE **
##
#
## Default Kibana configuration for docker target
server.name: kibana
server.host: "0"
elasticsearch.hosts: [ "http://127.0.0.1:9200" ] # 127.0.0.1:9200改为你自己的elasticsearch地址
xpack.monitoring.ui.container.elasticsearch.enabled: true # 解释链接https://blog.csdn.net/u011311291/article/details/100041912
i18n.locale: zh-CN #汉化
kibana.index: ".kibana" #配置本地索引
  • docker run 启动
docker run -itd --name kibana -p 5601:5601 -v /data/EKL/kibana/config:/usr/share/kibana/config  -v /etc/localtime:/etc/localtime:ro kibana:7.5.2

注意五

️开放所用到的端口,我这里是9200,5601,浏览器访问127.0.0.1:5601 (127.0.0.1是你自己宿主机的IP)

部署logstash

  • 准备好logstash的 config跟pipeline文件

注意六

️修改config下的 logstash.yml ; logstash-sample.conf 两个配置文件中的 elasticsearch 地址配置地址如下

[root@test config]# cat logstash.yml
http.host: "0.0.0.0"
xpack.monitoring.elasticsearch.hosts: [ "http://127.0.0.1:9200" ] [root@test config]# cat pipelines.yml
# This file is where you define your pipelines. You can define multiple.
# For more information on multiple pipelines, see the documentation:
# https://www.elastic.co/guide/en/logstash/current/multiple-pipelines.html - pipeline.id: main
path.config: "/usr/share/logstash/pipeline" #这是服务配置路径,可改。我这暂且不改。 [root@test config]# cat logstash-sample.conf # Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline. input {
beats {
port => 5044
}
} output {
elasticsearch {
hosts => ["http://127.0.0.1:9200"]
index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
#user => "elastic"
#password => "changeme"
}
}

注意七

️:以上 127.0.0.1:9200 需改为自己宿主机的地址

其实到这一步就差不多了,接下来就是对监控的logs做相关的配置了,我是对java的logs做个监控,需在 pipeline 下创建一个 java.conf (命名可改随你喜欢),配置如下

logstash日志配置


[root@test pipeline]# vim java.conf input {
file{
path => "/DATA/logs/chenfan-base.log" #log路径
type => "base" # 打个标签
start_position => "beginning"
}
} output {
if [type] == "base" { # 条件
elasticsearch {
hosts => ["127.0.0.1:9200"] #elasticsearch 服务地址
index => "base-%{+YYYY.MM.dd}" # 索引名字命名
codec => "json" #需将java日志装成json格式
}
}
}
docker run -itd --name logstash -p 5044:5044 -p 9600:9600  -v /DATA/logstash/docker/logstash/config:/usr/share/logstash/config -v /DATA/logstash/docker/logstash/pipeline:/usr/share/logstash/pipeline  -v /DATA/logstash/log:/DATA/logs  -v /etc/localtime:/etc/localtime:ro  logstash:7.5.2

Docker版EKL安装记录文档的更多相关文章

  1. keepalived双机热备,安装部署文档

    keepalived双击热备,安装部署文档: 下载目录:/apps/keepalived-1.2.7.tar.gz 1:---> yum install -y make wget 2:---&g ...

  2. Jmeter+Badboy安装使用文档

                  Jmeter+Badboy安装使用文档       目录   1.jmeter安装    1 2.Jmeter基础使用    3 3. 使用Jmeter进行分布式测试    ...

  3. Matlab R2018a版离线使用帮助文档方法

    转载自:Matlab R2018a版离线使用帮助文档方法 问题 Matlab R2018a版本安装后,帮助文档默认为在线方式,需要使用账号登录,如果没有激活密钥或许可证编号,就无法使用帮助文档了. 方 ...

  4. Oracle client客户端简易安装网上文档一

    Oracle client客户端简易安装网上文档一-------------------------------------------------------------------------一. ...

  5. k8s实验操作记录文档

    k8s实验操作记录文档,仅供学习参考! 文档以实验操作的过程及内容为主进行记录,涉及少量的介绍性文字(来自网络开源). 仅汇总主题所有链接,详细内容查看需要切换到相关链接.https://github ...

  6. 电脑软件安装过程文档.BA

    MD 01-打印并阅读-电脑软件安装过程文档.BAT-即此批处理脚本文档MD 02-阅读-电脑软件安装经验教训文档.DOCX-MD 03-制作-杏雨梨云USB维护系统2019中秋版之国庆更新-可启动U ...

  7. S01-晓亮的电脑软件安装过程文档 腾讯QQ 595076941 2019年10月

    S01-晓亮的电脑软件安装过程文档 腾讯QQ 595076941 2019年10月 本文档的创建作者的腾讯QQ聊天号码是 595076941 S02-电脑软件安装过程中不要随意关闭窗口除非必需关闭窗口 ...

  8. Xcode离线安装帮助文档

    Xcode离线安装帮助文档   1.在线查看帮助文件:Xcode下查看帮助文件,菜单Help-Developer Documentation在右上角搜索框中即可检索,但速度很慢,在线查看. 2.下载帮 ...

  9. CM5(Cloudera Manager 5) + CDH5(Cloudera's Distribution Including Apache Hadoop 5)的安装详细文档

    参考 :http://www.aboutyun.com/thread-9219-1-1.html Cloudera Manager5及CDH5在线(cloudera-manager-installer ...

随机推荐

  1. php进程 swoole

    <?php $pid = posix_getpid(); $ppid = posix_getppid(); var_dump($pid); cli_set_process_title(" ...

  2. selenium-窗口切换

    方法一 # 获取打开的多个窗口句柄 windows = driver.window_handles # 切换到当前最新打开的窗口 driver.switch_to.window(windows[-1] ...

  3. 单元测试之道Java版——读书笔记

    单元测试知道Java版读书笔记 首先我们必须要知道我们所写的代码,它的功能是什么,如果我们不了解代码的行为,那么也就无从测试. 我们测试的目的,是为了我们整个程序架构的稳定,代码其实就是欧文要实现功能 ...

  4. git学习(十) idea git reset 操作

    git reset 是回滚操作,在 idea 中使用如下: Reset Type 有三种: Mixed 默认方式,只保留源码,回退 commit 和 index 信息 Soft 回退到某个版本,只回退 ...

  5. git学习(六) git reset操作

    git reset 操作 git reset git reset HEAD 文件名 移除不必要的添加到暂存区的文件 git reset HEAD^ 或者 commitid 去掉上一次的提交 git r ...

  6. 2. A Distributional Perspective on Reinforcement Learning

    本文主要研究了分布式强化学习,利用价值分布(value distribution)的思想,求出回报\(Z\)的概率分布,从而取代期望值(即\(Q\)值). Q-Learning Q-Learning的 ...

  7. 线程池SingleThreadPool

    只有一个核心线程,当被占用时,其他的任务需要进入队列等待 public class MainActivity extends AppCompatActivity { @Override protect ...

  8. 解决LINK : fatal error LNK1104: 无法打开文件“xxxx.lib”

    举个例子

  9. SQL SERVER迁移--更换磁盘文件夹

    默认情况下SQL SERVER的安装路径与数据库的默认存放路径是在C盘的--这就很尴尬. 平时又不注意,有天发现C盘的剩余空间比较吃紧了,于是着手想办法迁移文件夹. 一.环境准备 数据库版本--SQL ...

  10. Luogu P2179 [NOI2012]骑行川藏

    题意 给定 \(n\) 个路段,每个路段用三个实数 \(s_i,k_i,v^\prime_i\) 描述,最小化 \[F(v_1,\cdots v_n)=\sum\limits_{i=1}^{n}\fr ...