Installing Nifi
This section provides a step-by-step guide to installing Nifi.
To install Nifi, follow the steps below:
- Mount an external file system disk to a VM at
/data.
mount external file system disk to the VM at /data - Perform docker installation with below
commands.
yum update -y yum install -y yum-utils yum-config-manager --add-repo https://download.docker.com/linux/rhel/docker-ce.repo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin --allowerasing wget https://github.com/opencontainers/runc/releases/download/v1.1.12/runc.amd64 -O /usr/local/sbin/runc cp /usr/local/sbin/runc /usr/bin/runc systemctl start docker curl -L "https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose mv /usr/local/bin/docker-compose /usr/bin/docker-compose chmod +x /usr/bin/docker-compose systemctl status docker ln -s /data /disk1 mkdir -p /disk1/nifi mkdir -p /disk1/nifi/data mkdir -p /disk1/nifi/conf mkdir -p /disk1/nifi/logs Donwload the postgresql-42.6.0.jar file and copy into /disk1/nifi cd /disk1/nifi; wget https://jdbc.postgresql.org/download/postgresql-42.6.0.jar - Create a docker compose
file.
vi /home/user/postgres/docker-compose.yamlversion: "3" services: zookeeper: hostname: zookeeper container_name: zookeeper image: bitnami/zookeeper:3.9.1 restart: always environment: - ALLOW_ANONYMOUS_LOGIN=yes networks: - nifinet nifi00: image: apache/nifi:1.24.0 container_name: nifi00 restart: always ports: - 8080:8080 volumes: - /disk1/nifi/custom_processors:/opt/nifi/nifi-current/extensions - /disk1/nifi/postgresql-42.6.0.jar:/opt/nifi/nifi-current/lib/postgresql-42.6.0.jar - nifi-conf:/opt/nifi/nifi-current/conf - nifi-logs:/opt/nifi/nifi-current/logs networks: - nifinet environment: - NIFI_WEB_HTTP_PORT=8080 - NIFI_CLUSTER_IS_NODE=true - NIFI_CLUSTER_NODE_PROTOCOL_PORT=8082 - NIFI_ZK_CONNECT_STRING=zookeeper:2181 - NIFI_ELECTION_MAX_WAIT=1 min - NIFI_SENSITIVE_PROPS_KEY=bf4xSLVSAmtex/qtcP5uMTbCrxaP+8q5WjELaYXTkkQ= - JVM_ARGS=-XX:MaxDirectMemorySize=1GB -Xms512m -Xmx1g networks: nifinet: driver: bridge volumes: nifi-data: driver: local driver_opts: type: none o: bind device: /disk1/nifi/data nifi-conf: driver: local driver_opts: type: none o: bind device: /disk1/nifi/conf nifi-logs: driver: local driver_opts: type: none o: bind device: /disk1/nifi/logs - Deploy docker containers using a compose file and validate the containers are
running.
cd /home/user/postgres docker-compose up -d docker ps on inside postgres container run the below command psql -U cdpadmin -W -d analytics -h localhost -p 5432