Skip to main content

Spark on Azure HDInsight

Spark on Azure HDInsight example

This example lives in the pulumi/examples repository. Check out just this directory to use it:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set classic-azure-ts-hdinsight-spark
cd pulumi-examples/classic-azure-ts-hdinsight-spark

An example Pulumi component that deploys a Spark cluster on Azure HDInsight.

Prerequisites#

  1. Install Pulumi
  2. Configure Azure credentials
  3. Install Node.js

Deploying the example#

  1. Create a new stack:

    Terminal window
    pulumi stack init dev
  2. Log in to the Azure CLI (you will be prompted to do this during deployment if you forget this step):

    Terminal window
    az login
  3. Configure the target Azure environment:

    Terminal window
    pulumi config set azure:location <location>
    pulumi config set azure:subscriptionId <YOUR_SUBSCRIPTION_ID>
    pulumi config set username <value>
    pulumi config set password --secret <value>
  4. Install dependencies:

    Terminal window
    npm install
  5. Deploy the stack:

    Terminal window
    pulumi up
    Previewing changes:
    ...
    Performing changes:
    ...
    info: 5 changes performed:
    + 5 resources created
    Update duration: 15m6s
  6. Check the deployed Spark endpoint:

    Terminal window
    pulumi stack output endpoint
    https://myspark1234abcd.azurehdinsight.net/

    For instance, Jupyter notebooks are available at https://myspark1234abcd.azurehdinsight.net/jupyter/. Follow the Apache Spark load data and run queries guide to test it out.

Cleaning up#

Once you are done, you can destroy all of the resources, and the stack:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.