山猪的博客-贪吃狗咖喱 山猪的博客-贪吃狗咖喱
首页
  • 操作系统
  • 数据库
  • 其他运维笔记
  • Python
  • Java
  • 其他开发笔记
  • 技术文档
  • GitHub技巧
  • Apache NiFi
  • 博客搭建
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
  • 网站
  • 资源
  • Vue资源
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

Shicong Zhou

ISTJ的IT男
首页
  • 操作系统
  • 数据库
  • 其他运维笔记
  • Python
  • Java
  • 其他开发笔记
  • 技术文档
  • GitHub技巧
  • Apache NiFi
  • 博客搭建
  • 学习
  • 面试
  • 心情杂货
  • 实用技巧
  • 友情链接
  • 网站
  • 资源
  • Vue资源
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • 技术文档

  • GitHub技巧

  • Apache NiFi

    • Apache NiFi2.0 安装
  • Nodejs

  • 博客搭建

  • 技术
  • Apache NiFi
Zhou
2024-02-18

Apache NiFi2.0 安装

# Apache NiFi2.0 安装

# 下载

Download - Apache NiFi (opens new window)

本教材下载的是NiFi 2.0.0-M2​版本,需要安装jdk21配合使用

# 设置环境变量

为了不影响服务器上面其他程序的运行,不直接修改系统环境变量,采用nifi自带的环境变量配置文件。

修改bin/nifi-env.sh​ 设置export JAVA_HOME=/opt/jdk-21.0.2/​

image​

# 自签名证书

nifi默认的证书只能本机访问,访问web会报错 400 SNI错误。

  1. 我们将conf目录下的.p12文件删除,重新创建证书
rm -rf *.p12
1
  1. 在 conf 目录下创建证书

    注意:要在第二行命令的Common Name输入服务器域名或者IP

    # 生成RSA私钥(无密码,生产环境中应设置一个)
    openssl genpkey -algorithm RSA -out nifi.key
    
    # 创建自签名证书请求(填写相关信息,如Common Name应为您的服务器IP地址)
    openssl req -new -key nifi.key -out nifi.csr
    
    # 使用私钥和CSR生成自签名证书,有效期可以自行调整(此处设置3650天)
    openssl x509 -req -days 3650 -in nifi.csr -signkey nifi.key -out nifi.crt
    # 将私钥和证书合并到一个PKCS12文件中,并设置一个密码(例如:abcdef123456)
    openssl pkcs12 -export -in nifi.crt -inkey nifi.key -out nifi.p12 -name nifi -password pass:abcdef123456
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
  2. 修改 nifi.properties 文件

    • 配置服务器地址和端口
    • 配置证书路径和密码
      ​image​

# 创建用户

./nifi.sh set-single-user-credentials admin abcdef123456
1

# 启动服务

./nifi.sh start
1

# 开放访问端口

如果服务器开启了防火墙,需要将nifi.properties 中配置的访问端口放开。

# 查看已开放的所有端口

firewall-cmd --list-ports

# 开放8443

firewall-cmd --permanent --zone=public --add-port=8443/tcp

# 重新加载防火墙规则,使更改生效

firewall-cmd --reload
1
2
3
4
5
6
7
8
9
10
11

# 客户端Web访问

访问地址:https://10.0.110.33:8443/nifi

image​

‍

编辑 (opens new window)
#Area/数据#Area/Linux
上次更新: 2024/02/23, 06:03:27
GitHub加速下载项目的方法
nodejs递归读取所有文件

← GitHub加速下载项目的方法 nodejs递归读取所有文件→

最近更新
01
Linux时间设置
02-23
02
Ubuntu开机卡GRUB
02-22
03
Ubuntu NFS服务无法启动
02-22
更多文章>
Theme by Vdoing | Copyright © 2023-2024 Shicong Zhou | 浙ICP备2023040288号-1 | 浙ICP备2023040288号 | MIT License
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式