commit
7afbbb294d
12
README.md
12
README.md
|
@ -24,13 +24,23 @@ The latest release is available as a binary at [Github][github-release].
|
||||||
|
|
||||||
[github-release]: https://github.com/coreos/etcd/releases/
|
[github-release]: https://github.com/coreos/etcd/releases/
|
||||||
|
|
||||||
You can also build etcd from source:
|
### Building
|
||||||
|
|
||||||
|
You can build etcd from source:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/coreos/etcd
|
git clone https://github.com/coreos/etcd
|
||||||
./build
|
./build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This will generate a binary in the base directory called `./etcd`.
|
||||||
|
|
||||||
|
_NOTE_: you need go 1.1+. Please check your installation with
|
||||||
|
|
||||||
|
```
|
||||||
|
go version
|
||||||
|
```
|
||||||
|
|
||||||
### Running a single node
|
### Running a single node
|
||||||
|
|
||||||
These examples will use a single node cluster to show you the basics of the etcd REST API. Lets start etcd:
|
These examples will use a single node cluster to show you the basics of the etcd REST API. Lets start etcd:
|
||||||
|
|
9
etcd.go
9
etcd.go
|
@ -1,6 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"path/filepath"
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
|
@ -517,13 +518,13 @@ func parseInfo(path string) *Info {
|
||||||
func getInfo(path string) *Info {
|
func getInfo(path string) *Info {
|
||||||
|
|
||||||
// Read in the server info if available.
|
// Read in the server info if available.
|
||||||
infoPath := fmt.Sprintf("%s/info", path)
|
infoPath := filepath.Join(path, "info")
|
||||||
|
|
||||||
// Delete the old configuration if exist
|
// Delete the old configuration if exist
|
||||||
if force {
|
if force {
|
||||||
logPath := fmt.Sprintf("%s/log", path)
|
logPath := filepath.Join(path, "log")
|
||||||
confPath := fmt.Sprintf("%s/conf", path)
|
confPath := filepath.Join(path, "conf")
|
||||||
snapshotPath := fmt.Sprintf("%s/snapshot", path)
|
snapshotPath := filepath.Join(path, "snapshot")
|
||||||
os.Remove(infoPath)
|
os.Remove(infoPath)
|
||||||
os.Remove(logPath)
|
os.Remove(logPath)
|
||||||
os.Remove(confPath)
|
os.Remove(confPath)
|
||||||
|
|
Loading…
Reference in New Issue