go.etcd.io/etcd@v3.3.27+incompatible/Documentation/dl_build.md (about)

     1  ---
     2  title: Download and build
     3  weight: 1
     4  ---
     5  
     6  ## System requirements
     7  
     8  The etcd performance benchmarks run etcd on 8 vCPU, 16GB RAM, 50GB SSD GCE instances, but any relatively modern machine with low latency storage and a few gigabytes of memory should suffice for most use cases. Applications with large v2 data stores will require more memory than a large v3 data store since data is kept in anonymous memory instead of memory mapped from a file. For running etcd on a cloud provider, see the [Example hardware configuration][example-hardware-configurations] documentation.
     9  
    10  ## Download the pre-built binary
    11  
    12  The easiest way to get etcd is to use one of the pre-built release binaries which are available for OSX, Linux, Windows, appc, and Docker. Instructions for using these binaries are on the [GitHub releases page][github-release].
    13  
    14  ## Build the latest version
    15  
    16  For those wanting to try the very latest version, build etcd from the `master` branch. [Go](https://golang.org/) version 1.9+ is required to build the latest version of etcd. To ensure etcd is built against well-tested libraries, etcd vendors its dependencies for official release binaries. However, etcd's vendoring is also optional to avoid potential import conflicts when embedding the etcd server or using the etcd client.
    17  
    18  To build `etcd` from the `master` branch without a `GOPATH` using the official `build` script:
    19  
    20  ```sh
    21  $ git clone https://github.com/etcd-io/etcd.git
    22  $ cd etcd
    23  $ ./build
    24  ```
    25  
    26  To build a vendored `etcd` from the `master` branch via `go get`:
    27  
    28  ```sh
    29  # GOPATH should be set
    30  $ echo $GOPATH
    31  /Users/example/go
    32  $ go get -v go.etcd.io/etcd
    33  $ go get -v go.etcd.io/etcd/etcdctl
    34  ```
    35  
    36  ## Test the installation
    37  
    38  Check the etcd binary is built correctly by starting etcd and setting a key.
    39  
    40  ### Starting etcd
    41  
    42  If etcd is built without using `go get`, run the following:
    43  
    44  ```sh
    45  $ ./bin/etcd
    46  ```
    47  If etcd is built using `go get`, run the following:
    48  
    49  ```sh
    50  $ $GOPATH/bin/etcd
    51  ```
    52  
    53  ### Setting a key
    54  
    55  Run the following:
    56  
    57  ```sh
    58  $ ./bin/etcdctl put foo bar
    59  OK
    60  ```
    61  
    62  (or `$GOPATH/bin/etcdctl put foo bar` if etcdctl was installed with `go get`)
    63  
    64  If OK is printed, then etcd is working!
    65  
    66  [github-release]: https://github.com/etcd-io/etcd/releases/
    67  [go]: https://golang.org/doc/install
    68  [build-script]: ../build
    69  [cmd-directory]: ../cmd
    70  [example-hardware-configurations]: op-guide/hardware.md#example-hardware-configurations