Install and deploy etcd


This is an example workflow to install and deploy etcd.

Secure connection (HTTPS) Enable profiler Debug mode

This tool only supports up to 7 nodes Minimum cluster size is 1 Cluster size should be an odd number

Node {{i+1}}

Cluster state must be either 'new' or 'existing'




↑ top


TLS
Why?

If etcd stores information that should not be public, encryption is highly recommended. etcd supports SSL/TLS and authentication for clients-to-server and peer-to-peer communication. Here's how to generate self-signed TLS certificates with cfssl.


Install cfssl



Install on Linux
terminal
{{cfssl.getInstallCommand('linux-amd64')}}

Install on macOS (Darwin)
terminal
{{cfssl.getInstallCommand('darwin-amd64')}}


Generate self-signed root CA certificate

We will use this root CA to generate other TLS assets for validating client-to-server and peer-to-peer communication. Unique certificates are less convenient to generate and deploy, but they do provide stronger security assurances and the most portable installation experience across multiple cloud-based and on-premises Kubernetes deployments.






{{cfssl.getRootCACommand()}}
Results:
terminal
{{cfssl.getRootCACommandResult()}}



Generate local-issued certificates with private keys

Seems like cert is configured for localhost. Please make sure to specify remote hosts, if any.



{{cfssl.getGenCertCommandTxt(flag.name, flag.name, flag.ipAddress, inputCFSSLMoreHostsTxt)}}
terminal
{{cfssl.getCertsPrepareCommand(flag.certsDir)}}
terminal
{{etcd.getCFSSLFilesTxt()}}


Build
Why?

To try out the latest features and changes in etcd.


Build etcd

etcd is written in Go. To build from source, you need Go 1.9+. This assumes host OS is Linux.



terminal
{{go.getInstallCommand()}}

Now let's build etcd from source.

terminal
{{etcd.getInstallCommandGitSource(inputGitUser, inputGitBranch)}}


Bare metal, VM
Why?

etcd writes data to disk. Such stateful application is complicated to run in container. Bare metal or virtual machine is the simplest way to run etcd.




Install on Linux
terminal
{{etcd.getInstallCommandLinux()}}

Install on macOS (Darwin)
terminal
{{etcd.getInstallCommandOSX()}}

Run with Bare metal, VM

Seems like etcd is configured to run in localhost. Please make sure ports and data directory do not conflict!

{{cfssl.getCertsPrepareCommand(flag.certsDir)}}

{{flag.getDataDirPrepareCommand()}}

{{etcd.getCommand(flag, false, false, false)}}
{{flag.getDataDirPrepareCommand()}}

{{etcd.getCommand(flag, false, false, false)}}


Check status:
terminal
{{etcd.getEndpointHealthCommand(etcd.flags[0], false)}}


systemd
Why?

systemd can help run etcd with init system.




Install on Linux
terminal
{{etcd.getInstallCommandLinux()}}

Run with systemd

Seems like etcd is configured to run in localhost. Please make sure ports and data directory do not conflict!

{{cfssl.getCertsPrepareCommand(flag.certsDir)}}

{{flag.getDataDirPrepareCommand()}}

{{etcd.getServiceFile(flag)}}

{{flag.getSystemdCommand()}}
{{flag.getDataDirPrepareCommand()}}

{{etcd.getServiceFile(flag)}}

{{flag.getSystemdCommand()}}


Check status:
terminal
{{etcd.getEndpointHealthCommand(etcd.flags[0], false)}}


Docker
Why?

Application container gives much portability to initial development phase. Here's how to run etcd with Docker.

You can run this in Container Linux by CoreOS.


Run with Docker

Seems like etcd is configured to run in localhost. Please make sure ports and data directory do not conflict!



{{cfssl.getCertsPrepareCommand(flag.certsDir)}}

{{flag.getDataDirPrepareCommand()}}

{{etcd.getServiceFileDocker(flag)}}

{{flag.getSystemdCommand()}}
{{flag.getDataDirPrepareCommand()}}

{{etcd.getServiceFileDocker(flag)}}

{{flag.getSystemdCommand()}}


Check status:
{{cfssl.getCertsPrepareCommand(etcd.flags[0].certsDir)}}

{{etcd.getInstallCommandLinux()}}

{{etcd.getEndpointHealthCommand(etcd.flags[0], true)}}
{{etcd.getInstallCommandLinux()}}

{{etcd.getEndpointHealthCommand(etcd.flags[0], true)}}


Container Linux

Please see Run etcd on Container Linux with systemd.