4337 links
  • Arnaud's links
  • Home
  • Login
  • RSS Feed
  • ATOM Feed
  • Tag cloud
  • Picture wall
  • Daily
Links per page: 20 50 100
page 1 / 1
11 results tagged beanstalk x
  • Note: some draft about monitoring beanstalk applications health with boto3 python script
    import pprint
    p = pprint.PrettyPrinter(indent=4)
    p.pprint(x)

    or

    import pprint
    pprint.pformat(x)


    import logging
    import pprint
    logging.info(pprint.pformat(dict))



     $ cat monitor_beanstalk.py
    #!/bin/python

    import boto3
    import pprint
    pp = pprint.PrettyPrinter(indent=4)


    #List all env and status and instances health

    client = boto3.client('elasticbeanstalk')


    envs = client.describe_environments()['Environments']

    #pp.pprint(envs)


    for env in envs:
        print 'ApplicationName: {} EnvironmentName: {} Health: {} HealthStatus: {} Status: {}'.format(env['ApplicationName'].ljust(30),env['EnvironmentName'].ljust(30),env['Health'].ljust(10),env.get('HealthStatus', 'N/A').ljust(10),env['Status'].ljust(10))
        if (env['Health'] != 'Green') or (env.get('HealthStatus', 'N/A') != 'Ok' and env.get('HealthStatus', 'N/A') != 'N/A'):
            print '\nProblem'
            details = client.describe_environment_health(EnvironmentName=env['EnvironmentName'],AttributeNames=['All'])
            #pp.pprint(details)
            print details['Causes']
            print details['InstancesHealth']
            print '\n'
    15 juin 2017 à 11:12:05 UTC+2 * - permalink - archive.org - https://links.infomee.fr/?eFFzMg
    aws beanstalk boto pprint python
  • thumbnail
    mozart-analytics/sqsd: A simple alternative to the Amazon SQS Daemon ("sqsd") used on AWS Beanstalk worker tier instances.

    As the included diagram portrays, in a common workflow, the worker instance will consume messages sent to a specified Amazon SQS from another service (e.g.: a web server or another worker). These messages will be received by the worker via POST requests. This eliminates the necessity of configuring a worker as an always-on service, as well as having to add code for reading and consuming messages from an AWS SQS queue. In other words, the worker is implemented as a standard RESTful API/Service that will react to a message sent to it at an specific endpoint via a POST request. This is an awesome approach by Amazon to microservices and reactive design.

    The conversion of the SQS message to a POST request is executed by what AWS calls the "SQS Daemon" or "Sqsd". This is a simple daemon they pre-install in the worker tier instances that is constantly monitoring an specific AWS SQS queue (provided by configuration) for new messages. When new messages arrive, it constructs a POST request and sends it to a specific endpoint (also provided via configuration). If the endpoint consumes it without errors and returns a 2** HTTP Code in its response, the "Sqsd" deletes the message from the queue to signal that its consumption was successful.

    However, even though this approach is extremely powerful, Amazon does not provide the code of this daemon as open source. Therefore, we have reproduced its behavior by creating our own version of the "Sqsd" free for everyone to use. Moreover, we have provided lots of customization and configuration properties so that it can be molded to your specific use cases.

    16 mars 2017 à 08:31:04 UTC+1 - permalink - archive.org - https://github.com/mozart-analytics/sqsd
    aws beanstalk sqs
  • Note: beanstalk consistency

    A lot of work to do..

    Example : I change the autoscaling trigger in web UI interface. After a few second, my autoscaling trigger is changed (checked).
    But if I save beanstalk environment configuration into a file, the change I made is not there :-(

    Maybe working wih UI is not the best option, but it's very convenient to test stuff without terminate/recreate env from scratch (things I have to do btw when I commit changes in files, I have to check if the behaviour is the same)

    A lot of time lost, but it's the price to have reproductible environment and 'infrastructure as a code'

    13 mars 2017 à 11:17:52 UTC+1 - permalink - archive.org - https://links.infomee.fr/?5sq-xQ
    beanstalk
  • Worker Environments - AWS Elastic Beanstalk

    Elastic Beanstalk simplifies this process by managing the Amazon SQS queue and running a daemon process on each instance that reads from the queue for you. When the daemon pulls an item from the queue, it sends an HTTP POST request locally to http://localhost/ with the contents of the queue message in the body. All that your application needs to do is perform the long-running task in response to the POST. You can configure the daemon to post to a different path, use a MIME type other than application/JSON, connect to an existing queue, or customize connections, timeouts, and retries.

    2 mars 2017 à 21:15:10 UTC+1 - permalink - archive.org - http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html
    aws beanstalk sqs worker
  • Scaling Based on Amazon SQS - Auto Scaling

    Beanstalk ne permet pas de définir un trigger basé sur le nombre d'éléments dans la queue SQS pour l'auto scaling des environements de type worker

    Pourtant c'est possible mais il y a un peu de boulot :

    • créer des scaling policies qui vont ajouter ou enlever des instances
    • créer des alarmes cloudwatch qui vont se déclencher par rapport au nb d'éléments dans la queue et appeler les scaling policies..

    http://docs.aws.amazon.com/autoscaling/latest/userguide/as-using-sqs-queue.html
    https://forums.aws.amazon.com/thread.jspa?messageID=722589

    On peut surement intégrer ça à beanstalk avec les .ebextensions (http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/ebextensions.html)

    En plus d'être un peu complexe et pas vraiment intégrer à beanstalk, ça n'a pas l'air très réactif, cet article en parle et donne une solution :
    Rapid Auto Scaling with Amazon SQS : https://aws.amazon.com/blogs/aws/auto-scaling-with-sqs/

    28 février 2017 à 11:16:08 UTC+1 - permalink - archive.org - http://docs.aws.amazon.com/autoscaling/latest/userguide/as-using-sqs-queue.html
    auto aws beanstalk scaling sqs
  • Custom Platforms - AWS Elastic Beanstalk

    Depuis hier le 22 Février 2017

    seems cool and powerful

    23 février 2017 à 10:04:35 UTC+1 * - permalink - archive.org - http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platforms.html
    aws beanstalk
  • Configuring Application Version Lifecycle Settings - AWS Elastic Beanstalk

    Since December 22th 2016 you are able to configure application version lifecycle in Beanstalk.

    Very convenient, we can trash our custom api cleaning scripts :-)

    22 février 2017 à 15:13:17 UTC+1 - permalink - archive.org - http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-lifecycle.html
    aws beanstalk
  • General Options for All Environments - AWS Elastic Beanstalk

    Default listener (80) is enabled by default, to disable it :
    aws:elb:listener:
    ListenerEnabled: false

    20 février 2017 à 16:44:59 UTC+1 - permalink - archive.org - http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-elblistener
    aws beanstalk
  • Multicontainer Docker Configuration - AWS Elastic Beanstalk

    TIL

    Beanstalk is a little bit... magic. Dunno yet if its good or not :

    Elastic Beanstalk creates log volumes on the container instance, one for each container, at /var/log/containers/containername. These volumes are named awseb-logs-containername and should be mounted to the location within the container file structure where logs are written.

    For example, the following mount point maps the nginx log location in the container to the Elastic Beanstalk–generated volume for the nginx-proxy container.

    {
    "sourceVolume": "awseb-logs-nginx-proxy",
    "containerPath": "/var/log/nginx"
    }

    And all this logs can be copied into s3 automagically: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html#command-options-general-elasticbeanstalkhostmanager

    2 février 2017 à 15:22:37 UTC+1 - permalink - archive.org - http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_v2config.html#create_deploy_docker_v2config_dockerrun_format
    aws beanstalk log logs
  • Note: AWS Beanstalk et cron

    On peut avoir besoin de faire tourner un ou plusieurs cron dans un environnement Beanstalk composé de X instances
    Etant donné que toute les instances sont configurées de la meme manière, si on rajoute le cron dans la config, il sera éxecuté sur toutes les instances

    Une solution serait de determiner si on est le "runnner" ou non avant de lancer le cron

    Pour que toutes les instances sachent qui est le runner, on peut imaginer un système comme celui ci :

    • on interroge l'ELB avec les API pour avoir ses backends
    • on trie cette liste de backend
    • le runner est le premier de cette liste
    • si notre ip est égale à celle du runner, on lance le cron

    ça a l'avantage de fonctionner quel que soit le nombre d'instances et ne pas stocker un état (on utilise les infos de l'ELB)

    Et si on ne veut pas faire tourner tous les crons sur le runner, on pourrait déterminer runnner1 runnner2 runner3 etc suivant l'ordre et faire tourner certains crons si on est runner1 ou bien runner2

    9 décembre 2016 à 11:13:10 UTC+1 - permalink - archive.org - https://links.infomee.fr/?fmh_YQ
    aws beanstalk cron elb
  • General Options for All Environments - AWS Elastic Beanstalk

    THE page you have to bookmark when you work with beanstalk and saved config

    8 novembre 2016 à 15:44:15 UTC+1 - permalink - archive.org - http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options-general.html
    aws beanstalk conf
Links per page: 20 50 100
page 1 / 1
Shaarli - The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community - Help/documentation