Pivotal CF (Cloud Foundry) Tutorial Part 2

Now that you have built your app we need to add a database. Use the following command to see what services you can create:

> cf marketplace

You should see something like this.
service   plans       description
p-hd      Standard    Pivotal HD is the industry’s most full-featured Hadoop distribution.
p-mysql   100mb-dev   MySQL service for application development and testing 

You will most likely see a hadoop service and a mysql service. Check you have no existing services (or at least no SQL services which is what we want to create:)

> cf services

Now let’s bind the database to your app.

> cf create-service p-mysql 100mb-dev <your_name_db>

Use the following to check what apps you had deployed:

> cf apps

Now let’s bind our new database service

> cf bind-service <your_app> <your_name_db>

To restart your app to ensure the database is connected, use:

> cf restart <your_app>

Navigate through the console and check the database is connected,

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s