linux上安装consul

一、下载consul

    官网上下载consul,下载地址是https://www.consul.io/downloads.html,根据不一样操做系统选中不一样的版本。html

二、解压

    List-1java

xx@xx-ubuntu:/opt/software/tool$ ll
total 130916
-rwxr-xr-x  1 mjduan mjduan 99396904 11月 15 06:42 consul*
-rw-rw-r--  1 mjduan mjduan 34591598 12月 16 19:47 consul_1.4.0_linux_amd64.zip

三、执行启动命令

    List-2linux

xx@xx-ubuntu:/opt/software/tool$ ./consul agent -dev
==> Starting Consul agent...
==> Consul agent running!
           Version: 'v1.4.0'
           Node ID: '47a39e6c-656a-0198-c9ab-5e036ec416b7'
         Node name: 'xx-ubuntu'
        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:

四、查看节点信息

    List-3ubuntu

xx@xx-ubuntu:/opt/software/tool$ ./consul members
Node           Address         Status  Type    Build  Protocol  DC   Segment
xx-ubuntu  127.0.0.1:8301  alive   server  1.4.0  2         dc1  <all>

五、浏览器中查看

    在浏览器中输入http://localhost:8500浏览器

                   

                                                                              图5.1 consul管理界面bash

 

    注意,关闭服务时,直接ctrl+c便可。flex

    注意,上面描述并不是集群模式,只适合在开发环境中使用。ui

    consul与euraka相似,也用于服务注册与发现,很惋惜netflex再也不维护euraka了。spa

Reference:

  1. https://www.cnblogs.com/java-zhao/p/5356744.html
相关文章
相关标签/搜索