Using Altoros Spark for PCF
This topic describes how developers create and bind instances of the Altoros Spark for Pivotal Cloud Foundry (PCF).
After deploying the Apache Spark for PCF tile, the Apache Spark service appears in the Marketplace. Developers can use either the Cloud Foundry Command Line Interface (cf CLI) or Apps Manager to create a service instance and bind it to apps. Binding instances is the process of creating unique credentials for each app to access the database.
To create and bind an instance of the Altoros Spark for PCF using the CF CLI, perform the following steps:
- Set API endpoint to the Cloud Controller of your deployment.
$ cf api api.YOUR-SYSTEM-DOMAIN Setting api endpoint to api.YOUR-SYSTEM-DOMAIN... OK API endpoint: https://api.YOUR-SYSTEM-DOMAIN (API version: 2.59.0) Not logged in. Use 'cf login' to log in.
- Log in to your deployment and select an org and a space.
$ cf login API endpoint: https://api.YOUR-SYSTEM-DOMAIN Email> email@example.com Password>
List the Marketplace services and choose the Altoros Spark for PCF.
$ cf marketplace Getting services from marketplace in org system / space administrators as firstname.lastname@example.org... OK
service plans description spark-odb standalone Apache Spark Service
Create an instance of the Altoros Spark for PCF.
$ cf create-service spark-odb standalone YOUR-SERVICE-INSTANCE Creating service instance YOUR-SERVICE-INSTANCE in org system / space administrators as email@example.com... OK
Before binding the app, first check that the service has been created. You can do this by using
cf service INSTANCE_NAME.
$ cf service YOUR-SERVICE-INSTANCE
Service instance: YOUR-SERVICE-INSTANCE Service: spark-odb Bound apps: Tags: Plan: standalone Description: Apache Spark Documentation url: Dashboard:
Last Operation Status: create succeeded Message: Instance provisioning completed Started: 2017-09-15T12:39:14Z Updated: 2017-09-15T12:45:19Z
Bind the instance to an app.
$ cf bind-service YOUR-APP YOUR-SERVICE-INSTANCE Binding service YOUR-SERVICE-INSTANCE to app YOUR-APP in org system / space administrators as firstname.lastname@example.org... OK TIP: Use 'cf restage YOUR-APP' to ensure your env variable changes take effect
Restage the app for the binding to take effect.
$ cf restage YOUR-APP
To create and bind an instance of the Altoros Spark for PCF using Apps Manager, perform the following steps:
- Navigate to
apps.YOUR-SYSTEM-DOMAINin a browser and log in.
- Click Marketplace in the left navigation.
- Click Apache Spark.
- Select the
- Enter an Instance Name and select a space under Add to Space. To bind the service instance to an app, select an app under Bind to App.
- Click Add. You can also bind an app to a service instance by navigating to the app page, clicking Services, then clicking Bind a Service.
- Select a service instance to bind to the app and click Bind.