etcd - sinherle/Recipes GitHub Wiki

Building etcd

etcd v2.3.1 has been successfully built and tested for Linux on z Systems. The following instructions can be used for RHEL 7.1 , SLES 12 and UBUNTU.

Prerequisites (for RHEL 7.1 and SLES 12)

Building etcd

  1. (For UBUNTU System) Use the following commands to obtain dependencies

        
    
    sudo apt-get update
    
    sudo apt-get install wget golang
    2. Get etcd v2.3.1 source code from github
    $ wget https://github.com/coreos/etcd/archive/v2.3.1.tar.gz
  2. Untar and cd to the work directory

    $ tar zxvf v2.3.1.tar.gz
    $ cd etcd-2.3.1
  3. Check go version

    $ go version
  4. Following changes are needed for the build to work

    Update the file `./etcdmain/etcd_phony.go`
    // +build ignore
    _**Note:** We changed `// +build !amd64` to `// +build ignore`_
    Update the file `./etcdmain/etcd.go`
    // +build s390x
        _**Note:** We changed `// +build amd64` to `// +build s390x`_
    6. Build etcd
        
    
    $ ./build
  5. Test etcd

    First start a single-member cluster of etcd:
    $ ./bin/etcd
    This will bring up etcd listening on port 2379 for client communication and on port 2380 for server-to-server communication.
    Next, let's set a single key, and then retrieve it:
    $ curl -L http://127.0.0.1:2379/v2/keys/mykey -XPUT -d value="this is awesome"
    $ curl -L http://127.0.0.1:2379/v2/keys/mykey
      You have successfully started an etcd and written a key to the store.
     
    ### References:
    https://coreos.com/etcd/
⚠️ **GitHub.com Fallback** ⚠️