A problem with consul using ACL?

problem description

this is my configuration file, acl_master_token has been set up, and I am running in docker

.
{
    "datacenter": "dc1",
    "data_dir": "/consul/data",
    "log_level": "INFO",
    "server": true,
    "bootstrap_expect": 3,
    "acl_datacenter": "dc1",
    "acl_master_token": "fe15af83-d36e-",
    "acl_token": "54321c",
    "acl_default_policy": "deny",
    "acl_down_policy": "extend-cache",
    "bind_addr": "192.168.1.15",
    "client_addr": "0.0.0.0",
    "retry_join": ["192.168.1.12"],
    "retry_interval": "3s",
    "raft_protocol": 3,
    "enable_debug": false,
    "rejoin_after_leave": true,
    "encrypt": "h+TjXojPyignafeO+dCeow==",
    "enable_syslog": false
}

found after starting consul,

018/11/12 13:28:06 [ERR] agent: failed to sync remote state: ACL not found
consul_1_aa055051bff7 |     2018/11/12 13:28:07 [ERR] agent: Coordinate update error: ACL not found
consul_1_aa055051bff7 |     2018/11/12 13:28:24 [ERR] agent: Coordinate update error: ACL not found
consul_1_aa055051bff7 |     2018/11/12 13:28:34 [ERR] agent: failed to sync remote state: ACL not found
consul_1_aa055051bff7 |     2018/11/12 13:28:47 [ERR] agent: Coordinate update error: ACL not found

it seems that ACL is not set correctly, but acl_token I also configured

Feb.23,2022

try configuring acl_agent_master_token


The

problem is solved as follows:
Consul v1.3.1

< H1 > generate agent token < / H1 >

the above will encounter

when the first node is started.
2017/07/08 23:38:24 [WARN] agent: Node info update blocked by ACLs
2017/07/08 23:38:44 [WARN] agent: Coordinate update blocked by ACLs

the reason is that agent token has not been set. The generation steps are as follows:

$ curl \
    --request PUT \
    --header "X-Consul-Token: your_master_token" \
    --data \
'{
  "Name": "Agent Token",
  "Type": "client",
  "Rules": "node \"\" { policy = \"write\" } service \"\" { policy = \"read\" }"
}' http://127.0.0.1:8500/v1/acl/create

{"ID":"fe3b8d40-0ee0-8783-6cc2-ab1aa9bb16c1"}

then add the configuration file, acl_agent_token and fill in the token generated above

{
  "acl_datacenter": "dc1",
  "acl_master_token": "your_master_token",
  "acl_default_policy": "deny",
  "acl_down_policy": "extend-cache",
  "acl_agent_token": "fe3b8d40-5645-8783-6cc2-66666"
}

restart agent
for other nodes, you can join agent token without downtime

$ curl \
    --request PUT \
    --header "X-Consul-Token: b1gs33cr3t" \
    --data \
'{
  "Token": "fe3b8d40-5645-8783-6cc2-66666"
}' http://127.0.0.1:8500/v1/agent/token/acl_agent_token

ides/acl-legacy.html" rel=" nofollow noreferrer "> details

  • Consul startup error report

    there is nothing to study during the holiday. Consul seems to have only a single software. When I start it, I [root@localhost vagrant_data]-sharp . consul agent -bootstrap-expect 3 -server -data-dir= vagrant_data consul_data -node=cn1 -bind=192.168.10....

    Aug.09,2021
  • Consul ACL configuration

    3 server,1 client, are added to each server acl_config.json: { "acl_datacenter ": "dc1 ", "acl_master_token ": "hdsaikfoe56 ", "acl_default_policy ": "deny " } and also restart three server. But the page still shows token consulserverlog: ...

    Aug.12,2021
Menu