Member since
12-03-2017
149
Posts
26
Kudos Received
11
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
1292 | 11-03-2023 12:17 AM | |
3009 | 12-12-2022 09:16 PM | |
1147 | 07-14-2022 03:25 AM | |
1818 | 07-28-2021 04:42 AM | |
2115 | 06-23-2020 10:08 PM |
05-24-2021
10:07 AM
Hello, I am trying to use nifi toolkit cli to list the bucket in Nifi registry using below command - /usr/hdf/3.4.1.1-4/nifi-toolkit/bin/cli.sh registry list-buckets -u http://<ip>:<port> But getting below error : /usr/hdf/3.4.1.1-4/nifi-toolkit$ /usr/hdf/3.4.1.1-4/nifi-toolkit/bin/cli.sh registry list-buckets -u http://<ip>:<port> cli.sh: JAVA_HOME not set; results may vary Exception in thread "main" java.lang.NoClassDefFoundError: javax/annotation/Priority at org.glassfish.jersey.model.internal.ComponentBag.modelFor(ComponentBag.java:551) at org.glassfish.jersey.model.internal.ComponentBag.lambda$registerModel$10(ComponentBag.java:477) at org.glassfish.jersey.internal.Errors.process(Errors.java:316) at org.glassfish.jersey.internal.Errors.process(Errors.java:298) at org.glassfish.jersey.internal.Errors.process(Errors.java:229) at org.glassfish.jersey.model.internal.ComponentBag.registerModel(ComponentBag.java:469) at org.glassfish.jersey.model.internal.ComponentBag.register(ComponentBag.java:380) at org.glassfish.jersey.model.internal.CommonConfig.register(CommonConfig.java:454) at org.glassfish.jersey.client.ClientConfig$State.register(ClientConfig.java:242) at org.glassfish.jersey.client.ClientConfig.register(ClientConfig.java:619) at org.apache.nifi.registry.client.impl.JerseyNiFiRegistryClient.<init>(JerseyNiFiRegistryClient.java:110) at org.apache.nifi.registry.client.impl.JerseyNiFiRegistryClient.<init>(JerseyNiFiRegistryClient.java:54) at org.apache.nifi.registry.client.impl.JerseyNiFiRegistryClient$Builder.build(JerseyNiFiRegistryClient.java:226) at org.apache.nifi.toolkit.cli.impl.client.NiFiRegistryClientFactory.createClient(NiFiRegistryClientFactory.java:96) at org.apache.nifi.toolkit.cli.impl.client.NiFiRegistryClientFactory.createClient(NiFiRegistryClientFactory.java:39) at org.apache.nifi.toolkit.cli.impl.command.registry.AbstractNiFiRegistryCommand.doExecute(AbstractNiFiRegistryCommand.java:55) at org.apache.nifi.toolkit.cli.impl.command.AbstractPropertyCommand.execute(AbstractPropertyCommand.java:74) at org.apache.nifi.toolkit.cli.impl.command.CommandProcessor.processCommand(CommandProcessor.java:251) at org.apache.nifi.toolkit.cli.impl.command.CommandProcessor.processGroupCommand(CommandProcessor.java:232) at org.apache.nifi.toolkit.cli.impl.command.CommandProcessor.process(CommandProcessor.java:187) at org.apache.nifi.toolkit.cli.CLIMain.runSingleCommand(CLIMain.java:145) at org.apache.nifi.toolkit.cli.CLIMain.main(CLIMain.java:72) Caused by: java.lang.ClassNotFoundException: javax.annotation.Priority at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@9-internal/BuiltinClassLoader.java:366) at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@9-internal/ClassLoaders.java:184) at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419) ... 22 more u This machine has Java 9 openJDK. java -version openjdk version "9-internal" OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src) OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode) Any help would be appreciated. Thanks, Mahendra
... View more
Labels:
- Labels:
-
Apache NiFi
-
NiFi Registry
06-23-2020
10:08 PM
2 Kudos
@AJ121 - Please try this : ${datestring:toDate("yyyyMMdd","GMT"):format("yyyy-MM-dd")} Please accept if it helped/solved your problem.
... View more
06-17-2020
11:43 PM
1 Kudo
Hi @SirV , I see there are 2 possible options : 1. Merge two flow files based on common key ('FALLA_ID') using MergeContent processor : - Use EvaluateJsonPath first to get 'FALLA_ID' value to flow file attribute. - Use MergeContent processor to merge master-detail flow files, you need to use above step extracted FALLA_ID value in 'Correlation Attribute Name' filed of MergeContent processor, so that it always merge flow files based on common FALL_ID value, so that you can get single merged file for each FALL_ID. - Use JOLTTransformJson to transform your merged json to desired format of output json. 2. Cache the first flow file content in to cache with key as 'FALLA_ID' value and merge when second flow file arrives : - Use NiFi DistributedMap Cache (or any other external cache like Ignite) to cache the first flow. (It will be key-value pair in cache, so use key as FALL_ID and value as whole flow file content.) Before caching the FF just check if that key is already present in cache, if already present means first (master/details) file has already arrived, so you can read that file and dont need to cache the current flow file. - Now you have 1 file in FF Content and a file in FF Attribute (which is read from cache), now you can use ExceuteScript and write simple script (of your choice - python/groovy) to club FF content and attributes to form a desired output json Note : This cache approach has to be picked carefully based on your file volumes and content size etc else it may fill up your memory. Also if you are in multi node cluster mode, NiFi DistributedCache will be independent for each node and does not interact with other nodes so if master file and details files get picked by different nodes then logic will fail ! Please ACCEPT if it helps/resolves your problem. Thanks Mahendra
... View more
06-09-2020
01:50 AM
Leave the schedule configurations to default, it runs whenever you send flow file to that processor, i.e whenever you receive request on HTTP listener it will get triggered -
... View more
06-09-2020
12:31 AM
Hi @VINODTV , Nifi input/output ports are for connecting processor groups. You can pass your attribute (emp id) from Jenkins as header or http request body. If you receive your parameter value to NiFi as header then you can just use one UpdateAttribute to prepare your query with parameter (header) received in header. Then use above prepared attribute 'cqlSelectQuery' as 'CQL select query' in QueryCassandra processor. If you receiving your parameter (emp id) to Nifi in request body as json (along with other parameters may be), Then you need to use EvaluateJson processor just before UpdateAttribute so that you can pull that emp id value from flowfile content to attribute and then use it in UpdateAttribute Thanks Mahendra
... View more
06-05-2020
08:44 AM
Hi @VINODTV , I think you can try to have notification based trigger for Cassandra query. To receive notification request (to trigger your flow) you can have a HandleHTTPRequest processor listening on particular port, and once request is received you can take that data (from http req body) and build your cassandra query based on the received data and execute it (May be using QueryCassandra processor). From Jenkins or any other tool you can notify that above service (listener) by invoking the specific url with data which you want to pass for query. Jenkins Job [Invoke http://<hostname>:<port>/<optionalURI> with data] --> Request received at Listener [HandleHTTPRequest] --> Prepare Query --> Execute Query. Below curl command can be used to notify listener from Jenkins : curl -d 'my input data for cassandra query' http://<hostname>:<port>/<optionalURI> You can refer for more detail on HTTP Listener configurations https://community.cloudera.com/t5/Support-Questions/how-to-configure-listenerhttp-processor-in-NIFI/m-p/297344#M218652 Please ACCEPT the solution if it helps/resolves your problem. Thanks Mahendra
... View more
06-05-2020
08:23 AM
@vikrant_kumar24 - Have you found a better way to solve this ? If so would be curious to hear that!
... View more
06-04-2020
01:55 AM
1 Kudo
Hi @renuu ListenHTTP also works same way - Find below sample configuration and how to invoke using curl. ListenHTTP listens on a specific port (in my case 8889) and a base path ('/curlRequestListener') Using below curl command from terminal you can post data - curl -d 'my request data' http://<nifihostname>:8889/curlRequestListener 'my request data' is the sample data which I am posting to the ListenHTTP processor and same is received in processors and queued as flowfile. Received request Flowfile content -
... View more
06-03-2020
09:20 AM
1 Kudo
Hi @renuu , You can use'HandleHttpRequest' to listen for incoming GET/POST request on specific port and respond back using 'HandleHttpResponse' processor. Add one Http Context Map controller service and use the same in both processor to map request to response, thats it. Take a look at the below sample configurations. This HandleHTTPRequest listens for http requests on port 8888 & specifi path i.e /curlRequest. 'Allowed path' is optional, if you just want listen for any request then you ca remove that value. HandleHTTPRequest processor HandleHTTPResponse responds to client with 201 response code and any content which is flowfile content. HandleHTTPResponse processor Instead of curl command I have invoked above listener with another NiFi processor (which you can consider as client) InvokeHttp processor with target end point as above HandleHTTPRequest host & port. I am using host as localhost as I am invoking form Nifi (local) only. For curl command form outside, you need to use your nifi host name instead of 'localhost'. So that would be 'http://<hostname>':8888/curlRequest All together - Please ACCEPT the solution if it helps/resolves your problem. Thanks Mahendra
... View more
05-29-2020
08:50 AM
Hi, I feel ListS3 should work well even with massive data buckets. It collects only metadata and create a flow file. Below few things you can try and see : 1) If you have multiple subdirectories inside that bucket, try to put filter for a specific directory in ListS3 processor (if this helps then you can run multiple processors in parallel pointing to same bucket but different specific sub directory) In the screenshot attached, "2019/Q1" is the one specific directory in side bucket and ListS3 will list only the files of that specific directory. 2) Duplicate(copy and paste) the ListS3 processor (which you are trying to run), and run the newly created (duplicated) processor again. As ListS3 tracks(internally) the files already listed, it will not re-list even if you stop and start, so easy way is to duplicate the processor and run that new processor and see. Thanks Mahendra
... View more