在命令窗口输入consul agent -dev就可以以dev模式启动consul了,以下是输出内容的头部
==> Starting Consul agent... ==> Consul agent running! Version: 'v1.4.0' Node ID: '2be40d2e-a5eb-5dda-271f-70a39141d791' Node name: 'DESKTOP-OE0CB8G' Datacenter: 'dc1' (Segment: '<all>') Server: true (Bootstrap: false) Client Addr: [127.0.0.1] (HTTP: 8500, HTTPS: -1, gRPC: 8502, DNS: 8600) Cluster Addr: 127.0.0.1 (LAN: 8301, WAN: 8302) Encrypt: Gossip: false, TLS-Outgoing: false, TLS-Incoming: false ==> Log data will now stream in as it occurs:通过以上输入内容可以看到,consul已经运行,版本是1.4.HTTP端口是8500,我们在浏览器输入localhost:8500就可以看到consul的web管理界面了
至此,windows配置已经完成了.
更改默认端口可以看到,默认情况下,http端口是8500,测试环境下我们可能没有需求更改端口,可是正式环境部署的时候可能需要更改端口号,更改端口号也非常简单,在启动agent的时候加上-http-port选项即可.
consul agent -dev -http-port=8400 ==> Starting Consul agent... ==> Consul agent running! Version: 'v1.4.0' Node ID: '7a083b04-cd4a-04af-743b-4fdc8d82c62e' Node name: 'DESKTOP-OE0CB8G' Datacenter: 'dc1' (Segment: '<all>') Server: true (Bootstrap: false) Client Addr: [127.0.0.1] (HTTP: 8400, HTTPS: -1, gRPC: 8502, DNS: 8600) Cluster Addr: 127.0.0.1 (LAN: 8301, WAN: 8302) Encrypt: Gossip: false, TLS-Outgoing: false, TLS-Incoming: false从输出信息中可以看到,http端口已经更改成8400了.