Skip to content

Instantly share code, notes, and snippets.

#cloud-config
write-files:
- path: /opt/bin/wupiao
permissions: '0755'
content: |
#!/bin/bash
# [w]ait [u]ntil [p]ort [i]s [a]ctually [o]pen
[ -n "$1" ] && [ -n "$2" ] && while ! curl --output /dev/null \
--silent --head --fail \
http://${1}:${2}; do sleep 1 && echo -n .; done;
core@ip-172-16-32-35 ~ $ docker exec -it dd-agent bash
root@ip-172-16-32-35:/# df -h
Filesystem Size Used Avail Use% Mounted on
overlay 5.5T 1.7T 3.5T 33% /
tmpfs 15G 0 15G 0% /dev
shm 64M 0 64M 0% /dev/shm
tmpfs 15G 0 15G 0% /sys/fs/cgroup
/dev/md0 5.5T 1.7T 3.5T 33% /conf.d
/dev/xvda9 5.5G 671M 4.6G 13% /opt/all_disk_partitions_map
/dev/xvda3 985M 525M 409M 57% /opt/all_disk_partitions_map/usr
#
# Service file from: https://github.com/DataDog/docker-dd-agent/blob/master/dd-agent.service
#
[Unit]
Description=Datadog Agent
After=flanneld.service
After=docker.service
[Service]
User=core
http-server:
restart: always
image: vungle/test-http-server:1.0
ports:
- "80:3000"
@sekka1
sekka1 / gist:fe0a5d1456e789ad7e45
Created February 13, 2016 20:14
Login to MongoLab.com CLI with a Docker Container
docker run \
-it \
mongo:3.2.1 bash -c 'mongo ds061234.mongolab.com:61405/flowlog-stats -u <USER> -p <PASSWORD'
@sekka1
sekka1 / gist:d5f308d6128f67c9fbac
Created February 12, 2016 18:48
Docker - Run Datadog in interactive mode
docker run -it \
--net=host \
--privileged=true \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /proc/mounts:/host/proc/mounts:ro \
-v /proc:/host/proc:ro \
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro \
-e API_KEY=<YOUR API KEY HERE> \
-e TAGS=\"os-name:$NAME,garland:garlandos-version:$VERSION,machine-id:%m$metadata\" \
vungle/docker-dd-agent:coreos-zookeeper bash
core@ip-172-16-32-92 ~ $ docker exec -it zookeeper bash
root@ip-172-16-32-92:/opt/zookeeper# df -h
Filesystem Size Used Avail Use% Mounted on
overlay 74G 4.1G 66G 6% /
tmpfs 7.4G 0 7.4G 0% /dev
shm 64M 0 64M 0% /dev/shm
tmpfs 7.4G 0 7.4G 0% /sys/fs/cgroup
/dev/xvda9 5.5G 405M 4.8G 8% /tmp/zookeeper
/dev/md0 74G 4.1G 66G 6% /etc/hosts
tmpfs 7.4G 0 7.4G 0% /proc/kcore
Nov 9 03:25:22 aws-us-east-1-data.18.dblayer.com elastic_search120: elasticsearch.1 | [2015-11-09 03:25:22,240][DEBUG][action.search.type ] [elastic_search120_aws_us_east_1_data_18_dblayer_com] [graylog-prod][4], node[OZ8jhRoJTVyqYPPXpjSuLw], [R], s[STARTED]: Failed to execute [org.elasticsearch.action.search.SearchRequest@90736ab] lastShard [true]
Nov 9 03:25:22 aws-us-east-1-data.18.dblayer.com elastic_search120: elasticsearch.1 | org.elasticsearch.transport.RemoteTransportException: [elastic_search64_aws_us_east_1_data_16_dblayer_com][inet[/10.39.208.132:9300]][indices:data/read/search[phase/query]]
Nov 9 03:25:22 aws-us-east-1-data.18.dblayer.com elastic_search120: elasticsearch.1 | Caused by: org.elasticsearch.search.SearchParseException: [graylog-prod][4]: from[-1],size[-1]: Parse Failure [Failed to parse source [{"facets":{"roles":{"date_histogram":{"field":"createdAt","interval":"1d"},"global":true,"facet_filter":{"fquery":{"query":{"filtered":{"query":{
root@05174e370c48:/opt/graylog# cat conf/graylog.conf
# If you are running more than one instances of graylog-server you have to select one of these
# instances as master. The master will perform some periodical tasks that non-masters won't perform.
is_master = true
# The auto-generated node ID will be stored in this file and read after restarts. It is a good idea
# to use an absolute file path here if you are starting graylog-server from init scripts or similar.
node_id_file = /var/opt/graylog/graylog-server-node-id
# You MUST set a secret to secure/pepper the stored user passwords here. Use at least 64 characters.
2015-11-10_16:45:40.30665 It looks like you are trying to access MongoDB over HTTP on the native driver port.
2015-11-10_16:45:40.31044 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
2015-11-10_16:45:40.31058 Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0
2015-11-10_16:45:40.66679 INFO [CmdLineTool] Loaded plugins: [Anonymous Usage Statistics 1.1.1 [org.graylog.plugins.usagestatistics.UsageStatsPlugin]]
2015-11-10_16:45:40.72084 INFO [CmdLineTool] Running with JVM arguments: -Xms1g -Xmx1500m -XX:NewRatio=1 -XX:PermSize=128m -XX:MaxPermSize=256m -XX:+ResizeTLAB -XX:+UseConcMarkSweepGC -XX:+CMSConcurrentMTEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseParNewGC -XX:-OmitStackTraceInFastThrow -Dlog4j.configuration=file:///opt/graylog/conf/log4j.xml -Djava.library.path=/opt/graylog/server/lib/sigar/
2015-11-10_16:45:42.37703 INFO [InputBufferImpl] Message journal is enabled.
2015-11-10_16:45:42.62995 I