Consul必须首先安装在每一个节点上当该节点须要称为Consul集群中的成员。为了使得安装更容易,Consul为全部支持的平台提供了二进制安装包。本页面不描述如何从源码来编译Consul。html
为了安装Consul,须要在下载页面中找到和你系统匹配的包。Consul被打包成zip格式的压缩包。node
解压Consul zip包,复制consul二进制文件到系统PATH中包含的路径下,以确保它能够被执行。在Unix系统中,~/bin和/usr/local/bin是一般的安装路径,选择哪一个依赖于你安装Consul给单个用户使用仍是全部用户均可以使用。对于Windows系统,你能够安装到任意目录,不过不要忘记将安装目录加入到%PATH%中去。bash
若是你使用homebrew做为你的包管理器,你能够经过它来安装Consul:ide
$ brew cask install consul
若是没有cask plugin,那你能够经过下面命令安装:翻译
$ brew install caskroom/cask/brew-cask
安装Consul后,经过打开新的终端回话而且输入consul是否可用来验证安装是否工做。经过执行consul你应该能够看到下面相似的输出:debug
$ consul usage: consul [--version] [--help] <command> [<args>] Available commands are: agent Runs a Consul agent event Fire a new event exec Executes a command on Consul nodes force-leave Forces a member of the cluster to enter the "left" state info Provides debugging information for operators join Tell Consul agent to join cluster keygen Generates a new encryption key leave Gracefully leaves the Consul cluster and shuts down members Lists the members of a Consul cluster monitor Stream logs from a Consul agent reload Triggers the agent to reload configuration files version Prints the Consul version watch Watch for changes in Consul
若是终端报告consul没有被找到的错误,那多是你的PATH没有被正确的设置致使的。请会到前面的步骤去检查你的PATH环境变量是否包含了安装Consul目录。代理
Consul已经安装完成,让咱们来启动代理!code
翻译自这里orm