From ca07f080276d7d84a4a5c5ea55bf53dbd27587ba Mon Sep 17 00:00:00 2001 From: "StarsL.cn" Date: Wed, 13 Jul 2022 03:23:38 +0800 Subject: [PATCH] =?UTF-8?q?Update=20Consul=E9=83=A8=E7=BD=B2=E8=AF=B4?= =?UTF-8?q?=E6=98=8E.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/Consul部署说明.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/Consul部署说明.md b/docs/Consul部署说明.md index 662f8e1..934ede5 100644 --- a/docs/Consul部署说明.md +++ b/docs/Consul部署说明.md @@ -1,4 +1,4 @@ -##### 安装 +#### 安装 ```bash # 使用yum部署consul @@ -10,12 +10,12 @@ wget https://rpm.releases.hashicorp.com/RHEL/7/x86_64/stable/consul-1.12.2-1.x86 rpm -ivh ./consul-1.12.2-1.x86_64.rpm ``` -##### 配置 +#### 配置 ```bash vi /etc/consul.d/consul.hcl log_level = "ERROR" #日志级别,日志太多可以只打印error日志,不需要可以去掉这行。 -advertise_addr = "192.168.x.x" #填写你的网卡IP。 +advertise_addr = "192.168.x.x" #填写你的网卡IP,如果启动或运行有报错,可以尝试去掉这行。 data_dir = "/opt/consul" client_addr = "0.0.0.0" ui_config{ @@ -30,14 +30,15 @@ acl = { } ``` -##### 启动与鉴权配置 +#### 启动服务 ```bash chown -R consul:consul /opt/consul #注意下数据目录的权限。 systemctl enable consul.service systemctl start consul.service -# 获取登录密码 -consul acl bootstrap - -# 记录 SecretID,即为Consul登录的Token +``` + +### 获取登录Token(记录SecretID,即为Consul登录的Token) +```bash +consul acl bootstrap ```