Introduction
Clients written in java and python are new features added to ranger which enable applications to access ranger REST APIs programmatically with ease. While you can use ranger REST APIs by making direct HTTP requests to ranger admin, we provide client library code for all our public APIs that makes it easier to access them from two of your favorite languages i.e java and python.
Summary of the feature and behavior changes
- Provide idiomatic, hand-written code in Java and Python, making Ranger REST APIs simple and intuitive to use.
- Handle all low-level details of communication with the server including complexities involved in JSON parsing.
Python client can be installed using a familiar package management tool pip.
Ranger Client Library Installation & Reference Java Python
Authentication
As of the latest ranger release 2.2, the ranger client supports two main types of authentication:
- basic-authentication (username/password)
- Kerberos authentication
Java client prompts for the authentication mode to be used at runtime. For Kerberos-based authentications, a principal and keytab file path is required.
SSL
Clients have support for SSL/TLS enabled ranger. To connect to https ranger using java client, provide the path to the ssl configuration file.
$ ./run-sample-client.sh -n <ranger_admin_url>
SSL Configuration File: /path/to/config.xml
Sample SSL configuration file which requires values to be populated:
Environment Variables
The Java client requires initialization of the following environment variables:
$ export JAVA_HOME=/usr/java/<jdk_version>/bin
$ export PATH=$PATH:$JAVA_HOME
$ export HADOOP_CREDSTORE_PASSWORD=<hadoop_credstore_password>
Releases
- Apache 2.2.0
References
Apache: RANGER-2862, RANGER-2910, RANGER-2927, RANGER-3114, RANGER-3190