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
package main | |
import ( | |
"fmt" | |
"io" | |
"net" | |
"os" | |
"strings" | |
"sync" | |
) |
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
#cloud-config | |
coreos: | |
etcd: | |
addr: $private_ipv4:4001 | |
peer-addr: $private_ipv4:7001 | |
fleet: | |
public-ip: $private_ipv4 |
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
#cloud-config | |
coreos: | |
units: | |
- name: fleet.socket | |
command: start | |
drop-ins: | |
- name: 30-ListenStream.conf | |
content: | | |
[Socket] | |
ListenStream=127.0.0.1:49153 |
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
$ ; start up the discovery service | |
$ etcd -name discovery -addr 127.0.0.1:4000 -peer-addr 127.0.0.1:7000 | |
... | |
$ ; choose the discovery token | |
$ export UUID=$(uuidgen) | |
$ echo $UUID | |
40134540-b53c-46b3-b34f-33b4f0ae3a9c | |
$ ; start three nodes |
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
#cloud-config | |
coreos: | |
etcd: | |
discovery: https://discovery.etcd.io/6e1e0ce9fd5ff0fdbf74aa120b0df6a7 |
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
core@core-01 ~/fleet $ etcdctl set /foo bar | |
bar | |
core@core-01 ~/fleet $ etcdctl get /foo | |
bar | |
core@core-01 ~/fleet $ etcdctl get /Foo | |
Error: 100: Key not found (/Foo) [10403] | |
core@core-01 ~/fleet $ etcdctl get /FOO | |
Error: 100: Key not found (/FOO) [10404] |
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
$ systemctl cat hello.service | |
# /etc/systemd/system/hello.service | |
[Service] | |
EnvironmentFile=/etc/environment | |
ExecStart=/usr/bin/etcdctl set /ez/server/test.example.com/%m "{\"host\": \"test.example.com\", \"ip\": \"${COREOS_PUBLIC_IPV4}\"}" | |
$ systemctl start hello.service | |
$ etcdctl get /ez/server/test.example.com/671a23809cf840f2b9c78f90ac2d4f55 | |
{"host": "test.example.com", "ip": "172.17.8.101"} |
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
#cloud-config | |
coreos: | |
units: | |
- name: oneoff-thing.service | |
command: start | |
content: | | |
[Service] | |
Type=oneshot | |
ExecStart=/bin/bash echo foo | |
ExecStart=/bin/bash echo bar |