Member since
02-01-2016
24
Posts
23
Kudos Received
5
Solutions
My Accepted Solutions
Title | Views | Posted |
---|---|---|
8767 | 04-02-2017 09:59 PM | |
2074 | 03-22-2017 07:08 PM | |
1711 | 12-26-2016 06:43 PM | |
3646 | 02-06-2016 12:29 AM | |
4862 | 02-02-2016 03:00 PM |
04-02-2017
09:59 PM
@Rohit Ravishankar You should be able to do this with RouteText. I suspect the configurations/regex you currently have may need some updating to get the functionality your looking for. Below is a screen should of something that should work. I also created a small example here.
... View more
03-22-2017
07:08 PM
1 Kudo
Kiran, I believe this has to do with groovy's execute method. I think it is sending the quotes as part of the actual sql to the psql command. Meaning postgres is failing because it doesn't expect the single quotes in a command. Something like the below command would work. import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;
import groovy.sql.Sql;
def copyCommand = ['psql', '--host=localhost', '--port=5432', '--dbname=db', '--username=uname', '--no-password', '-c', 'create database kiran_test_0']
println copyCommand //run psql tool as an external process
def process = copyCommand.execute()
def out = new StringBuffer()
def err = new StringBuffer()
process.waitForProcessOutput(out, err) //wait for the process to finish
println "exit code: ${process.exitValue()}"
if (out.size()) {
println "Success: $out"
}
if (err.size()) {
println "Error: $err"
throw new RuntimeException("$err")
}
... View more
03-20-2017
02:55 PM
I believe you need to set an initial state. It looks like you only call the `replace` method on the state manager. I believe it is necessary to initially call `setState`. An example of this can be found here
... View more
12-26-2016
06:43 PM
1 Kudo
@mayki wogno user defined arguments aren't really sent to ExecuteScript. If the value of the `filename` attribute is needed, it can be retrieved from the flow file itself. Below is an example of how to retrieve the `filename` attribute, update the attribute, and send the flow file to a `success` relationship. flowFile = session.get()
if (flowFile != None):
filename = flowFile.getAttribute("filename")
flowFile = session.putAttribute(flowFile, "filename", filename + "new_name")
session.transfer(flowFile, REL_SUCCESS)
For an example that is a little more in depth, you can download a template from this gist. For a deeper look into developing with NiFi, please see the developer's guide.
... View more
11-28-2016
03:58 PM
Have you tried to specify smanjee (without the realm) as the user?
... View more
08-24-2016
12:40 PM
On top of ansible and vagrant versions mentioned by @Neha Sinha, it is important to have Python 2.7.11. I believe this error is due to incorrect python version.
... View more
08-02-2016
07:43 PM
2 Kudos
This article will show a step by step guide on how to connect to HBase in an a Kerberos enable cluster. If you need to setup a cluster that have Kerberos enabled, this is a good guid to follow. Clone Example Project This article will be based on this project. Please run the following to clone the project. $ git clone https://github.com/jjmeyer0/hdp-test-examples Creating Keytab Before getting into the code, it is important to generate necessary files. If a key tab is not available follow the steps below to create one. In the example below, a key tab for the user jj and realm EXAMPLE.COM is created. The below commands should be run on one of the nodes in the cluster. $ kadmin.local
$ addprinc jj@EXAMPLE.COM
$ <CTRL-D>
$ ktutil
$ addent -password -p jj -k 1 -e RC4-HMAC
$ wkt jj.keytab
$ q Preparing User in HBase The user that was used above must be given correct permissions in HBase. To do so do the following: $ hbase shell
hbase(main):001:0> grant 'jj', 'RW' Obtaining Necessary Files This example also expects the files listed below. Below is a walkthrough on how to copy the necessary files from the cluster to local.
hbase-site.xml <username>.keytab krb5.conf $ scp -i <insecure_private_key> vagrant@c6401:/etc/krb5.conf .
$ scp -i <insecure_private_key> vagrant@c6401:/etc/hbase/conf/hbase-site.xml .
$ scp -i <insecure_private_key> root@c6401:~/jj.keytab .
Once the files have been obtained, please move them to the following directory. src/main/resources/ For testing, it is recommended to change 'hbase.client.retries.number' property in hbase-site.xml. By default it is 35. This is quite high when running some tests. Code Walkthrough The First thing that needs to be done is to create and load the HBase configuration. // Setting up the HBase configuration
Configuration configuration = new Configuration();
configuration.addResource("src/main/resources/hbase-site.xml"); Next point to the krb5.conf file and setup the kerberos principal and keytab. // Point to the krb5.conf file.
System.setProperty("java.security.krb5.conf", "src/main/resources/krb5.conf");
System.setProperty("sun.security.krb5.debug", "true");
// Override these values by setting -DkerberosPrincipal and/or -DkerberosKeytab
String principal = System.getProperty("kerberosPrincipal", "jj@EXAMPLE.COM");
String keytabLocation = System.getProperty("kerberosKeytab", "src/main/resources/jj.keytab"); Now login with the principal and keytab defined above. UserGroupInformation.setConfiguration(configuration);
UserGroupInformation.loginUserFromKeytab(principal, keytabLocation)
Please see this file for full example. A Scala version can be found here.
Resources Ambari Quickstart Guide Full Code (This article covers HBase examples)
... View more
Labels:
07-29-2016
08:30 PM
I fixed this issues by downgrading Vagrant 1.8.1. There is a bug in Vagrant 1.8.5.
... View more
07-18-2016
03:00 PM
There are, but it seems that they are for Ranger internal use. There aren't any public APIs. Here is the public API documentation for Ranger 0.5. You can also take a look at the following classes if you're interested: org.apache.ranger.rest.PublicAPIs
org.apache.ranger.rest.PublicAPIsv2 The UI is hitting some user and group endpoints, but it doesn't seem as if there is documentation around them. I wouldn't rely on them.
... View more
07-06-2016
03:12 PM
1 Kudo
Another approach may be to setup remote debugging. There is an article here explaining how to set it up.
... View more