GithubHelp home page GithubHelp logo

bkobagana / nodecellar-auto-scale-auto-heal-blueprint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudify-examples/nodecellar-auto-scale-auto-heal-blueprint

0.0 1.0 0.0 789 KB

License: Apache License 2.0

Clojure 9.48% Python 29.50% Shell 61.01%

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

CircleCI

Nodecellar Auto-scale Auto-heal Blueprint

This blueprint deploys a demo wine store application that is based on nodejs and mongodb using Cloudify.

Compatibility

Tested with:

  • Cloudify 4.3.1

Pre-installation steps

Please note the following requirement for manager configuration.

This example requires configuration of multiple management (agent) networks upon installation of your Cloudify Manager.

The required name of the agent network is external, and should map to a public IP address. For example:

[centos@ip-10-10-4-47 ~]$ sudo grep "networks" /etc/cloudify/config.yaml 
    networks: {default: 10.10.4.47, external: 54.67.45.103}

Upload the required plugins:

Check the blueprint for the latest version of the plugin.

Install the relevant example network blueprint for the IaaS that you wish to deploy on:

Installation

On your Cloudify Manager, navigate to Local Blueprints select Upload.

Right-click and copy URL. Paste the URL where it says Enter blueprint url. Provide a blueprint name, such as nodecellar in the field labeled blueprint name.

Select the blueprint for the relevant IaaS you wish to deploy on, for example openstack.yaml from Blueprint filename menu. Click Upload.

After the new blueprint has been created, click the Deploy button.

Navigate to Deployments, find your new deployment, select Install from the workflow's menu. At this stage, you may provide your own values for any of the default deployment inputs.

Deployment Outputs

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

$ cfy deployments outputs nodecellar

You should see an output like this:

Retrieving outputs for deployment nodecellar...
 - "endpoint":
     Description: Web application endpoint
     Value: http://10.239.0.18:8080/

Use the URL from the endpoint output and visit that URL in a browser. Play with the wine store application.

Autoscaling

Execute a benchmarking command line application to simulate an auto-scaling scenario.

$ ab -n 1000000 -c 200 http://10.239.0.18:8080/ # insert your URL instead of this one.

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.

Note: this assumes that the VM is an appropriate flavor for the benchmarking tool to sufficiently challenge the VM. This particular configuration is with a t2.micro AWS instance.

There are a number of ways to verify the scaling. If you have Cloudify Premium, you will see the executions in Cloudify's UI. You can also execute cfy executions list for a CLI view:

$ cfy executions list
Listing all executions...

Executions:
+--------------------------------------+-------------------------------+------------+---------------+--------------------------+-------+------------+----------------+------------+
|                  id                  |          workflow_id          |   status   | deployment_id |        created_at        | error | permission |  tenant_name   | created_by |
+--------------------------------------+-------------------------------+------------+---------------+--------------------------+-------+------------+----------------+------------+
| 10e5a704-6c97-43f0-bf84-cb3c3b5cf9e5 | create_deployment_environment | terminated |      nodecellar     | 2017-05-01 00:00:00.000  |       |  creator   | default_tenant |   admin    |
| a1dcbc8f-ae02-4fc7-80a6-1201a706b72b |            install            | terminated |      nodecellar     | 2017-05-01 00:00:00.000  |       |  creator   | default_tenant |   admin    |
| 53d9c07e-7340-4860-91c5-d402877be341 |             scale             | terminated |      nodecellar     | 2017-05-01 00:05:00.000  |       |  creator   | default_tenant |   admin    |
| 2dd15f7b-78ed-46db-9084-de8d0345ff3e |             scale             |  started   |      nodecellar     | 2017-05-01 00:10:00.000  |       |  creator   | default_tenant |   admin    |
+--------------------------------------+-------------------------------+------------+---------------+--------------------------+-------+------------+----------------+------------+

Simulate auto-healing

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.

Uninstallation

Navigate to the deployment and select Uninstall. When the uninstall workflow is finished, select Delete deployment.

$ cfy uninstall --allow-custom-parameters -p ignore_failure=true nodecellar

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

Contributors

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

Watchers

 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.