docker consul environment to build

And etcd Similarly, consul is a highly available distributed kv system, and provide richer functionality than etcd, comes ui interface

consul mode with support end (client) and server mode (Server), deployed in a local client on each client machine in a practical deployment, server data synchronized to the client, the local client to interact directly with the service, effectively reduced network traffic

Build consul services

version: "3.5"
services:
  consul:
    hostname: consul
    image: consul:1.6.1
    deploy:
      replicas: 1
      restart_policy:
        condition: on-failure
    # ports:
    #   - "8500:8500"
    #   - "8600:8600"
    user: root
    volumes:
      - "/var/docker/consul/data:/consul/data"
    environment:
      - CONSUL_BOOTSTRAP_EXPECT=1
      - CONSUL_CLIENT_LAN_ADDRESS=0.0.0.0
      - CONSUL_ENABLE_UI=true
      - CONSUL_ENABLE_SERVER=true
    networks:
      - consulnet

networks:
  consulnet:
    name: consulnet

After successful deployment, you can http://127.0.0.1:8500/ui/access consul ui

link

Please indicate the source article link: https://tech.hatlonely.com/article/63

Guess you like

Origin www.cnblogs.com/hatlonely/p/11951704.html