栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Java

【Consul教程】1.Consul简介和安装

Java 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

【Consul教程】1.Consul简介和安装

简介

consul是HashiCorp 公司基于Go语音开发的微服务工具。基于它Http API方式可以十分方便在系统中实现服务注册于发现,分布式配置中心。支持集群CP模式,一致性算法是Raft。

常见解决方案:

SpringBoot + Consul 实现注册中心、配置中心。

Nginx + Upsync + Consul 实现动态负载均衡。

Centos7安装Consul

下载地址:https://releases.hashicorp.com/consul/

1.命令行下载

wget https://releases.hashicorp.com/consul/1.12.0/consul_1.12.0_linux_amd64.zip --no-check-certificate

2.解压

unzip consul_1.12.0_linux_amd64.zip

提示错误:unzip 未找到

解决:yum -y install unzip

3.安装验证

./consul
Usage: consul [--version] [--help]  []

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

4.启动

./consul agent -dev -ui -node=consul-dev -client=192.168.126.156

5.浏览器访问 192.168.126.156:8500

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/915311.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号