etcd/Documentation/dl-build.md

70 lines
2.3 KiB
Markdown
Raw Normal View History

---
title: Download and build
---
2016-04-19 20:02:44 +03:00
2016-06-27 21:59:59 +03:00
## System requirements
2016-04-19 20:02:44 +03:00
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.
2016-04-19 20:02:44 +03:00
2016-06-27 21:59:59 +03:00
## Download the pre-built binary
2016-04-19 20:02:44 +03:00
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].
2016-06-27 21:59:59 +03:00
## Build the latest version
2016-04-19 20:02:44 +03:00
For those wanting to try the very latest version, build etcd from the `master` branch. [Go](https://golang.org/) version 1.13+ 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.
2016-04-19 20:02:44 +03:00
To build `etcd` from the `master` branch without a `GOPATH` using the official `build` script:
```sh
$ git clone https://github.com/etcd-io/etcd.git
2016-04-19 20:02:44 +03:00
$ cd etcd
$ ./build
```
To build a vendored `etcd` from the `master` branch via `go get`:
```sh
# GOPATH should be set
$ echo $GOPATH
/Users/example/go
$ go get -v go.etcd.io/etcd
$ go get -v go.etcd.io/etcd/etcdctl
2016-04-19 20:02:44 +03:00
```
2016-06-24 03:25:38 +03:00
## Test the installation
2016-04-19 20:02:44 +03:00
Check the etcd binary is built correctly by starting etcd and setting a key.
### Starting etcd
If etcd is built without using `go get`, run the following:
2016-04-19 20:02:44 +03:00
```sh
2016-04-19 20:02:44 +03:00
$ ./bin/etcd
```
If etcd is built using `go get`, run the following:
```sh
$ $GOPATH/bin/etcd
```
2016-04-19 20:02:44 +03:00
### Setting a key
Run the following:
2016-04-19 20:02:44 +03:00
```sh
$ ./bin/etcdctl put foo bar
2016-04-19 20:02:44 +03:00
OK
```
(or `$GOPATH/bin/etcdctl put foo bar` if etcdctl was installed with `go get`)
2016-04-19 20:02:44 +03:00
If OK is printed, then etcd is working!
[github-release]: https://github.com/etcd-io/etcd/releases/
2016-06-24 03:25:38 +03:00
[go]: https://golang.org/doc/install
[build-script]: ../build
[cmd-directory]: ../cmd
[example-hardware-configurations]: op-guide/hardware.md#example-hardware-configurations