Skip to content

This repository contains a Parcel and a CSD to use Apache Knox from within the Cloudera Manager

License

Notifications You must be signed in to change notification settings

cytar/knox-cloudera

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Apache Knox Parcel & CSD

This repository contains an Ansible playbook to create a Parcel for Apache Knox 1.2 as well as the definitions needed to build a CSD. Both these things are needed if you want to integrate Knox into Cloudera Manager.

Parcel

To build the Parcel execute the parcel.yml playbook from the main directory using Ansible. There is a script called build-parcel.sh that can be used to kick off the process. The finished parcel will be in the work/output directory. Cloudera Manager requires one Parcel per supported target distribution.

This only genereates a parcel for el7 distribution including the .sha1 and the manifest

CSD

There is also a CSD to be able to manage Knox from within Cloudera Manager. It will start Knox but it will run with its default configuration.

To build the CSD JAR file run the build.sh script in the knox-csd directory. Copy the resulting JAR file to /opt/cloudera/csd and restart Cloudera Manager. You also need to restart the Cloudera Management Service once!

To configure Knox you’ll need to manually change the topologies etc. in the data directory itself. The Knox User Guide can help.

You will also need to manually create Proxy Users in the various services that Knox should access.

There are some problems with how Knox processes environment variables and Java system properties, some of which I’ve outlined on the Knox dev mailing list.

Implementation notes

Changing the path where Knox looks for gateway-log4j.properties

Knox uses the PropertyConfigurator to initialize Log4J using the Java system property log4j.configuration. If that is not defined it uses a default from its embedded gateway.cfg file which points to ${GATEWAY_HOME}/conf/${launcher.name}-log4j.properties. For this CSD we’ve modified the gateway.sh script to take an extra environment variable called GATEWAY_LOG_OPTS which we then point at the right location.

Changing the path where Knox looks for the gateway-site.xml file

Knox looks for gateway-site.xml in these locations in this order:

  1. Java System Property GATEWAY_HOME/conf/gateway-site.xml

  2. Environment variable GATEWAY_HOME/conf/gateway-site.xml

  3. Java System Property user.dir/conf/gateway-site.xml

  4. Classpath conf/gateway-site.xml

The path part conf is hardcoded.

Unfortunately the launcher has an embedded cfg file that contains a hardcoded GATEWAY_HOME property which the Invoker class then propagates to a Java System property. The only way to have the environment variable take effect is by removing the default conf/gateway-site.xml file from the Knox distribution. The directory conf needs to stay though because gateway.sh checks for its existence. The path is hardcoded in the script and cannot be changed even though its pointing to the wrong location. Solution is to create an empty conf directory or to patch the gateway.sh file. This parcel does the former.

About

This repository contains a Parcel and a CSD to use Apache Knox from within the Cloudera Manager

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 69.6%
  • Python 30.4%