logging - Bind exception while Flume listen Syslog on another Server -
environment
i have 2 ubuntu 14.04 servers, running in oracle virtual machines on windows 7 machine, can see each other ping:
- server 1 has syslog-ng component (ip:192.168.1.1) listening postgresql db
- server 2 has apache flume (ip:192.168.1.2)
server 1 has syslog-ng.conf file (partial):
# postgresql_logger destination logpgsql { file("/var/log/pgsql"); }; destination loghost {tcp("192.168.1.2" port(41414));}; # ip of server two. correct? filter f_postgres { facility(local0); }; filter f_sql_insert {match(".*insert prova.*;");}; log { source(s_src); filter(f_postgres); filter(f_sql_insert); destination(loghost); destination(logpgsql);};
(server 1 correctly receives messages s_src, correctly persist them in pgsql log file)
server 2 has flume-syslog.conf file:
# name components on agent a1.sources = r1 a1.sinks = k1 a1.channels = c1 # tcp based syslog source a1.sources.r1.type = syslogtcp a1.sources.r1.port = 41414 a1.sources.r1.host = 192.168.1.1 # ip of server one. correct? # describe sink a1.sinks.k1.type = logger # channel buffers events in memory a1.channels.c1.type = memory a1.channels.c1.capacity = 1000 a1.channels.c1.transactioncapacity = 100 # source , sinks channel a1.sources.r1.channels = c1 a1.sinks.k1.channel = c1
when start flume application :
flume-ng agent --conf conf --conf-file conf/flume-syslog.conf --name a1 -dflume.root.logger=info,console
i exception:
2015-04-25 11:58:39,236 (lifecyclesupervisor-1-1) [info - org.apache.flume.source.syslogtcpsource.start(syslogtcpsource.java:118)] syslog tcp source starting... 2015-04-25 11:58:39,237 (lifecyclesupervisor-1-1) [error - org.apache.flume.lifecycle.lifecyclesupervisor$monitorrunnable.run(lifecyclesupervisor.java:253)] unable start eventdrivensourcerunner: { source:org.apache.flume.source.syslogtcp source{name:r1,state:idle} } - exception follows. org.jboss.netty.channel.channelexception: failed bind to: /192.168.1.1:41414 @ org.jboss.netty.bootstrap.serverbootstrap.bind(serverbootstrap.java:297) @ org.apache.flume.source.syslogtcpsource.start(syslogtcpsource.java:123) @ org.apache.flume.source.eventdrivensourcerunner.start(eventdrivensourcerunner.java:44) @ org.apache.flume.lifecycle.lifecyclesupervisor$monitorrunnable.run(lifecyclesupervisor.java:251) @ java.util.concurrent.executors$runnableadapter.call(executors.java:471) @ java.util.concurrent.futuretask.runandreset(futuretask.java:304) @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.access$301(scheduledthreadpoolexecutor.java:178) @ java.util.concurrent.scheduledthreadpoolexecutor$scheduledfuturetask.run(scheduledthreadpoolexecutor.java:293 ) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) @ java.lang.thread.run(thread.java:745) caused by: java.net.bindexception: cannot assign requested address @ sun.nio.ch.net.bind0(native method) @ sun.nio.ch.net.bind(net.java:444) @ sun.nio.ch.net.bind(net.java:436) @ sun.nio.ch.serversocketchannelimpl.bind(serversocketchannelimpl.java:214) @ sun.nio.ch.serversocketadaptor.bind(serversocketadaptor.java:74) @ org.jboss.netty.channel.socket.nio.nioserversocketpipelinesink.bind(nioserversocketpipelinesink.java:140) @ org.jboss.netty.channel.socket.nio.nioserversocketpipelinesink.handleserversocket(nioserversocketpipelinesink.java:90) @ org.jboss.netty.channel.socket.nio.nioserversocketpipelinesink.eventsunk(nioserversocketpipelinesink.java:64) @ org.jboss.netty.channel.channels.bind(channels.java:569) @ org.jboss.netty.channel.abstractchannel.bind(abstractchannel.java:189) @ org.jboss.netty.bootstrap.serverbootstrap$binder.channelopen(serverbootstrap.java:342) @ org.jboss.netty.channel.channels.firechannelopen(channels.java:170) @ org.jboss.netty.channel.socket.nio.nioserversocketchannel.<init>(nioserversocketchannel.java:80) @ org.jboss.netty.channel.socket.nio.nioserversocketchannelfactory.newchannel(nioserversocketchannelfactory.java:158) @ org.jboss.netty.channel.socket.nio.nioserversocketchannelfactory.newchannel(nioserversocketchannelfactory.java:86) @ org.jboss.netty.bootstrap.serverbootstrap.bind(serverbootstrap.java:276) ... 10 more
what due? thank in anticipating.
in flume-syslog.conf on server 1 ip should self one:
# tcp based syslog source a1.sources.r1.type = syslogtcp a1.sources.r1.port = 41414 a1.sources.r1.host = 192.168.1.2
Comments
Post a Comment