Cloudera CDH
------------

There are two methods of using Anaconda on an existing cluster with
`Cloudera CDH <http://www.cloudera.com/products/apache-hadoop/key-cdh-components.html>`_,
Cloudera's Distribution Including Apache Hadoop: 1) the Anaconda parcel for
Cloudera CDH, and
2) `Anaconda for cluster management <http://docs.continuum.io/anaconda/cloudera>`_.
The instructions below describe how to install the Anaconda parcel on a CDH
cluster using Cloudera Manager.

Using the Anaconda parcel
~~~~~~~~~~~~~~~~~~~~~~~~~

The Anaconda parcel provides a static installation of Anaconda (based on
Python 2.7) that can be used with Python and PySpark jobs on the cluster.

#. From the Cloudera Manager Admin Console, click the Parcels indicator in the
   top navigation bar.

#. Click the ``Edit Settings`` button on the top right of the parcels page.

#. Click the plus symbol in the ``Remote Parcel Repository URLs`` section, and
   add the following repository URL for the Anaconda parcel:

   ::

      https://repo.continuum.io/pkgs/misc/parcels/

#. Click the ``Save Changes`` button on the top of the page.

#. Click the Parcels indicator in the top navigation bar to return to the list of
   available parcels, where you should see the latest version of the Anaconda parcel
   that is available.

#. Click the ``Download`` button to the right of the Anaconda parcel listing.

#. After the parcel is downloaded, click the ``Distribute`` button to
   distribute the parcel to all of the cluster nodes.

#. After the parcel is distributed, click the ``Activate`` button to activate
   the parcel on all of the cluster nodes, which will prompt with a
   confirmation dialog.

#. After the parcel is activated, Anaconda is now available on all of the
   cluster nodes.

#. You can submit Spark jobs along with the ``PYSPARK_PYTHON`` environment
   variable that refers to the location of Anaconda, for example:

   .. code-block:: bash

      $ PYSPARK_PYTHON=/opt/cloudera/parcels/Anaconda/bin/python spark-submit pyspark_script.py

Note: The repository URL shown above installs the most recent version of the
Anaconda parcel. To install an older version of the Anaconda parcel, add the
following repository URL to the ``Remote Parcel Repository URLs`` in Cloudera
manager, then follow the above steps with your desired version of the Anaconda
parcel.

Note: The Anaconda parcel provided at the repository URL shown above is based
on Python 2.7. To use the Anaconda parcel with other versions of Python or with
additional packages, contact sales@continuum.io for more information about
custom Anaconda parcel builds or Anaconda for cluster management.

::

   https://repo.continuum.io/pkgs/misc/parcels/archive/

For more information about managing Cloudera parcels, refer to the
`Cloudera documentation <http://www.cloudera.com/documentation/enterprise/latest/topics/cm_ig_parcels.html#cmug_topic_7_11_5_unique_1__section_sd4_bzx_bm_unique_1>`_.


Using Anaconda for cluster management 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Anaconda for cluster management provides additional functionality, including the 
ability to manage multiple conda environments and packages (including Python 
and R) alongside an existing CDH cluster. For more information, refer to the 
`Anaconda for cluster management documentation <http://docs.continuum.io/anaconda-cluster/cloudera-cdh>`_.
