Working with the Official NiFi Docker Image

自1.2.0版本以来,Nifi官方Docker镜像经历了重大改进,包括生活质量的提升和修复初始版本遗漏的问题。最新版本引入了如最新标签、通过环境变量暴露nifi.properties配置、支持证书或LDAP的安全实例运行等功能,并包含了nifi-toolkit,便于集群管理和CLI命令执行。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值