Working with the Official NiFi Docker Image

Updates as of January 29th, 2019 - Nifi v1.8.0
Nifi’s official docker image has come quite a ways since the first release in 1.2.0. There have been some quality of life changes as well as fixes to things missed on the first run through. We are updating this post for most of those new additions and have a full post about clustering in docker. The readme/quickstart on Nifi’s docker hub page has been fleshed out and contains quite a bit of documentation, so definitely check there for more features.

To start with, there is now a latest tag, so a quick docker pull apache/nifi now works! Quite a few of the nifi.properties have been exposed via environment variables and you can now run a secured instance, via certificates or LDAP, through the official image. This includes clustering variables such as address, protocol, max threads, zookeeper address, etc. The docker image also now contains the nifi-toolkit, which allows you to manage a cluster and run various commands from the cli. To use the toolikt, after the container is running, you can just run a docker exec command, docker exec -ti nifi nifi-toolkit-current/bin/cli.sh nifi current-user, to get the current user, which should print out anonymous. We’ll go into a deeper dive about using the official docker image in our clustering post.

Apache Nifi’s 1.2.0 release, brought with it an official docker image on the docker hub. So let’s get started.

Pull the docker image, note after a latest tag is created you can drop the release version.

docker pull apache/nifi:1.2.0

Next, start the image as is to see it run. The -p 8080:8080 exposes the remote nifi port locally.

docker run -p 8080:8080 apache/nifi:1.2.0

Last, we can use docker volume to add a custom nar. Split the commands in two so the volume or nar is created before starting the image. Doing it this way will allow you to use the docker cp command to replace the nifi.properties file too.

docker create --name nifi \
   -v /FULL_PATH/sample.nar:/opt/nifi/nifi-1.2.0/lib/sample.nar \  
   apache/nifi:1.2.0
docker start nifi

Visit localhost:8080 to view nifi.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值