Skip to content

Instantly share code, notes, and snippets.

View jameswnl's full-sized avatar

James Wong jameswnl

View GitHub Profile
#https://boto3.readthedocs.org/en/latest/reference/services/cloudwatch.html
import boto3
client = boto3.client('cloudwatch')
r2=client.get_metric_statistics(Namespace='AWS/EC2', MetricName='CPUUtilization',Statistics=['SampleCount'],StartTime=datetime(2015, 7, 19), EndTime=datetime(2015, 7, 20), Period=120, Dimensions=[{'Name': 'InstanceId', 'Value': 'i-6a469f90'}])
runs=[]
for status in ec2.meta.client.describe_instance_status()['InstanceStatuses']:
runs.append(status)
### after running this, manually update the Name tag and assign EIP. Run the bbin.yml playbook
- hosts: localhost
name: Provision kyoto
connection: local
gather_facts: False
vars:
- ami_id: ami-6bceb41c # with 1x500GB EBS
- key_name: operations
- hosts: localhost
name: Provision play
connection: local
gather_facts: False
vars:
- ami_id: ami-78fc7410
- key_name: operations
- username: jameswong
tasks:
- name: Provision a set of instances
@jameswnl
jameswnl / gist:5fa3ac8e60915a7ddf59
Created August 5, 2014 03:09
sequence IQ multi-node hadoop cluster on dockers output
bash-3.2$ . .amb && amb-deploy-cluster
starting an ambari cluster with: 3 nodes
[DEBUG] docker run -d --dns 127.0.0.1 --entrypoint /usr/local/serf/bin/start-serf-agent.sh -e KEYCHAIN= --name amb0 -h amb0.mycorp.kom sequenceiq/ambari --tag ambari-server=true
2ee6cc6983649f442e68966a9275669460b4ca7c96a9a1c850609f9878069899
[DEBUG] docker run -d -e SERF_JOIN_IP=172.17.0.18 --dns 127.0.0.1 --entrypoint /usr/local/serf/bin/start-serf-agent.sh -e KEYCHAIN= --name amb1 -h amb1.mycorp.kom sequenceiq/ambari --log-level debug
ebf5b14c05ff44eb3b4c426b40f5d7221a50cd09bc5104eecc65afb4a9d93f51
[DEBUG] docker run -d -e SERF_JOIN_IP=172.17.0.18 --dns 127.0.0.1 --entrypoint /usr/local/serf/bin/start-serf-agent.sh -e KEYCHAIN= --name amb2 -h amb2.mycorp.kom sequenceiq/ambari --log-level debug
cb189ec23808fe782c5aa2244bd5ea9d74f7abb6c42bd63e1cb2969149d596cb
[DEBUG] docker run -it --rm -e EXPECTED_HOST_COUNT=3 -e BLUEPRINT=multi-node-hdfs-yarn --link amb0:ambariserver --entrypoint /bin/sh sequenceiq/ambari -c /tmp/install-cluste