Open2
Apache NifiをEC2に構築する

公式資料
公式サイトとGithubとDocker hub
カギ生成
openssl rand -base64 32
設定ファイルをプロジェクトディレクトリに配置
docker-compose.yml
services:
nifi:
image: apache/nifi:2.6.0
container_name: nifi
restart: unless-stopped
ports:
- "8443:8443"
environment:
# 認証(シングルユーザー)
SINGLE_USER_CREDENTIALS_USERNAME: "ユーザー名"
SINGLE_USER_CREDENTIALS_PASSWORD: "生成したカギをここに設定"
# FQDN を証明書/SNIに使って自己署名を生成
NIFI_WEB_HTTPS_HOST: "0.0.0.0"
NIFI_WEB_PROXY_HOST: "ec2-x-x-x-x.compute-1.amazonaws.com:8443"
volumes:
- nifi-conf:/opt/nifi/nifi-current/conf
- nifi-data:/opt/nifi/data
volumes:
nifi-conf: {}
nifi-data: {}
起動
docker compose up -d
停止(-vで永続化ボリューム毎削除)
docker compose down -v
正常起動ログを確認
docker logs -f nifi | egrep -i "Started server|JettyServer"
以下が表示されればOK
JettyServer Started Server on https://0.0.0.0:8443/nifi
正常起動ログを確認
ステータス200であること(HTTP/2 200)
$ curl -kI https://localhost:8443/nifi/
HTTP/2 200
date: Fri, 03 Oct 2025 14:41:14 GMT
content-security-policy: frame-ancestors 'self'
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
strict-transport-security: max-age=31540000
last-modified: Fri, 03 Oct 2025 14:27:27 GMT
content-length: 28187
content-type: text/html
accept-ranges: bytes
ブラウザアクセス
自己署名警告が出ても続行
ymlに設定したユーザー/パスでログイン
https://ec2-x-x-x-x.compute-1.amazonaws.com:8443/nifi/
