Skip to content

Instantly share code, notes, and snippets.

@frankmanzhu
Last active April 11, 2017 04:10
Show Gist options
  • Select an option

  • Save frankmanzhu/96944f4423516c5b06f07e1657a52326 to your computer and use it in GitHub Desktop.

Select an option

Save frankmanzhu/96944f4423516c5b06f07e1657a52326 to your computer and use it in GitHub Desktop.
setup coreos
//su root
sudo su
//list device
lsblk
//Create a cloud-config file
sudo openssl passwd -1 > cloud-config-file
vi cloud-config-file
Change it to be:
#cloud-config
users:
- name: frank
passwd: "$6$5s2u6/jR$un0AvWnqilcgaNB3Mkxd5yYv6mTlWfOoCYHZmfi3LDKVltj.E8XNKEcwWm..."
groups:
- "sudo"
- "docker"
//Install
coreos-install -d /dev/xvda -V current -C stable
//Fix network
sudo vi /etc/systemd/network/static.network
[Match]
Name=eth0
[Network]
Address=192.168.1.96
Gateway=192.168.1.249
DNS=192.168.1.242
//Enable the remote API on a new socket
Create a file called /etc/systemd/system/docker-tcp.socket to make Docker available on a TCP socket on port 2375.
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=2375
BindIPv6Only=both
Service=docker.service
[Install]
WantedBy=sockets.target
Then enable this new socket:
systemctl enable docker-tcp.socket
systemctl stop docker
systemctl start docker-tcp.socket
systemctl start docker
Test that it's working:
docker -H tcp://127.0.0.1:2375 ps
//Install portainer run on 9999
docker run -d -p 9999:9000 -v "/var/run/docker.sock:/var/run/docker.sock" portainer/portainer
//Switch channel
You can switch machines between channels by creating /etc/coreos/update.conf:
GROUP=alpha
//Restart update engine
sudo systemctl restart update-enginesudo
//Manual update
sudo update_engine_client -update
//Start service
docker stack deploy -c compose/zoo.yml zz
docker stack deploy -c compose/kafka.yml kk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment