Member since
07-27-2023
55
Posts
19
Kudos Received
1
Solution
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1269 | 09-14-2023 04:41 AM |
05-20-2024
02:18 PM
2 Kudos
@manishg How many cpu cores does each of your NiFi hosts have? 1 means you are using 100% of 1 cpu on average. 20 means you are using 100% of 20 cores on average. etc... so lets say your node has 8 cores but your load average is higher then 8, this means your cpu is saturated and being asked to perform more work then can be handled efficiently. This leads to long thread execution times and can interfere with timely heartbeats being sent by nodes or processed by the elected cluster coordinator. Often times this is triggered by too many concurrent tasks on high CPU usage processors, high FlowFile volume, etc. You can ultimately design a dataflow that simply needs more CPU then you have to work at the throughput you need. User commonly just start configuring more and more concurrent tasks and set the Max Timer Driven thread pool way to high for the number of cores available on a node. This allows more threads to execute concurrently, but just results in each thread taking longer to complete as their time is sliced on the CPU. thread 1 gets some time on CPU 1 and then goes to time wait as another thread gets some time, eventually thread 1 will get a bit more time. More millisecond threads that is not a big deal, but for CPU intensive processors it can cause issues. Lets say you have numerous CPU intensive thread executing at same time, and the heartbeat is scheduled. the scheduled thread is now waiting in line for time on the CPU. Sometimes Alternate dataflow design can be used that use less CPU. Sometimes you can add more nodes. Sometimes you need to move some dataflows to different cluster. Sometimes you just need more CPU. Please help our community thrive. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped. Thank you, Matt
... View more
05-03-2024
08:41 AM
1 Kudo
@manishg The elected cluster coordinator (elected by Zookeeper) is responsible for receiving and processing heartbeats from other nodes in the cluster. It handles the connecting, reconnecting, and manual disconnecting of NiFi nodes. The Cluster coordinator is also responsible for replicating user request to all nodes in the cluster and get confirmation from those nodes that the request was completed successfully. Assume a 3 node cluster with following: node1 - elected cluster coordinator node2 - elected primary node node3 Role of Cluster Coordinator: A user can access the NiFi cluster via any of the 3 node's URL. So lets say a user logs in node3's UI. When that user interacts with node 3 UI that request is proxied to the currently elected cluster coordinator node that in turn replicates the request all 3 nodes (example: add a processor, configure a processor, empty a queue, etc...). If one of the nodes were to fail to complete the request, that node would get disconnected. I may attempt to auto-reconnect later (In newer version of NiFi a connecting node can inherit the clusters flow and replace it local flow only if doing so would not result in dataloss. Role of the Primary Node: The elected primary node is responsible for scheduling the execution of any NiF component processor on the canvas that is configured for primary node only. This is configured in a processor's configuration "scheduling" tab: Primary node scheduled processors with display a "P" in the upper left corner as seen above. NOTE: ONLY processors with no inbound connections should ever be set to "primary node" execution. Doing so on processor with inbound connection can lead to FlowFiles becoming stuck in those connection when the elected primary node changes. Not all protocols are "cluster" friendly, so primary node execution helps dataflow designers work around that limitation while still benefiting from having a multi-node cluster. NiFi has numerous "List<XYZ>" and "Fetch<XYZ>" type processor typically used to handle non cluster friendly protocols. I'll use ListFile and FetchFile as an example. Let say our 3 node cluster as the sane network directory mounted to every node. If I was to add the ListFile processor and leave it configured with "all nodes" execution and configure it to list files on that shared mount. All three nodes in the NiFi cluster would produce FlowFiles for all the files listed (so you have files in triplicate). Now if i were to configure my ListFile with "primary node" execution, the listFile would only get scheduled to execute on the currently elected primary node (these processor also record cluster state in ZK so that if a elected primary node changes it doe snot result in a re-listing of the same files again). To prevent overloading the primary node, the list based processors do not retrieve the source content. It only creates a 0 byte FlowFile with attributes/metadata about the source file. So the List based processor would then be connected downstream to its corresponding FetchFile processor. The FetchFile for example would the use the metadata from the 0 byte FlowFile to fetch the content and add it to the FlowFile. On the connection between ListFile and FetchFile you would configure cluster load balancing. Here you can see I selected basic round robin. You'll notice a connection with load balancing configured will also render a bit different: What happen on this connection is that all the 0 bytes FlowFiles will be redistributed in round robin style to all connected nodes. Then on each node the FetchFile will get each nodes subset of FlowFiles content. This reduce need to transmit content of network between nodes and reduces disk IO on primary node since it is not fetching all the content. If you search the Apache NiFi documentation you will see many list and fetch combination type processors. But any source processor (one with no inbound connection) could be configured for primary node only. But only schedule a source processor as primary node execution if required. Doing so on processors like ConsumeKafka for example that uses cluster friendly protocols would just impact performance. Hope this answers your question only what the difference is between Cluster Coordinator and Primary Node roles in a NiFi cluster. Please help our community thrive. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped. Thank you, Matt
... View more
05-03-2024
07:24 AM
1 Kudo
@manishg I recommend starting a new community question with your detailed query. This community question is 5.5 years old for a 5.5 year old version of NiFi. A lot has evolved and changed since then. Make sure with your query you include details about your NiFi version. Thank you, Matt
... View more
05-01-2024
06:41 AM
@manishg Define environment variables in your Kubernetes Deployment or Pod configuration YAML file. Assign values to these environment variables to represent the properties from your bootstrap.conf file (e.g., JAVA_ARG_2, JAVA_ARG_3). These environment variables will be accessible within your containerized application. Use these environment variables to set properties in your application's bootstrap process. Adjust the names and values of the environment variables according to your specific requirements and configurations.
... View more
04-30-2024
02:04 AM
1 Kudo
java.arg.2 and java.arg.3 in bootstrap.conf: These are the traditional way of setting JVM arguments within the NiFi configuration file itself. They translate to: java.arg.2=-Xms512m: This sets the initial heap size of the NiFi JVM to 512 megabytes (m). java.arg.3=-Xmx512m: This sets the maximum heap size of the NiFi JVM to 512 megabytes (m). NIFI_JVM_HEAP_INIT and NIFI_JVM_HEAP_MAX environment variables: These are environment variables that allow you to configure the JVM heap size externally. This is particularly useful when deploying NiFi in containerized environments If both java.arg.2 / java.arg.3 and NIFI_JVM_HEAP_INIT / NIFI_JVM_HEAP_MAX are defined, the environment variables take precedence. This means the values set in the environment variables will be used to configure the JVM heap size. @manishg
... View more
04-22-2024
06:13 AM
@manishg Not sure what version of Apache NiFi you are using here. I would not recommend using the InferAvroSchema processor. Depending on your use case there may be better options. Most record reader like (CSVReader) have that ability in infer schema From the output provided you have a CSV file that is 44 bytes in size. According to the InferAvroSchema processor documentation: When inferring from CSV data a "header definition" must be present either as the first line of the incoming data or the "header definition" must be explicitly set in the property "CSV Header Definition". A "header definition" is simply a single comma separated line defining the names of each column. The "header definition" is required in order to determine the names that should be given to each field in the resulting Avro definition. Does your content here meet the requirements of the InferAvroSchema processor? Do you see same issue if you try to infer schema via the CSVReader controller service? These two different components do not infer schema in the same way. The InferAvroSchema is not part of the Apache NiFi and utilizes the Kite SDK which is no longer being maintained. Please help our community thrive. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped. Thank you, Matt
... View more
04-22-2024
03:16 AM
1 Kudo
I have nifi running in openshift, and observe that after some time of operation a dialog box pops up on nifi UI, containing following message, and pod restarts. Application is not available The application is currently not serving requests at this endpoint. It may not have been started or is still starting.
Possible reasons you are seeing this page: The host doesn't exist. Make sure the hostname was typed correctly and that a route matching this hostname exists.
The host exists, but doesn't have a matching path. Check if the URL path was typed correctly and that the route was created using the desired path.
Route and path matches, but all pods are down. Make sure that the resources exposed by this route (pods, services, deployment configs, etc) have at least one pod running. nifi logs dont show anything related to it though. What can be the possible issue here?
... View more
Labels:
- Labels:
-
Apache NiFi
04-04-2024
06:15 AM
Can you please try these two NIFI_JVM_HEAP_INIT NIFI_JVM_HEAP_MAX Thank you
... View more
03-28-2024
02:32 AM
1 Kudo
Can we set these properties from kubernetes config yaml?
... View more
03-27-2024
09:18 PM
1 Kudo
I have a custom nifi image on top of nifi 1.10. This image has cve issue CVE-2022-34169 as reported by scanning tools. Explained here. It is basically related to apache xalan dependency, and recommended version is 2.7.3. How do I update this dependency in nifi image?
... View more
Labels:
- Labels:
-
Apache NiFi