This file contains 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
[minion@te-skytwnb426u5-0-7dvpfxiklxdf-kube-node-rwrmywrdzraa ~]$ sudo journalctl -r -u flanneld.service | |
-- Logs begin at Wed 2014-12-31 22:11:51 UTC, end at Tue 2015-02-03 17:50:28 UTC. -- | |
Feb 03 17:31:02 te-skytwnb426u5-0-7dvpfxiklxdf-kube-node-rwrmywrdzraa.novalocal flanneld[931]: I0203 17:31:02.146924 931 udp.go:264] Subnet added: 10.100.19.0/24 | |
Feb 03 17:31:01 te-skytwnb426u5-0-7dvpfxiklxdf-kube-node-rwrmywrdzraa.novalocal flanneld[931]: I0203 17:31:01.087847 931 udp.go:264] Subnet added: 10.100.66.0/24 | |
Feb 03 17:31:01 te-skytwnb426u5-0-7dvpfxiklxdf-kube-node-rwrmywrdzraa.novalocal flanneld[931]: I0203 17:31:01.040972 931 udp.go:239] Watching for new subnet leases | |
Feb 03 17:31:01 te-skytwnb426u5-0-7dvpfxiklxdf-kube-node-rwrmywrdzraa.novalocal flanneld[931]: I0203 17:31:01.040934 931 main.go:201] UDP mode initialized | |
Feb 03 17:31:01 te-skytwnb426u5-0-7dvpfxiklxdf-kube-node-rwrmywrdzraa.novalocal flanneld[931]: I0203 17:31:00.999636 931 subnet.go:80] Subnet lease acquired: 10.100.1.0/24 |
This file contains 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
#cloud-config | |
coreos: | |
fleet: | |
etcd_servers: ETCD_IP_ADDR | |
metadata: role=db | |
units: | |
- name: fleet.service | |
command: start | |
- name: docker.service |
This file contains 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
[Unit] | |
Description=crate | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutSec=3600 | |
ExecStartPre=/bin/bash -c "/usr/bin/docker rm %p || exit 0" | |
ExecStartPre=/usr/bin/mkdir -p /mnt/data1/crate | |
ExecStartPre=/usr/bin/docker pull crate:latest |
This file contains 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
core@db01 ~ $ ping 10.240.169.79 | |
PING 10.240.169.79 (10.240.169.79) 56(84) bytes of data. | |
64 bytes from 10.240.169.79: icmp_seq=1 ttl=64 time=0.849 ms | |
64 bytes from 10.240.169.79: icmp_seq=2 ttl=64 time=0.404 ms | |
^C | |
--- 10.240.169.79 ping statistics --- | |
2 packets transmitted, 2 received, 0% packet loss, time 1000ms | |
rtt min/avg/max/mdev = 0.404/0.626/0.849/0.223 ms | |
core@db01 ~ $ export ETCDCTL_PEERS="http://10.240.169.79:4001" | |
core@db01 ~ $ etcdctl --debug set /tmp/foo "bar" |
This file contains 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
/*** job.go ***/ | |
// run executes the command associated with a job according to its schedule and | |
// records the results until it is told to stop. | |
func (j *job) run() { | |
j.history.Value = fmt.Sprintf("%s:started\n", time.Now().String()) | |
j.history = j.history.Next() | |
for { | |
now := time.Now() | |
e, err := cronexpr.Parse(j.defn.schedule) | |
if err != nil { |
This file contains 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
/*** job.go ***/ | |
// Read handles read operations on a jobfile using its associated reader. | |
func (jf jobfile) Read(fid *srv.FFid, buf []byte, offset uint64) (int, error) { | |
glog.V(4).Infof("Entering jobfile.Read(%v, %v, %)", fid, buf, offset) | |
defer glog.V(4).Infof("Exiting jobfile.Read(%v, %v, %v)", fid, buf, offset) | |
cont := jf.reader() | |
if offset > uint64(len(cont)) { | |
return 0, nil |
This file contains 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
/*** job.go ***/ | |
type jobdef struct { | |
name string | |
schedule string | |
cmd string | |
state string | |
} | |
type jobreader func() []byte | |
type jobwriter func([]byte) (int, error) |
This file contains 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
/*** clone.go ***/ | |
type clonefile struct { | |
srv.File | |
} | |
// Write handles writes to the clone file by attempting to parse the data being | |
// written into a job definition and if successful adding the corresponding job | |
// to the jobs directory. | |
func (k *clonefile) Write(fid *srv.FFid, data []byte, offset uint64) (int, error) { | |
glog.V(4).Infof("Entering clonefile.Write(%v, %v, %v)", fid, data, offset) |
This file contains 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
func main() { | |
// argument handling and initialization | |
root, err := mkjobfs() | |
if err != nil { | |
os.Exit(1) | |
} | |
// job database management |
This file contains 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
/*** jobd.go ***/ | |
// mkjobfs creates the static portion of the jobd file hierarchy: the 'clone' | |
// file, and the 'jobs' directory at the root of the hierarchy. | |
func mkjobfs() (*srv.File, error) { | |
var err error | |
user := p.OsUsers.Uid2User(os.Geteuid()) | |
root := new(srv.File) |