Using Spark with Cloudera AI Workbench
Connect Cloudera AI Workbench to a remote Spark Connect session running in Cloudera Data Engineering to run Spark workloads using Spark Connect.
- You must have a Deployed Cloudera AI Experience.
- You must have a Deployed Cloudera Data Engineering Experience.
- You must have the Spark Connect session name.
- You must have the Knox credentials, the
[***CLIENT ID***]and the[***CLIENT SECRET***]for the deployed Cloudera Data Engineering Experience:CONSOLE=<CONSOLE_URL> KNOX=${CONSOLE/console./knox.} read -s "PASS?Password: " echo export HADOOP_JWT=$(curl -sk -u "<YOUR_USER>:$PASS" -D - -o /dev/null \ "https://$KNOX/gateway/knox-cdpsso/api/v1/websso?originalUrl=https://$CONSOLE/" \ | grep -i 'set-cookie: hadoop-jwt' \ | sed -E 's/.*hadoop-jwt=([^;]+).*/\1/' \ | tr -d '\r') echo "${HADOOP_JWT:0:24}..."Otherwise, if LDAP login is not enabled:
-
Access the CDE console using your web browser to log in.
-
Navigate to DevTools then select .
-
Locate the
hadoop-jwtcookie and copy the long string value starting witheyJ.
-
-
You must fetch the Cloudera Anywhere Cloud credentials:
CONSOLE=<CONSOLE_URL> curl -sk -H "Cookie: hadoop-jwt=$HADOOP_JWT" -H "Content-Type: application/json" \ -X POST "https://$CONSOLE/api/v0/auth/access-keys/credentials" \ -d '{"description":"spark-connect"}' Response (HTTP 201): {"client_id":"<client_id>","client_secret":"<secret>,"principal":"<principal>","issued_at":"…"} -
Retrieve the CA certificates for the Knox endpoint from the Anywhere Cloud Console and for the Cloudera Data Engineering cluster endpoint from the Cloudera Data Engineering cluster. For information about retrieving certificates, see Trusting the CA Certificate
Then import the certificates into the Cloudera AI Workbench as described in Managing CA certificates for Cloudera AI Workbench.
- You must obtain the following information from Cloudera Data Engineering:
- The Spark 3.5.4 or Spark 4.1.1 Virtual Cluster Jobs API URL of a Cloudera Data Engineering Experience from . Copy the
Jobs API URL. - The Cloudera Anywhere Cloud Console URL.
You must not have a trailing slash in the URL.
- The Spark 3.5.4 or Spark 4.1.1 Virtual Cluster Jobs API URL of a Cloudera Data Engineering Experience from . Copy the
-
Create a Cloudera Data Engineering Spark Connect Session.
- Optional:
Perform the following steps if you use self-signed or separate Certificate
Authorities between the Cloudera AI and the Cloudera Data Engineering.
-
Create Cloudera AI Workbench Session and access Cloudera Data Engineering Spark Connect Session.
menu.
