Single etcd node installation on CoreOS ( on Baremetall or VirtualBox )


etcd is a distributed key value store that provides a reliable way to store data across a cluster of machines . Application containers running on your cluster can read and write data into etcd. Common examples are storing database connection details, cache settings, feature flags, and more.
There are different methods to install etcd. Maybe the simplest one is to run using Docker containers. Here I'm showing how you can install single etcd node in CoreOS. If you are not familiar with CoreOS and what is cloud-config.yaml is read my previous post on simple CoreOS installation  here.


#cloud-config
hostname: node001
users:
 - name: omid
   groups:
      - sudo
      - docker
   ssh_authorized_keys:
      - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDHvxiNz2qJJFFwtPYhWaKjdE7k+Pcmzshvd3Qahp4ekG150FbUqDjJo4j53s4bmNTWthx43ICvYjDdVtHpU1zYOqIA+GvI1FFpFIgq6mb1g39eJcubakbb
gZbFGEk0JQCmWcJa8gxh54Dn9jDoVQ== Omid@Omids-MacBook-Pro.local
coreos:
  etcd2:
    name: etcdserver
    initial-cluster: etcdserver=http://192.168.0.191:2380
    initial-advertise-peer-urls: http://192.168.0.191:2380
    advertise-client-urls: http://192.168.0.191:2379
    # listen on both the official ports and the legacy ports
    # legacy ports can be omitted if your application doesn't depend on them
    listen-client-urls: http://0.0.0.0:2379,http://0.0.0.0:4001
    listen-peer-urls: http://0.0.0.0:2380
  units:
    - name: etcd2.service
      command: start
    - name: 00-eth0.network
      runtime: true
      content: |
        [Match]
        Name=eth0
        [Network]
        DNS=4.2.2.4
        Address=192.168.0.191/24
        Gateway=192.168.0.191

12 Dec 2016 : Omid Mohajerani 

Comments