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:

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,, 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 can work with this.

then make.

All done.

Build omhdfs for Rsyslog by @sskaje: