This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # Just a quick demonstration of using fork+exec and watching the exit | |
| # status of the sub-command to demonstrate that this will work with kcs | |
| import sys | |
| import os | |
| import select | |
| import signal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In [53]: [i for i in ii if 'Superman-CassandraKankoku' in i['appId']] | |
| Out[53]: | |
| [{u'appId': u'Superman-CassandraKankoku', | |
| u'availabilityZone': u'us-east-1a', | |
| u'elasticIP': u'54.225.8.34', | |
| u'hostname': u'ec2-54-225-8-34.compute-1.amazonaws.com', | |
| u'id': u'1808575606', | |
| u'instanceId': u'i-0022196e', | |
| u'location': u'us-east-1', | |
| u'token': u'85070591730234615865843651859750628460', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| In [56]: [i for i in ii if 'Superman-CassandraHaag' in i['appId']] | |
| Out[56]: | |
| [{u'appId': u'Superman-CassandraHaag-dead', | |
| u'availabilityZone': u'us-east-1a', | |
| u'elasticIP': u'50.16.177.79', | |
| u'hostname': u'ec2-50-16-177-79.compute-1.amazonaws.com', | |
| u'id': u'1808575600', | |
| u'instanceId': u'i-c40c97a8', | |
| u'location': u'us-east-1', | |
| u'token': u'1808575600', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ubuntu@ip-10-141-165-152:~$ sudo apt-get -q -y install snmpd=5.4.3~dfsg-2ubuntu1.1 | |
| Reading package lists... | |
| Building dependency tree... | |
| Reading state information... | |
| The following packages were automatically installed and are no longer required: | |
| libganglia1 libconfuse0 | |
| Use 'apt-get autoremove' to remove them. | |
| The following NEW packages will be installed: | |
| snmpd | |
| 0 upgraded, 1 newly installed, 0 to remove and 83 not upgraded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "target": [ | |
| "carbon.relays.*.metricsReceived" | |
| ] | |
| }, | |
| { | |
| "target": [ | |
| "carbon.relays.*.destinations.*.batchesSent" | |
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def _sendDatapoints(self, datapoints): | |
| # XXX: Make this a logging option | |
| # log to the oldest and newest datapoint in the pickle | |
| # looks like ('Platform2.Wonderwoman.RecommendationService.i-8ecebae0.internal.actors.total-dirty-keys-since-restart.InstructionAtomicKankoku.gauge.value', (137061\ | |
| 9773.0, 58297.0)) | |
| def datapoint_timestamp(point): | |
| return point[1][0] | |
| now = time() | |
| my_max = max(datapoints, key=datapoint_timestamp) | |
| my_min = min(datapoints, key=datapoint_timestamp) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| The "relay" is actually a chameleon - it can be either a straight rules-based relay | |
| (send A -> B, send B->z, etc. based on a regular expression match on the stat name), | |
| it can be a consistent hashing relay which spreads load across a ring, or it can be | |
| an aggregated consistent hashing relay, which I really don't know anything about but | |
| will learn more about. | |
| The only thing I'm really thinking about right now is the rules-based relay, but the | |
| same approach could be used for the others if that's needed. | |
| It also leads to a very simple hack to deliver to e.g. an alternative backend. E.g. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ubuntu@ip-10-30-151-113:~$ ls -laF /dev | grep xvd | |
| brw-rw---- 1 root disk 202, 1 Jun 14 02:55 xvda1 | |
| brw-rw---- 1 root disk 202, 16 Jun 14 02:55 xvdb | |
| ubuntu@ip-10-30-151-113:~$ ohai | grep ephemeral | |
| "block_device_mapping_ephemeral0": "sdb", | |
| "block_device_mapping_ephemeral1": "sdc", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ``` | |
| Every 2.0s: nodetool -h0 ring Thu Jun 27 21:44:36 2013 | |
| Address DC Rack Status State Load Owns Token | |
| 113427455640312821154458202479223443377 | |
| 54.225.85.126 us-east 1a Up Normal 15.21 MB 33.33% 1808575600 | |
| 54.245.99.207 us-west-2 2a Up Normal 21.69 MB 0.00% 1967372893 | |
| 54.225.86.23 us-east 1d Up Normal 59.79 MB 33.33% 56713727820156410577229101240436610842 | |
| 54.245.102.34 us-west-2 2c Up Normal 16.88 MB 0.00% 56713727820156410577229101240595408135 | |
| 54.225.86.137 us-east 1e Up Normal 71.84 KB 33.33% 113427455640312821154458202479064646084 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "servers" : [ { | |
| "port" : "7199", | |
| "host" : "10.77.63.40", | |
| "alias" : "jmxtrans", | |
| "queries" : | |
| [ { | |
| "obj" : "org.apache.cassandra.db:type=Caches,*", | |
| "resultAlias": "Caches", | |
| "attr" : [ "Hits", "Requests" ], | |
| "outputWriters" : [ { |