GithubHelp home page GithubHelp logo

prasproject / nifi-docker Goto Github PK

View Code? Open in Web Editor NEW

This project forked from anair-it/nifi-docker

0.0 0.0 0.0 9.3 MB

Apache Nifi docker project with IBM MQ and Oracle client jars. Log4j2 and Elasticsearch 5 based UDP collector template attached

License: MIT License

nifi-docker's Introduction

Nifi docker

Build a nifi docker image on Alpine Linux distro. A sample Nifi flow is included.

Version

  • Nifi: 1.1.2
  • IBM MQ client: 7.5.0.2
  • Oracle client: 11.2.0.3
  • Elasticsearch: 5.2.2
  • X pack: 5.0.1

Dockerhub: https://hub.docker.com/r/anoopnair/nifi-alpine/

Usage

If you want Nifi to connect Elasticsearch, follow the steps

  • docker-compose up

Destroy cluster:

  • docker-compose stop OR
  • Ctrl C

URLs:

Notes

  • Elasticsearch, x-pack transport, IBM MQ and Oracle client libraries are copied to /opt/nifi/extra_lib directory on the container. This allows Nifi flows to talk to Elasticsearch 5, IBM MQ 7.5 and Oracle 11g
  • /opt/nifi/xsl directory is created to hold XSL documents for transformation. Use "volumes" in docker-compose.yml to mount a host xsl directory to the container /opt/nifi/xsl directory

Sample Nifi flow

UDP application log collector

This Nifi flow collects logs on a UDP port from a log4j based application and ship them to elasticsearch

  • Create a elasticsearch index applog. curl --user elastic:changeme -XPUT 'http://localhost:9200/applog/'

  • Create kibana index applog

  • Import Nifi template applog-collector.xml

  • Default UDP port is 9991

  • Verify elasticsearch connection info. Use elasticsearch userid/password as elastic/changeme

  • Identify Nifi hostname using docker inspect

  • Configure Apache log4j2 to send JSON logs to UDP server in Nifi. Import log4j2 dependencies.

  • Add the log4j2 UDP socket appender that formats log statements to JSON format:

      <Socket name="udp-socket" host="{nifi-host}" port="9991" protocol="UDP">
    			<JSONLayout compact="true"/>
      	</Socket>
    
  • Run the application program to spit out log statements

  • Check out kibana to see logs

Controller services for MQ and Oracle

JMS Connection Factory provider

Here is the screenshot of setting up connection to IBM MQ: alt text

  • Use PublshJMS Nifi processor to publish to an IBM MQ Queue
  • Use ConsumeJMS Nifi processor to consume from an IBM MQ Queue
  • Enter the Queue name and setup the controller service and you are good to go

DBCP Connection Pool

Here is the screenshot of setting up connection to Oracle DB: alt text

Reference

nifi-docker's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.