Installing Knox

After installing the KNOX service through the Ambari UI and enabling the Knox plugin in the ranger if not already done, the following steps can be performed to test the Knox functionally.

Installation and Configuration

For the Python 3.11 clusters, make sure you have installed the pip3.11 package “lxml“, otherwise service advisories fail along with all its functions.

Demo LDAP Server

Start the demo Knox LDAP server from the actions menu in Knox.

Proxy Users in HDFS

Update the following configurations in the custom core-site in HDFS:

Bash
Copy

Try the given curl command.

In the python3 clusters, the following command returns an http 404 error as advanced topology is not in the correct format (becomes a binary string, won't get parsed properly to the application). So perform step 4 now and then rerun the following, the result must be as expected.

Bash
Copy

This command is expected to fail unless you have disabled Audit to SOLR in the Knox configuration.

Disable Audit to SOLR

On disabling Audit to SOLR in the Knox configuration, the API calls must function as expected.

Bash
Copy

Update Advanced Topology

In Knox configurations, update or add the URLs based on the hostname at the end for the services in advanced topology similar to as follows (please copy the entire block as the initial topology block is corrupted).

Bash
Copy

Note Change the hostnames according to your requirement.

Configuration to enable Knox on Hive

To enable Knox over Hive, configure as below in Hive Configurations > General.

To enable Knox over hive, along with above service in Advanced-topology, configure as below in Hive Configurations > General.

Bash
Copy

Use the below URL for the beeline connection.

Bash
Copy

Additionally, modify the gateway.dispatch.whitelist in the Advanced gateway-site section of the Knox configuration to use regular expressions as illustrated below:

For hostnames resembling newreleaseub1.acceldata.ce:

Bash
Copy

For hostnames resembling odp01.ubuntu.ce:

Bash
Copy

Set up the Ambari SSO

Generate the Certificate

Bash
Copy

Display the content using cat as you'll require them in the next step.

Bash
Copy

Ambari Server Setup SSO

Bash
Copy

Restart the Ambari server.

LDAP Setup and Sync

To setup LDAP, perform the following:

Bash
Copy

Sync LDAP as shown below:

Bash
Copy

Restart the Ambari server and clear all cookies after setting up LDAP or SSO in the browser.

  1. Perform UI checks for the following services

UI Checks

HDFS

HDFS UI URL

Bash
Copy

Yarn

Yarn UI URL

Bash
Copy

The following components have been successfully integrated with Apache Knox and thoroughly tested:

  • Hive
  • Ranger
  • Schema Registry (Schema-Reg)
  • Zeppelin

Troubleshooting

If the service UI, when accessed in incognito mode (similar to attempting to log in without cookies) in Chrome, redirects to the Knox login page again, include the following configuration (add the last parameter section) in the Advanced knoxsso-topology under the service attribute:

Bash
Copy

This sets the cookie property as mentioned above. After restarting the service and clearing old cookies in the browser, the UIs must also function correctly in Chrome.

Knox Ranger Test Connection Failure

To fix the Knox Ranger test connection failure, perform the following steps.

Bash
Copy

Add properties as shown below.

Verify the Knox policy test connection.

Knox Uninstallation

To uninstall Knox, perform the following:

  1. Disable SSO setup on Ambari by doing the following:
Bash
Copy

Restart your Ambari server.

  1. Stop and delete the Knox service from the Ambari UI:
  2. To revert to the older quicklinks and other configurations added by Knox, the simplest approach is to roll back the version in the configurations of all services associated with Knox to an earlier version used just before Knox was introduced. Alternatively, if you have incorporated other required configurations into the service, you can remove these configurations by searching for the specified keywords in each of the services.

For HDFS, YARN, and MapReduce, navigate to Advanced Ambari configs and remove the following configurations:

Bash
Copy

Additionally, check other services where additional Knox configurations may have been added.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated