Skip to content

Instantly share code, notes, and snippets.

View carmstrong's full-sized avatar

Chris Armstrong carmstrong

View GitHub Profile
diff --git a/contrib/ec2/gen-json.py b/contrib/ec2/gen-json.py
index 166c385..d49afa8 100755
--- a/contrib/ec2/gen-json.py
+++ b/contrib/ec2/gen-json.py
@@ -14,7 +14,7 @@ FORMAT_EPHEMERAL_VOLUME = '''
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/wipefs -f /dev/xvdb
- ExecStart=/usr/sbin/mkfs.ext4 /dev/xvdb
+ ExecStart=/usr/sbin/mkfs.ext3 /dev/xvdb
Jan 06 01:38:17 ip-10-21-2-53.ec2.internal systemd[1]: Started etcd.
Jan 06 01:38:17 ip-10-21-2-53.ec2.internal etcd[828]: [etcd] Jan 6 01:38:17.772 WARNING | Failed to statfs: no such file or directory
Jan 06 01:38:17 ip-10-21-2-53.ec2.internal etcd[828]: [etcd] Jan 6 01:38:17.772 INFO | Discovery via https://discovery.etcd.io using prefix /343364e84d83902415ca331e6e7bb8c4.
Jan 06 01:38:18 ip-10-21-2-53.ec2.internal etcd[828]: [etcd] Jan 6 01:38:18.294 INFO | Discovery found peers [http://10.21.2.51:7001 http://10.21.1.137:7001]
Jan 06 01:38:18 ip-10-21-2-53.ec2.internal etcd[828]: [etcd] Jan 6 01:38:18.294 INFO | Discovery fetched back peer list: [10.21.2.51:7001 10.21.1.137:7001]
Jan 06 01:38:18 ip-10-21-2-53.ec2.internal etcd[828]: [etcd] Jan 6 01:38:18.295 INFO | b607ffcb8bc849c7ad6651d5559d1aa1 attempted to join via 10.21.2.51:7001 failed: fail checking join version: Client Internal Error (Get http://10.21.2.51:7001/version: dial tcp 10
Jan 06 01:38:18 ip-10-21-2-53.ec2.intern
@carmstrong
carmstrong / deis-project-touchers.rb
Created December 18, 2014 21:36
Deis project activity by user
#!/usr/bin/env ruby
require 'csv'
require 'octokit'
date_since = ARGV.first
if date_since.nil? or date_since.empty?
date_since = '2013-07-22'
end
Dec 09 03:11:44 ip-10-21-2-96.ec2.internal fleetd[602]: INFO manager.go:218: Writing systemd unit iconic-airfield_v3.web.5.service (809b)
Dec 09 03:11:44 ip-10-21-2-96.ec2.internal fleetd[602]: INFO manager.go:142: Instructing systemd to reload units
Dec 09 03:11:44 ip-10-21-2-96.ec2.internal fleetd[602]: INFO reconcile.go:274: AgentReconciler completed task: type=LoadUnit job=iconic-airfield_v3.web.5.service reason="unit scheduled here but not loaded"
Dec 09 03:11:45 ip-10-21-2-96.ec2.internal fleetd[602]: INFO manager.go:78: Triggered systemd unit iconic-airfield_v3.web.5.service start: job=10566
Dec 09 03:11:45 ip-10-21-2-96.ec2.internal fleetd[602]: INFO reconcile.go:274: AgentReconciler completed task: type=StartUnit job=iconic-airfield_v3.web.5.service reason="unit currently loaded but desired state is launched"
Dec 09 03:24:40 ip-10-21-2-96.ec2.internal fleetd[602]: INFO manager.go:89: Triggered systemd unit iconic-airfield_v3.web.5.service stop: job=12043
Dec 09 03:24:40 ip-10-21-2-96.ec2.internal fle
timdeisSC-coreos-1 core # ls /etc/sudoers.d
waagent
timdeisSC-coreos-1 core # cat /etc/sudo.conf
# CoreOS /etc/sudo.conf
# Use an alternative path for the default sudoers file.
Plugin sudoers_policy sudoers.so sudoers_file=/usr/share/baselayout/sudoers
Plugin sudoers_io sudoers.so
```
core@timdeisSC-coreos-0 ~ $ sudo vi /run/systemd/system/etcd.service.d/20-cloudinit.conf
[Service]
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
@carmstrong
carmstrong / add-remove-node.md
Last active August 29, 2015 14:07
Adding/removing deis-store hosts

Adding and removing nodes from the cluster

Most Deis components handle new machines just fine. Care has to be taken when removing machines from the cluster, however, since the deis-store components act as the backing store for all the stateful data Deis needs to function properly.

Note that these instructions follow the Ceph documentation for removing monitors and removing OSDs. Should these instructions differ significantly from the Ceph documentation, the Ceph documentation should be followed, and a PR to update this documentation would be much appreciated.

Since Ceph uses the Paxos algorithm, it is important to always have enough monitors in the cluster to be able to achieve a majority: 1:1, 2:3, 3:4, 3:5, 4:6, etc. It is always preferable to add a new node to the cluster before removing an old one, if possible.

This documentatio

@carmstrong
carmstrong / gist:f816648894aadfddf785
Created September 19, 2014 21:52
Restore Deis etcd keys
nse deis-controller
cd /app
export ETCD=172.17.8.100:4001
./manage.py shell <<EOF
from api.models import *
[k.save() for k in Key.objects.all()]
[a.save() for a in App.objects.all()]
[d.save() for d in Domain.objects.all()]
EOF
exit
@carmstrong
carmstrong / ceph.conf
Created September 8, 2014 05:25
Ceph error: 0 monclient: hunting for new mon
root@deis-3:/# cat /etc/ceph/ceph.conf
[global]
fsid = f20a7b4f-db77-49d1-87e3-3d59bc12de52
mon initial members = deis-3
mon host = deis-1,deis-2,deis-3
mon addr = 172.17.8.100:6789,172.17.8.101:6789,172.17.8.102:6789
auth cluster required = cephx
auth service required = cephx
auth client required = cephx
osd pool default size = 3
@carmstrong
carmstrong / gist:cd31ee408860084a9970
Created September 4, 2014 19:06
ceph rbd error in container
root@deis-1:/# rbd create db --pool deis --size 4096
rbd: create error: 2014-09-04 19:05:44.677410 7f07cdab8780 -1 (17) File exists
librbd: rbd image db already exists
2014-09-04 19:05:44.677410 7f07cdab8780 -1 librbd: rbd image db already exists
root@deis-1:/# rbd info db
rbd: error opening image 2014-09-04 19:05:47.894565 7f2621bcd780 -1 db: (2) No such file or directory
librbd::ImageCtx: error finding header: (2) No such file or directory
2014-09-04 19:05:47.894565 7f2621bcd780 -1 librbd::ImageCtx: error finding header: (2) No such file or directory