CoreOS

安装

下载镜像

http://stable.release.core-os.net/amd64-usr/current/coreos_production_iso_image.iso

LiveCD

sshd

cd /etc/ssh
mv sshd_config{,.bak}
cat sshd_config.bak > sshd_config
vim sshd_config
#...
PermitRootLogin yes  #加入这一句
systemctl restart sshd
sudo passwd root

cloud-config.yaml

#cloud-config
hostname: coreos01
coreos:
        units:
                - name: etcd2.service
                  command: start
                - name: fleet.service
                  command: start
        etcd2:
          discovery: https://discovery.etcd.io/bfb9403e71057fc7d8dc1f48064dbe5b
          advertise-client-urls: http://$private_ipv4:2379,http://$private_ipv4:4001
          initial-advertise-peer-urls: http://$private_ipv4:2380
          listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
          listen-peer-urls: http://$private_ipv4:2380,http://$private_ipv4:7001
        fleet:
          metadata: role=coreos01
users:
        - name: core
          passwd: 295079529
          ssh-authorized-keys:
                - ssh-dss AAAAB3NzaC1kc3MAAACBAOa5RtATjQMxp7a9fnL6PeB5impl8pnsi2ZhlKrHzj5N80PVhntra+xGwnxsDFqBe7Y87MltP2yEGcUH/R5nsaDK6QOlXY/wHili4dmj3wl4qn7yORox/sRhhTNa1rT/XvdAu8trOb8jSU99xfFbuPSNkdgTLDNhpnDbZlhqjgk/AAAAFQCWHwTgRGJVyObt+3IxC328nMGCzQAAAIARHlP4/4AKYlCmBXYs6uqsM4cuqQaLcW6IpvhFSCXdw0zHYpRiu0IKY0BJwxhtdtRz8jGvTlqXfuqfvUy+zvLVqsS0SJlk2gVAGAlrCgC/W41VAiXmhv9y5fXAFC6IE2KRWNxw2dkBk1qwnYuKxyWUdR5VdRfJyFt8iMdBhORVUgAAAIAJ/+mD7KMQD3PADFyLRYwShexhHRwl1NDbvND+7KReozzSJEa+Kbz3z2/THFjh3ADr+CWEqizDJp3BRSK7Da+pS7i1y/hBlasTxQBxlVbi29YZKGLPesk9Qkxl0S1EeHKZKuv8fj7+A+1VY6xMiJF/uAb6hfur2cI7HIawXZ9HDg== yanpeipan@localhost
        - groups:
               - sudo
                - docker

coreos-install

bash -x /usr/bin/coreos-install -d /dev/sda -c cloud-config.yaml -b http://192.168.1.?/amd64-usr/

Yan Peipan 15 November 2016