安装
从 Docker 仓库中拉取镜像
1 | docker pull sebp/elk |
拉取指定版本镜像
1 | docker pull sebp/elk:671 |
启动容器
使用docker-compose
docker-compose.yml
1 | elk: |
1 | docker-compose up -d |
启动异常
m.max_map_count [65530] is too low
1
2
3
42020-08-21T04:04:58,114[o.e.b.BootstrapChecks ] [8pUsAbG] bound or publishing to a non-loopback address, enforcing bootstrap checks
2020-08-21T04:04:58,120[o.e.b.Bootstrap ] [8pUsAbG] node validation exception
[1] bootstrap checks failed
[1]: max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144]
配置 /etc/sysctl.conf
1 | $ vi /etc/sysctl.conf |
生效
1 | $ sysctl -p |
验证1
$ sysctl -a|grep vm.max_map_count
进入容器命令行
1 | # centos |
Elasticsearch 索引定时清理
- elasticsearch-curator 安装
1 | # 安装 curator 源 |
- 配置 config.yml
1 | $ mkdir -p /data/ELKStack/curator |
- 配置 action.yml 清理规则
/data/ELKStack/curator/action.yml
1 | actions: |
- 设置计划任务
1 | $ crontab -e 0 0 * * * /usr/bin/curator --config /data/ELKStack/curator/config.yml /data/ELKStack/curator/action.yml 1>> /tmp/curator.log 2>&1 |