GithubHelp home page GithubHelp logo

mugifly / strongloop-buildpacks Goto Github PK

View Code? Open in Web Editor NEW

This project forked from strongloop/strongloop-buildpacks

0.0 2.0 1.0 358 KB

"strongloop-cache" branch version can be speed up 50-70% of deploy time in 2nd time than original version

License: Other

Shell 100.00%

strongloop-buildpacks's Introduction

StrongLoop provides:

  • LoopBack, an open-source Node.js framework that enables you to create dynamic end-to-end REST APIs with little or no coding. For more information, see http://loopback.io.
  • StrongLoop Controller, a Node devops system. See StrongLoop Controller docs for more information.
  • StrongLoop Agent (StrongOps), an operational console for Node.js applications that provides deep performance monitoring including CPU profiling, event loop statistics, and more. See StrongLoop Agent docs for more information.

The StrongLoop Heroku Buildpack installs the StrongLoop Controller command-line tool (slc) and the add-on provisions a StrongOps monitoring account.

Prerequisites

Before starting, on your local system:

Create your app

Follow the instructions in Getting started with LoopBack to create a LoopBack application.

Just enter:

$ slc loopback

You'll be prompted to pick a name and directory for the new application; for example, if you entered myapp for the application and directory name:

$ cd myapp

Update package.json to add the following line so the app will use the latest stable version of Node.js:

...
    "engines": {
        "node": "0.10.x"
    }
...

Then create a Git repository and commit your code:

$ git init
$ git add . 
$ git commit -m "init"

Heroku setup

Create a Procfile in the root directory of your app that contains the following:

web: slc run 

Make sure you add the Procfile to your repository:

$ git add Procfile 
$ git commit -m "adding Procfile"

Get the buildpack

Login with the Heroku command line:

$ heroku login

Create your Heroku app using the buildpack. When it completes, push to Heroku master to complete the installation of StrongLoop on your dyno.

$ heroku apps:create --buildpack https://github.com/strongloop/strongloop-buildpacks.git
$ git push heroku master

Test it out

$ heroku open

How to check your dashboard on Heroku

Once you have created your app, its time to look at the instrumentation. Navigate to the Heroku dashboard and find your app. Once you've found your app, click on Heroku app dashboard to view the various dynos and add-ons for your app. Click on the StrongLoop add-on to view the StrongOps Control Panel. The StrongLoop Ops dashboard is accessible by clicking on the grey button "StrongOps Dashboard".

The dashboard can also be accessed via the CLI:

$ heroku addons:open strongloop
Opening strongloop for sharp-mountain-4005…

Run your app in a cluster

To run your application in a cluster, update the start command in the Procfile:

$ web: slc run --cluster <n>

Where <n> is a postive integer indicating the number of worker processes to use.

Commit your changes and redeploy the app:

$ git add Procfile
$ git commit -m "Started clustered app" Procfile
$ git push heroku master

Once you have set this up, you can control the cluster through the StrongLoop dashboard: simply click on the Cluster tab.

Collect application metrics

To collect metrics to send to a StatsD server, update the start command in the Procfile:

$ web: slc run --metrics <statsd-url>

Where <statsd-url> is the URL of your StatsD server with format statsd:[//host[:port]][/scope].

Commit your changes and redeploy the app:

$ git add Procfile
$ git commit -m "Collect metrics using strong-agent" Procfile
$ git push heroku master

For more information on how to use the StrongLoop Agent API to get performance metrics, see On-premises monitoring.

Troubleshooting

After configuration, StrongOps is automatic. If you should experience any issues, please let us know immediately by email

Migrating between plans

NOTE: Carefully manage the migration timing to ensure proper application function during the migration process.

Use the heroku addons:upgrade command to migrate to a new plan.

$ heroku addons:upgrade strongloop:newplan
-----> Upgrading strongloop:newplan to sharp-mountain-4005... done, v18 ($49/mo)
       Your plan has been updated to: strongloop:newplan

Removing the add-on

Remove StrongOps with the following command.

WARNING: This will destroy all associated data and cannot be undone!

$ heroku addons:remove strongloop
-----> Removing strongloop from sharp-mountain-4005... done, v20 (free)

Support

Submit all StrongOps support and runtime issues via the Heroku Support channels. Any non-support related issues or product feedback is welcome at [email protected].

strongloop-buildpacks's People

Contributors

cgole avatar rmg avatar

Watchers

Masanori Ohgita avatar  avatar

Forkers

saveman71

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.