connect 不能作为 consul 的命令使用

connect is not available as command of consul

查询

~$ consul connect proxy -sidecar-for socat

输出:

usage: consul [--version] [--help] <command> [<args>]

可用的命令是:

agent          Runs a Consul agent
configtest     Validate config file
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
keyring        Manages gossip layer encryption keys
leave          Gracefully leaves the Consul cluster and shuts down
lock           Execute a command holding a lock
maint          Controls node or service maintenance mode
members        Lists the members of a Consul cluster
monitor        Stream logs from a Consul agent
reload         Triggers the agent to reload configuration files
rtt            Estimates network round trip time between nodes
version        Prints the Consul version
watch          Watch for changes in Consul

您使用的是哪个版本的 Consul?您可以使用 consul --version.

进行检查

consul kv 命令在版本 0.7.1. Consul Connect was added in version 1.2.0 中引入。

如果您使用的是最新版本,两者都应该可用。