Cloudera Altus Client Setup

To set up the Cloudera Altus client, complete the following tasks:
  1. Install the Altus client.
  2. Generate an API access key.
  3. Configure the Altus client with an access key.

Installing the Altus Client

You can install the Altus client through pip on Linux, macOS, or Windows. The Altus client works with Python version 2.7 or version 3.4 or later. Cloudera recommends that you install Python version 3.6 or later.

Installing the Altus Client on Linux

To avoid conflicts with older versions of Python or other packages, Cloudera recommends that you install the Cloudera Altus client in a virtual environment. Use the virtualenv tool to create a virtual environment and install the client.

The following commands show how you can use pip to install the client on a virtual environment:
mkdir ~/altusclienv
virtualenv ~/altusclienv --no-site-packages
source ~/altusclienv/bin/activate
~/altusclienv/bin/pip install altuscli 
To upgrade the Altus client to the latest version, run the following command:
~/altusclienv/bin/pip install --upgrade altuscli 

After the client installation process is complete, run the following command to confirm that the Altus client is working:

If virtualenv is activated: altus --version

If virtualenv is not activated: ~/altusclienv/bin/altus --version

Installing the Altus Client on macOS

The version of Python and pip installed with macOS is old and does not work the Altus client. You must install the latest version of Python before you install the Altus client.

To install Python:
  1. Download and install the latest version of Python for Mac OS X from the Python downloads page.
  2. Use the following commands to install pip:
    $ curl -O https://bootstrap.pypa.io/get-pip.py
    $ python3 get-pip.py --user
  3. Use the following commands to verify that Python and pip are correctly installed:
    python3 --version
    pip3 --version
To install the Altus client:
  1. Use the following command to install the Altus client:
    $ pip3 install altuscli --user
  2. After you install the Altus client, add the Python directory that contains the client executable files to the PATH environment variable.
    The directory can vary based on where Python is installed. For example, for Python 3.6.x the executable files are in the following directory:
    ~/Library/Python/3.6/bin
  3. Use the following command to verify that the Altus client is correctly installed:
    altus --version
To upgrade the Altus client to the latest version, run the following command:
$ pip3 install altuscli --upgrade --user

Installing the Altus Client on Windows

You must install Python and pip before you install the Altus client.

To install Python and pip:
  1. Download and install the latest version of Python for Windows from the Python downloads page.
  2. Add the Python home and scripts directories to the Windows PATH environment variable.

    The Python directory can vary for different versions of Python and different versions of Windows. For example, on the Windows 2016 server, the Python 3.6.1 home directory and the scripts directory are in the following locations:

    C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\; 
    C:\Users\Administrator\AppData\Local\Programs\Python\Python36-32\Scripts\;
To install the Altus client:
  1. Open a Command Prompt window.
  2. Use the following commands to verify that Python and pip are correctly installed:
    python --version
    pip --version
  3. Use pip to install the Altus client using the following command:
    pip install altuscli
  4. Use the following command to verify that the Altus client is correctly installed:
    altus --version
To upgrade the client to the latest version, run the following command:
pip install --upgrade altuscli 

Generating an API Access Key

Cloudera Altus manages access to Altus services so that only registered users can run commands to create clusters and run jobs.

The Altus client requires an access key to make service requests. Configure the client with an access key so that you can run commands to deploy clusters and run jobs. When you configure the client with your access key, Altus creates a credentials file so that you do not need to submit your access key with each command.

Use the Cloudera Altus console to generate an access key. The API access key consists of an access key ID and a private key.

To create and set up the client with a Cloudera Altus API access key:
  1. Sign in to the Cloudera Altus console:

    https://console.altus.cloudera.com/

  2. Click your user account name and select My Account.
  3. On the My Account page, click Generate Access Key.

    Altus creates the key and displays the information on the screen. The following image shows an example of an Altus API access key as displayed on the Altus console:


Configuring the Altus Client with the API Access Key

After you generate the access key, go to the command line and use the CLI to configure the client.

To configure the client with an Altus API access key:
  1. On the command line, run the following command to configure the client with the access key:
    altus configure
  2. Enter the following information at the prompt:
    • Altus Access key. Copy and paste the access key ID that you generated in the Cloudera Altus console.
    • Altus Private key. Copy and paste the private key that you generated in the Cloudera Altus console. The private key is a very long string of characters. Make sure that you enter the full string.

    The configuration utility creates the following file to store your user credentials: ~/.altus/credentials

  3. To verify that the credentials were created correctly, run the following command:
    altus iam get-user

    The command displays your Altus client credentials.

After you configure the client, you can go back to the Cloudera Altus console and click OK to exit the access key window.