Node.js cannot find mysql-database service

I am trying to follow the tutorial below:

http://www.ibm.com/developerworks/cloud/library/cl-bluemix-nodejs-app/

But when I click my application I see the following:

Using manifest file /mytests/bluemix-node-mysql-upload/manifest.yml

Updating app jea-node-mysql-upload in org jea68@gmail.com / space dev as jea68@gmail.com...
OK

Uploading jea-node-mysql-upload...
Uploading app files from: /mytests/bluemix-node-mysql-upload/app
Uploading 53.6K, 11 files
Done uploading               
OK
FAILED
Could not find service mysql-database to bind to jea-node-mysql-upload

      

Is there a problem with node.js buildpack or the documentation is faulty?

+3


source to share


2 answers


This morning I was able to run Node.js applications without any problems. The documentation assumes that the user knows that the service has already been created. The manifest.yml function, included in the tutorial's github registry, defines a service (mysql-database) that was not created. Run the following command to create the service:

$ cf create-service mysql 100 jea-mysql-node-upload-service

      

Then modify manifest.yml to include:



services: 
   - jea-mysql-node-upload-service

      

Alternatively, since you already have an application, you can link the application to a service by doing the following:

$ cf bind-service jea-node-mysql-upload jea-mysql-node-upload-service
$ cf start jea-node-mysql-upload

      

+6


source


Looks like a bug in the documentation. If you look at Step 2, part 3, it says to create a my-sql service with this command:

cf create-service mysql 100 mysql-node-upload



which will name the service instance as mysql-node-upload , however the manifest.yml file you cloned from github only contains the service name mysql-service . This is the manifest.yml file that links the application to the service instance.

It is possible to either modify the manifest.yml file to be the correct name for your mysql service instance, or recreate the mysql service instance with the name that is in your manifest.yml.

+3


source







All Articles