mac版本以外的操作系统可以自行去官网下载,mac操作系统按照本篇文章操作即可
consul下载官网:
https://www.consul.io/downloads
1.打开电脑终端
输入命令:
brew tap hashicorp/tap
输入命令:
brew install hashicorp/tap/consul
2.输入第二个命令的时候如果报错(不报错的请忽略此步骤)
错误信息:
consul
Install the Command Line Tools:
xcode-select --install
报上面的错误信息则输入命令:
xcode-select --install
输入完命令以后会弹框,点同意下载,ps:刚开始的时候显示的下载时间会很长,其实并不会很久,10几分钟左右,大概2个g,安装完成以后继续输入命令:
brew install hashicorp/tap/consul
3.验证安装是否成功
consul --version
显示:Consul v1.11.3 就代表成功,ps:版本可能跟我的不一样
4. 启动命令
brew services start consul
5.关闭命令
brew services stop consul
6.启动成功以后访问consul网址