温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

windows怎么安装consul

发布时间:2021-08-16 17:36:22 来源:亿速云 阅读:132 作者:chen 栏目:大数据

本篇内容主要讲解“windows怎么安装consul”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“windows怎么安装consul”吧!

windows 安装 consul

下载安装包

官网下载速度慢,不推荐

•官网下载地址:https://www.consul.io/downloads.html•其他下载: https://javapro.lanzous.com/id77xza

windows怎么安装consul

解压运行

打开 Windows PowerShell, 使用 .\consul.exe -h 查看命令帮助

PS C:\WINDOWS\system32> d:PS D:\> cd .\consul_1.7.3_windows_amd64\PS D:\consul_1.7.3_windows_amd64> .\consul.exe -hUsage: consul [--version] [--help] <command> [<args>]
Available commands are:    acl            Interact with Consul's ACLs    agent          Runs a Consul agent    catalog        Interact with the catalog    config         Interact with Consul's Centralized Configurations    connect        Interact with Consul Connect    debug          Records a debugging archive for operators    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.    intention      Interact with Connect service intentions    join           Tell Consul agent to join cluster    keygen         Generates a new encryption key    keyring        Manages gossip layer encryption keys    kv             Interact with the key-value store    leave          Gracefully leaves the Consul cluster and shuts down    lock           Execute a command holding a lock    login          Login to Consul using an auth method    logout         Destroy a Consul token created with login    maint          Controls node or service maintenance mode    members        Lists the members of a Consul cluster    monitor        Stream logs from a Consul agent    operator       Provides cluster-level tools for Consul operators    reload         Triggers the agent to reload configuration files    rtt            Estimates network round trip time between nodes    services       Interact with services    snapshot       Saves, restores and inspects snapshots of Consul server state    tls            Builtin helpers for creating CAs and certificates    validate       Validate config files/directories    version        Prints the Consul version    watch          Watch for changes in Consul

体验 consul

运行命令, 体验开发版

PS D:\consul_1.7.3_windows_amd64> .\consul.exe agent -dev

notes: 以开发版运行的时候 K/V 不保存哦~

看到控制台打印信息正常后,访问 http://localhost:8500/ui/dc1/services

windows怎么安装consul

持久化数据

新建 server 服务,指定 data-dir 保存数据

consul agent -server -bootstrap-expect 1 -data-dir "D://consul_1.7.3_windows_amd64/consul" -advertise 192.168.0.105 -ui -node=server1 -bind 192.168.0.105 -client 0.0.0.0 -rejoin -config-dir "D://consul_1.7.3_windows_amd64//config"

•-server: consul 服务端•-bootstrap-expect: 在一个 datacenter 中期望提供的 server 节点数目,当该值提供的时候,consul 一直等到达到指定 server 数目的时候才会引导整个集群•-data-dir: 持久化数据目录•-advertise: ip 地址,广播地址•-client: 可访问服务的 ip•-config-dir:配置文件地址

测试 consul 持久化

新增一个 Key/Valuewindows怎么安装consul关闭,重新打开还在,ok

windows - consul 的安装到此结束了哦~

到此,相信大家对“windows怎么安装consul”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI