Giter Club home page Giter Club logo

nodecellar-auto-scale-auto-heal-blueprint's Introduction

Cloudify Nodecellar Example

This is a fork of the Cloudify Nodecellar Example.

It's main purpose is to demonstrate scaling a MongoDB Webserver Backend with a Node JS Frontend.

Step 1: Upload the blueprint

cfy blueprints upload -b <choose_blueprint_id> -p <blueprint_filename>

Step 2: Create a deployment

Every one of these blueprints have inputs, which can be populated for a deployment using input files.
Example input files are located inside the inputs directory.
Note that these files only contain the mandatory inputs, i.e, one's that the blueprint does not define a default value for.

After you filled the input file corresponding to your blueprint, run:

cfy deployments create -b <blueprint_id> -d <choose_deployment_id> -i inputs/<inputs_filename>

Step 4: Install

Once the deployment is created, we can start running workflows:

cfy executions start -w install -d <deployment_id>

This process will create all the cloud resources needed for the application:

  • VM's
  • Floating IP's
  • Security Groups

and everything else that is needed and declared in the blueprint.

Step 5: Verify installation

Once the workflow execution is complete, we can view the application endpoint by running:

cfy deployments outputs -d <deployment_id>

Hit that URL to see the application running.

Step 6: Demo the Auto Scale Example

Using the IP & PORT that are in the output of the command in Step 5, you can run:

ab -n 1000000 -c 200 http://$IP:$PORT/

This will increase the number of requests to the application. As a result the CPU used by the node process on the nodejs_host VMs will spike above the scale up threshold. This metric is monitored by the Diamond plugin, and the Riemann auto-scale policy calls the scale workflow trigger.

Killing this command should cause the CPU to drop below the scale down threshold, and the application will scale down.

Step 7:

You can simulate a failed host by stopping or suspending a running nodejs_host VM. The Riemann failed host policy will recognize the lack of system cpu metrics reporting on the host and will trigger the heal workflow.

Step 7: Uninstall

Now lets run the uninstall workflow. This will uninstall the application, as well as delete all related resources.

cfy executions start -w uninstall -d <deployment_id>

Step 8: Delete the deployment

Its best to delete deployments we are no longer using, since they take up memory on the management machine. We do this by running:

cfy deployments delete -d <deployment_id>

nodecellar-auto-scale-auto-heal-blueprint's People

Contributors

limor-gs avatar uric avatar 0lvin avatar yaelpeled avatar dankilman avatar boul avatar achirko avatar fogelomer avatar earthmant avatar idanmo avatar guy-mograbi-at-gigaspaces avatar opencm avatar yohanakh avatar adamlavie avatar nirbir avatar chenroth avatar iliapolo avatar cosmo-admin avatar asdfasda avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.