Giter Club home page Giter Club logo

digitalocean-elasticity's Introduction

DigitalOcean Autoscale

DigitalOcean Autoscale is a tool to automatic scale your infrastructure on Digital Ocean.

How it works

DigitalOcean Autoscale runs in a master server that can be used as LoaBalance too. The service will check in every 5 minutes the server's health, if the CPU usage average is more than 80%, DG AutoScale will create a new droplet and register in the LoadBalance. If the CPU usage average is lower than 20%, the service will down one droplet.

Installation

Just clone this repository:

git clone [email protected]:sergiovilar/digitalocean-autoscale.git

Requirements

  • Vagrant
  • Git
  • Php 5.3+

Usage

Machine configuration

  1. To start using DigitalOcean Autoscale you need to create a VM using Puphpet and select Digital Ocean in the first page. Configure your machine and download the .zip containing all the machine configuration.

  2. You'll need to do some changes in the puphpet/config.yaml file like this example, add the ${token} and ${hostname} variables to your file and save.

  3. Assuming that the previous code generated by puphpet and modified by you are in a git repository, you'll need to create a boxes.json file following the example on boxes.json.sample. This file specifies the repository to clone and to start the machine, you need to fill your DigitalOcean token too.

  4. To your master server connect to the slaves, you need to create a SSH key in your master server and register in DigitalOcean with "Vagrant" name, run this command to :

     ssh-keygen -t rsa
    

    To get the generated key, run this command and copy the output.

     cat ~/.ssh/id_rsa.pub
    

    Go to your Account on Digital Ocean > SSH Keys and add a new with the content that you copied and the Vagrant as name.

Running the service

Before run the service is recommended to disable your know_hosts checking.

Just run:

php src/initialize.php

If you like to run in a server over ssh, run:

./run.sh

Support

Please, if you have any questions, open a issue.

digitalocean-elasticity's People

Contributors

sergiopvilar 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.