Build omhdfs for Rsyslog

omhttpfs is contrib-ed to rsyslog official repo as an alternative log-to-hdfs solution.

Omhdfs is not provided as an RPM from rsyslog’s offical yum repo, so I’m trying to build on a machine with hadoop installed.
My server is CentOS 6.5, with CDH 5.1 installed.

Download source from: http://www.rsyslog.com/files/download/rsyslog/rsyslog-8.2.2.tar.gz

Install dependencies:

Then I tried to:

Failed on make.
Error message:


The hdfs.h is not found.
The default CFLAGS in plugins/omhdfs/Makefile is ‘-g -O2‘, so I changed CFLAGS and LDFLAGS as below:

This time error message like:

I tried to add -fPIC to either CFLAGS or LDFLAGS or both two, same error.

The official module documentation page, http://www.rsyslog.com/doc/omhdfs.html, says java related environment variables should be set, so I set as following:

Same configure as above, same error too.

I choose /opt/cloudera/parcels/CDH/lib/hadoop/lib/native/ just because I felt .h should be come along with .a, so I locate libhdfs and found the /opt/cloudera/parcels/CDH/lib/hadoop/lib/native/libhdfs.a.

Then I tried to test if libhdfs.so can work with this.

then make.

All done.

Build omhdfs for Rsyslog by @sskaje: https://sskaje.me/2014/08/build-omhdfs-rsyslog/