Use Knox to Access Hortonworks
Apache Knox is a gateway security tool that provides perimeter security for the Hortonworks Distribution (HDP) of Hadoop services. Knox provides secure access to the Hadoop components on a cluster. Connecting to a cluster using Knox provides you with a single point of access to connect to Hadoop services, eliminating the need to map to each service separately. If your system administrator has implemented Apache Ranger on the cluster, Pentaho will respect the policies your system administrator has set up.
Here is an example of a Knox deployment:
The PDI client connects to Knox using a user ID and password that is registered in LDAP. Knox then authenticates to the Kerberos Key Distribution Center (KDC) with the PDI client user ID and password. Lastly, Knox authorizes with Ranger and submits the request to the Hadoop cluster.
Before You Begin
Before you begin, you will need to obtain the following items from your system administrator:
- Credentials, including cluster name, the gateway URL, a username, and a password.
- You must have an SSL certificate installed by your system administrator. The Knox URL is a secure URL, so a SSL certificate is needed to successfully perform any operation using a Knox gateway. See Configure SSL (HTTPS) in the Pentaho User Console and Server for information on SSL.
- Authentication with Knox is provided by an LDAP directory server, so you must be able to authenticate to an LDAP server. For more information, review the articles Switch to LDAP and LDAP Properties.
Complete the following processes to set up the Knox server for use with Pentaho:
- Display the Knox Gateway option
- Register a Hadoop Cluster
- Access Cluster Resources using a Knox Gateway URL.
Display the Knox Gateway option
You must modify the KETTLE_HADOOP_CLUSTER_GATEWAY_CONNECTION environment variable in the
kettle.properties file to display the Use gateway to connect to the cluster option. This option must be selected to set up the gateway connection to the cluster.
Perform the following steps to set the environment variable:
- In the PDI client, choose Edit > Edit the kettle.properties file to open the Kettle properties dialog box.
- Locate the KETTLE_HADOOP_CLUSTER_GATEWAY_CONNECTION variable.
- Change the KETTLE_HADOOP_CLUSTER_GATEWAY_CONNECTION value to ‘true’, and click OK.
The Use a gateway to connect to the cluster option on the Hadoop Cluster dialog box displays as shown below.
Register a Hadoop Cluster
In order to connect to a cluster using the Knox Gateway, you must register a Hadoop Cluster in Spoon. Perform the following steps to connect Knox to the cluster:
- In the PDI client, double-click your cluster name to open the Hadoop Cluster dialog box.
- Select the Use gateway to connect to the cluster option in the Hadoop Cluster dialog box. The dialog box will change to display the gateway connection options.
- Enter the gateway URL, username, and password in the Gateway area, then click OK.
Zookeeper is not supported with Knox
Access Cluster Resources using a Knox Gateway URL
Knox uses a virtual filesystem (VFS) to connect to the cluster, where the cluster resources are accessed through a URL. When you set up Pentaho to connect to a Hortonworks cluster, you created a name for your cluster. Pentaho uses that cluster name in a URL to run your transformations and jobs with Knox. You can use the PDI client to generate the gateway URL for your Hadoop cluster that Knox needs to connect to the cluster.
Complete the following steps to create the URL to connect to the resources on the cluster:
- In the PDI Client, click File > Open File URL. The Open File dialog box displays.
- Click the Location drop-down menu and select Hadoop Cluster from the list.
- Click the Hadoop Cluster drop-down menu and select your cluster name.
- In the Open from Folder text box, the gateway URL for the cluster displays in the format
- The files and folders on the cluster display in the Name panel.
Hive Configuration with Knox
Perform the following steps to use Knox with Hive:
- Open the connection to your Hive database, or review the article Set Up a Database Connection for instructions on setting up a connection.
- In the Database Connection dialog box, select Options in the page panel on the left to display the Parameters panel.
- Enter the following parameters and values in the Options section and click OK.
|httpPath||Path to database||gateway/MyHDPCluster/hive|
|knox||Option to use Knox||true|
|transportMode||Connection protocol to us||http|
|ssl||Option to use SSL||true|
You are now ready to use this connection for any Hive steps.