问题
IP Address:
- Web Application ->
192.168.x.209
- HAProxy ->
192.168.x.211
- Logstash Shipper ->
192.168.x.210
With the below configuration, HAProxy is not able to receive logs from Logstash application and thus logstash shipper is not able to receive the logs.
Following are the configurations I did:
WebApplication - logback.xml
<appender name="stash"
class="net.logstash.logback.appender.LogstashAccessTcpSocketAppender">
<destination>192.168.x.211:5001</destination>
<encoder class="net.logstash.logback.encoder.LogstashEncoder" />
</appender>
HAProxy Config
listen logstash
bind :5001
mode tcp
balance leastconn
option tcplog
server logstash01 192.168.x.212:5001 check
server logstash02 192.168.x.210:5001 check
Logstash Shipper - config
input{
tcp{
type => "log1"
port => 5001
codec => "json"
}
tcp{
type => "log2"
port => 5002
codec => "json"
}
output {
stdout{
codec => rubydebug
}}
Is there anything wrong with the configuration? help required.
回答1:
Found the issue.
This was because firewall rules were active. After shutting it down, things worked as expected.
service iptables stop
setenv 0
来源:https://stackoverflow.com/questions/36865109/loadbalancing-logback-logstash-logs-using-haproxy