gpt4 book ai didi

tcp - Graylog 收集器连接被拒绝

转载 作者:可可西里 更新时间:2023-11-01 02:42:29 43 4
gpt4 key购买 nike

我正在尝试创建一个 Graylog 服务器 - Graylog 收集器设置,其中 graylog 收集器在一台机器上收集系统日志文件并将它们发送到服务器。

我已经使用 AWS AMI 创建了 Graylog 服务器,它按预期工作。

我在同一台机器上安装了 Graylog 收集器,我可以在该实例的源列表中看到它。

我的问题是当我尝试连接到远程 Graylog 收集器时。

Graylog 收集器配置文件如下所示:

server-url = "http://xxx.xxx.xxx.xxx:12900/"

inputs {
syslog {
type = "file"
path = "/var/log/syslog"
}
}

outputs {
graylog-server {
type = "gelf"
host = "xxx.xxx.xxx.xxx"
port = 12201
}
}

其中 xxx.xxx.xxx.xxx 是我尝试连接的 graylog 服务器的私有(private) IP 地址。

graylog 服务器配置的摘录是:

rest_listen_uri = http://0.0.0.0:12900/

两个实例的安全组如下:

-----------------------------------------------------------------
| Type | Protocol | Port Range | Source |
-----------------------------------------------------------------
| Custom TCP Rule | TCP | 12201 | 0.0.0.0/0 |
-----------------------------------------------------------------
| Custom TCP Rule | TCP | 12900 | 0.0.0.0/0 |
-----------------------------------------------------------------

当我查看 graylog 收集器的日志时,我收到以下消息:

2015-11-14T23:41:33.948+0000 ERROR [gelfTcpTransport-1-1] gelfclient.transport.GelfTcpTransport - Connection failed: Connection refused: /xxx.xxx.xxx.xxx:12201
2015-11-14T23:41:34.949+0000 ERROR [gelfTcpTransport-1-1] gelfclient.transport.GelfTcpTransport - Connection failed: Connection refused: /xxx.xxx.xxx.xxx:12201
2015-11-14T23:41:35.951+0000 ERROR [gelfTcpTransport-1-1] gelfclient.transport.GelfTcpTransport - Connection failed: Connection refused: /xxx.xxx.xxx.xxx:12201
2015-11-14T23:41:36.953+0000 ERROR [gelfTcpTransport-1-1] gelfclient.transport.GelfTcpTransport - Connection failed: Connection refused: /xxx.xxx.xxx.xxx:12201
2015-11-14T23:41:37.956+0000 ERROR [gelfTcpTransport-1-1] gelfclient.transport.GelfTcpTransport - Connection failed: Connection refused: /xxx.xxx.xxx.xxx:12201
2015-11-14T23:41:38.698+0000 WARN [HeartbeatService RUNNING] collector.heartbeat.HeartbeatService - Unable to send heartbeat to Graylog server: ConnectException: Connection refused

(xxx.xxx.xxx.xxx 是我尝试连接的 graylog 服务器的私有(private) IP 地址)

我已经在端口 12201 和端口 12900 上的两台机器之间运行了 traceroute,没有任何问题。

谁能告诉我我的配置中可能缺少什么以允许这 2 个连接?

两者都运行 Ubuntu 14.04。

谢谢,

肖恩

最佳答案

尝试更改 Graylog Web 中的设置,"System -> Inputs" 菜单,编辑从端口 12201 监听的输入设置(在我的例子中称为 "Appliance Gelf UDP " ), 并将 "Bind Adress" 更改为您的私有(private) IP。在我的例子中,一切都在本地主机(收集器和包含 Graylog 服务器的流浪虚拟机),我写了 “127.0.0.1”“HeartbeatService RUNNING] 收集器。 heartbeat.HeartbeatService - 无法将心跳发送到 Graylog 服务器:ConnectException:连接被拒绝” 错误消息已从 Graylog 收集器的日志中消失。

这是健康收集器开始时的 STDOUT 输出:

2015-12-18T12:26:24.027+0100 INFO  [main] cli.commands.Run - Starting Collector v0.4.1 (commit 36a0856)
2015-12-18T12:26:24.032+0100 INFO [main] cli.commands.Run - Running on Windows 8.1 Windows 8.1 6.3 (amd64)
2015-12-18T12:26:25.311+0100 INFO [main] collector.utils.CollectorId - Collector ID: ff0f70f5-2d48-4b5c-9943-88031ea5e0fc
2015-12-18T12:26:25.349+0100 INFO [main] outputs.gelf.GelfOutput - Starting GELF transport: org.graylog2.gelfclient.GelfConfiguration@7ca65d82
2015-12-18T12:26:25.761+0100 INFO [gelfTcpTransport-1-1] gelfclient.transport.GelfTcpTransport - Channel disconnected!
2015-12-18T12:26:25.761+0100 INFO [main] cli.commands.Run - Service RUNNING: BufferProcessor [RUNNING]
2015-12-18T12:26:25.761+0100 INFO [main] cli.commands.Run - Service RUNNING: FileObserver [RUNNING]
2015-12-18T12:26:25.761+0100 INFO [main] cli.commands.Run - Service RUNNING: MemoryReporterService [RUNNING]
2015-12-18T12:26:25.761+0100 INFO [main] cli.commands.Run - Service RUNNING: MetricService [RUNNING]
2015-12-18T12:26:25.762+0100 INFO [main] cli.commands.Run - Service RUNNING: HeartbeatService [RUNNING]
2015-12-18T12:26:25.764+0100 INFO [main] cli.commands.Run - Service RUNNING: GelfOutput{port='12201', id='gelf-tcp', client-send-buffer-size='-1', host='127.0.0.1', inputs='', client-reconnect-delay='1000', client-connect-timeout='5000', client-tcp-no-delay='true', client-queue-size='512'}

关于tcp - Graylog 收集器连接被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33718549/

43 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com