Hey all,
Well I was able to get logstash 1.5.1 working with elasticsearch 1.6.0 and kibana 4 sitting behind nxginx! It's a pretty sweet setup. Except for the fact that I can't seem to get logstash-forwarder to connect to logstash.
I'm on logstash-forwarder-0.4.0 instaled via RPM on CentOS 7.
When I start the logstash forwarder I get this message repeating over and over again in the logs, and nothing makes its way through to the logstash server:
2015/06/27 02:00:50.479754 Connecting to [1010.10.25]:2541 (es1.mydomain.com)
2015/06/27 02:01:05.482540 Failed to tls handshake with 216.120.248.98 read tcp 10.10.10.25:2541: i/o timeout # <-- Not the real IP. Obscuring it.
I generated SSL certs and keys using the following procedure:
Create CA key
- openssl genrsa -des3 -out ca.key 4096
Create CA cert
2) openssl req -new -x509 -days 3650 -key ca.key -out ca.crt
Create es1.mydomain.com key and certificate signing request
3) openssl genrsa -des3 -out es1.mydomain.com.key 4096
4) openssl req -new -key es1.mydomain.com.key -out es1.mydomain.com.csr
Sign the es1.mydomain.com certificate
5) openssl x509 -req -days 3650 -in es1.mydomain.com.csr -CA ca.crt -CAkey ca.key -set_serial 01 -out es1.mydomain.com.crt
Remove the password from the es1.mydomain.com private key
6) openssl rsa -in es1.mydomain.com -out es1.mydomain.com.key
I placed the cert/key in this location:
-rw-------. 1 logstash logstash 2004 Jun 27 00:10 /etc/pki/tls/certs/es1.mydomain.com.crt
-rw-------. 1 logstash logstash 3243 Jun 27 00:11 /etc/pki/tls/private/es1.mydomain.com.key
For my input section I have this:
input {
lumberjack {
# The port to listen on
port => 2541
# The paths to your ssl cert and key
ssl_certificate => "/etc/pki/tls/certs/es1.mydomain.com.crt"
ssl_key => "/etc/pki/tls/private/es1.mydomain.com.key"
# Set this to whatever you want.
type => "logstash"
codec => "json"
}
}
And when I start logstash I can verify that it's listening on the specified port:
#lsof -i :2541 | head -5
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
logstash- 5106 root 8u IPv4 24517416 0t0 TCP logs.mydomain.com:33224->logs.mydomain.com:lonworks2 (ESTABLISHED)
java 6398 logstash 16u IPv6 13842083 0t0 TCP *:lonworks2 (LISTEN)
java 6398 logstash 3012u IPv6 13913271 0t0 TCP logs.mydomain.com:lonworks2->logs.mydomain.com:45634 (CLOSE_WAIT)
java 6398 logstash 3464u IPv6 13922088 0t0 TCP logs.mydomain.com:lonworks2->logs.mydomain.com:47063 (CLOSE_WAIT)
In my logstash-forwarder conf I have this:
{
"network": {
"servers": [ "logs.mydomain.com:2541" ],
"ssl ca": "/etc/pki/CA/certs/ca.crt",
"timeout": 15
},
Not sure at all where the error lies. But some troubleshooting tips and advice would be greatly appreciated!
Thanks