我在使用 Elasticsearch 方面拥有丰富的经验,我使用过 2.4 版本,现在正在尝试学习新的 Elasticsearch。我正在尝试实现 Filebeat 将我的 apache 和系统日志发送到我的 Elasticsearch 端点。为了节省时间,我更愿意在公共域下通过 AWS Elasticsearch Service 启动 t2.medium 单节点实例,并且我已附加访问策略以允许每个人访问集群。AWS Elasticsearch 实例已启动并运行正常。我启动了 Ubuntu(18.04) 服务器,下载了 filebeat tar 并在中进行了以下配置filebeat.yml
:
#-------------------------- Elasticsearch output ------------------------------
output.elasticsearch:
# Array of hosts to connect to.
hosts: ["https://my-public-test-domain.ap-southeast-1.es.amazonaws.com:443"]
18.04- # Optional protocol and basic auth credentials.
#protocol: "https"
#username: "elastic"
#password: "changeme"
Run Code Online (Sandbox Code Playgroud)
我启用了所需的模块:
filebeat modules enable system apache
Run Code Online (Sandbox Code Playgroud)
然后根据 filebeat 文档,我更改了 filebeat 文件的所有权,并使用以下命令启动 filebeat:
sudo chown root filebeat.yml
sudo ./filebeat -e
Run Code Online (Sandbox Code Playgroud)
当我启动 filebeat 时,我遇到了以下权限和所有权问题:
Error loading config …
Run Code Online (Sandbox Code Playgroud) amazon-web-services elasticsearch aws-elasticsearch elastic-beats
我正在编写一个 kibana 插件和一个 Logstash 管道。对于我的测试,我只是编写了一个像这样的 Logstash 输入:
input {
beats {
port => 9600
ssl => false
ssl_verify_mode => "none"
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试打开与节点的连接(上面的代码)时:
invoke = (parameters, id, port, host) => {
var fs = require('fs');
console.log(`Sending message in beats, host= ${host}, port= ${port}, message= ${parameters.message}`);
var connectionOptions = {
host: host,
port: port
};
var client = lumberjack.client(connectionOptions, {rejectUnauthorized: false, maxQueueSize: 500});
client.writeDataFrame({"line": id + " " + parameters.message});
}
Run Code Online (Sandbox Code Playgroud)
Logstash 给我“无效的 Beats 协议版本:22”和“无效的 Beats 协议版本:3”:
Caused by: org.logstash.beats.InvalidFrameProtocolException: Invalid …
Run Code Online (Sandbox Code Playgroud) 我们可以使用一些帮助来了解如何将 Spark 驱动程序和工作日志发送到 Azure Databricks 之外的目的地,例如 Azure Blob 存储或使用 Eleastic-beats 的弹性搜索。
配置新集群时,get reg 日志传送目标的唯一选项是 dbfs,请参阅
https://docs.azuredatabricks.net/user-guide/clusters/log-delivery.html。
非常感谢任何意见,谢谢!
我有以下基础设施:
ELK 安装为 docker 容器,每个容器都在自己的容器中。在运行 CentOS 的虚拟机上,我安装了 nginx Web 服务器和 Filebeat 来收集日志。我在 filebeat 中启用了 nginx 模块。
> filebeat modules enable nginx
Run Code Online (Sandbox Code Playgroud)
在开始使用 filebeat 之前,我使用 elasticsearch 进行了设置,并在 kibana 上安装了它的仪表板。
配置文件(我已经从文件中删除了不必要的注释):
filebeat.config.modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false
setup.kibana:
host: "172.17.0.1:5601"
output.elasticsearch:
hosts: ["172.17.0.1:9200"]
Run Code Online (Sandbox Code Playgroud)
然后在elasticsearch和kibana中进行设置
> filebeat setup -e --dashboards
Run Code Online (Sandbox Code Playgroud)
这工作正常。事实上,如果我保持这种方式一切正常。我可以使用 kibana 中收集的日志,并使用我通过上述命令安装的 NGinX 的仪表板。
我想将日志传递给 Logstash。这是我的 Logstash 配置使用以下管道:
- pipeline.id: filebeat
path.config: "config/filebeat.conf"
Run Code Online (Sandbox Code Playgroud)
文件节拍.conf:
input {
beats {
port => 5044
}
}
#filter {
# mutate {
# add_tag => ["filebeat"]
# …
Run Code Online (Sandbox Code Playgroud)