Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Service Configuration

Frank Schröder edited this pageJul 4, 2016 ·1 revision

Each service can register one or more URL prefixes for which it servestraffic. A URL prefix is ahost/path combination without a scheme since SSLhas already been terminated and all traffic is expected to be HTTP. Toregister a URL prefix add a tagurlprefix-host/path to the servicedefinition.

By default, traffic is distributed evenly across all service instances whichregister a URL prefix but you can set the amount of traffic a set of instanceswill receive ("Canary testing"). See [Traffic Shaping](#Traffic Shaping)below.

A background process watches for service definition and health status changesin consul. When a change is detected a new routing table is constructed usingthe commands described in [Config Commands](#Config Commands).

Consul and the${DC} Variable

Consul allows to discover services by two different names:

  • mysvc.service.consul
  • mysvc.service.dc1.consul

Assuming thatdc1 is the datacenter of the local agent during servicediscovery the first name may return instances from a different datacenterwhereas the second name will only return instances fromdc1.

If you have multiple environments with separate consul servers and distinguishthem via datacenter then you can use${DC} in theurlprefix- tag to simplifythe registration.

This way you can always register your service with the same set of tagsurlprefix-mysvc.service.consul,urlprefix-mysvc.service.${DC}.consul withoutknowing the consul configuration.

Clone this wiki locally

[8]ページ先頭

©2009-2025 Movatter.jp