kibana 配置修改,解决经常掉线的问题
kibana.yaml将以下默认值进行修改. kibana官方配置说明
1.增加日志
# Enables you specify a file where Kibana stores log output.
#logging.dest: stdout
logging.dest: /logs-path/kibana.log
调整maxPayloadBytes
server.maxPayloadBytes:
默认值: 1048576 服务器请求的最大负载,单位字节
# The maximum payload size in bytes for incoming server requests.
#server.maxPayloadBytes: 1048576 # 默认为1M
server.maxPayloadBytes: 52428800 # 现在调整为50M
只打印错误日志
logging.quiet:
默认值: false 该值设为 true 时,禁止除错误信息除外的所有日志输出。
# Set the value of this setting to true to suppress all logging output other than error messages.
#logging.quiet: false
logging.quiet: true
增加自愈脚本
keep_kibana_online.sh
#!/bin/bash
# author: derek
KB_PORT=5601
kibana_pid_num=`lsof -i:${KB_PORT} | wc -l`
KB_BIN=/data/elk/kibana/bin
# check count of kibana pid if 0, kibana may dead;
#
if [ "${kibana_pid_num}" = 0 ]
then
echo "kibana service is down, restarting in process now..."
cd ${KB_BIN}
./kibana > /dev/null 2>&1 &
else
kb_pid=`ps -ef|netstat -anp |grep ${KB_PORT} |grep -v grep |awk '{printf $7}'|cut -d / -f 1`
echo "kibana now is alive, pid is ${kb_pid}"
fi
添加到crontab 每10分钟轮训检查一次
# cronta -e
*/10 * * * * sh /BIN_PATH/keep_kibana_online.sh
==========================================================
vi filebeat.yml
processors:
- drop_fields:
fields: ["input_type", "log.offset", "host.name", "input.type", "agent.hostname", "agent.type", "ecs.version", "agent.ephemeral_id", "agent.id", "agent.version", "fields.ics", "log.file.path", "log.flags" ,"agent.ephemeral_id","agent.id","agent.type","agent.version","agent.hostname","cloud.availability_zone","cloud.instance.id","cloud.provider","cloud.region","ecs.version","host.architecture","host.containerized","host.id","host.os.codename","host.os.family","host.os.kernel","host.os.name","host.os.platform","host.os.version"]
monitoring:
enabled: true
elasticsearch: ["http://172.16.0.11:9200"]
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· DeepSeek “源神”启动!「GitHub 热点速览」
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
2021-10-27 RabbitMQ 安装
2019-10-27 虚拟机vmware centos7 扩展磁盘空间