参看https://github.com/hashicorp/consul-template#examples

// This is the address of the Consul agent. By default, this is 127.0.0.1:8500,
// which is the default bind and port for a local Consul agent. It is not
// recommended that you communicate directly with a Consul server, and instead
// communicate with the local Consul agent. There are many reasons for this,
// most importantly the Consul agent is able to multiplex connections to the
// Consul server and reduce the number of open HTTP connections. Additionally,
// it provides a "well-known" IP address for which clients can connect.
consul = "127.0.0.1:8500"

// This is the ACL token to use when connecting to Consul. If you did not
// enable ACLs on your Consul cluster, you do not need to set this option.
//
// This option is also available via the environment variable CONSUL_TOKEN.
token = "abcd1234"

// This is the amount of time to wait before retrying a connection to Consul.
// Consul Template is highly fault tolerant, meaning it does not exit in the
// face of failure. Instead, it uses exponential back-off and retry functions to
// wait for the cluster to become available, as is customary in distributed
// systems.
retry = "10s"

// This is the maximum interval to allow "stale" data. By default, only the
// Consul leader will respond to queries; any requests to a follower will
// forward to the leader. In large clusters with many requests, this is not as
// scalable, so this option allows any follower to respond to a query, so long
// as the last-replicated data is within these bounds. Higher values result in
// less cluster load, but are more likely to have outdated data.
max_stale = "10m"

// This is the log level. If you find a bug in Consul Template, please enable
// debug logs so we can help identify the issue. This is also available as a
// command line flag.
log_level = "warn"

// This is the path to store a PID file which will contain the process ID of the
// Consul Template process. This is useful if you plan to send custom signals
// to the process.
pid_file = "/path/to/pid"

// This is the quiescence timers; it defines the minimum and maximum amount of
// time to wait for the cluster to reach a consistent state before rendering a
// template. This is useful to enable in systems that have a lot of flapping,
// because it will reduce the the number of times a template is rendered.
wait = "5s:10s"

// This denotes the start of the configuration section for Vault. All values
// contained in this section pertain to Vault.
vault {
// This is the address of the Vault leader. The protocol (http(s)) portion
// of the address is required.
address = "https://vault.service.consul:8200"

// This is the token to use when communicating with the Vault server.
// Like other tools that integrate with Vault, Consul Template makes the
// assumption that you provide it with a Vault token; it does not have the
// incorporated logic to generate tokens via Vault's auth methods.
//
// This value can also be specified via the environment variable VAULT_TOKEN.
token = "abcd1234"

// This option tells Consul Template to automatically renew the Vault token
// given. If you are unfamiliar with Vault's architecture, Vault requires
// tokens be renewed at some regular interval or they will be revoked. Consul
// Template will automatically renew the token at half the lease duration of
// the token. The default value is true, but this option can be disabled if
// you want to renew the Vault token using an out-of-band process.
//
// Note that secrets specified in a template (using {{secret}} for example)
// are always renewed, even if this option is set to false. This option only
// applies to the top-level Vault token itself.
renew = true

// This section details the SSL options for connecting to the Vault server.
// Please see the SSL options below for more information (they are the same).
ssl {
// ...
}
}

// This block specifies the basic authentication information to pass with the
// request. For more information on authentication, please see the Consul
// documentation.
auth {
enabled = true
username = "test"
password = "test"
}

// This block configures the SSL options for connecting to the Consul server.
ssl {
// This enables SSL. Specifying any option for SSL will also enable it.
enabled = true

// This enables SSL peer verification. The default value is "true", which
// will check the global CA chain to make sure the given certificates are
// valid. If you are using a self-signed certificate that you have not added
// to the CA chain, you may want to disable SSL verification. However, please
// understand this is a potential security vulnerability.
verify = false

// This is the path to the certificate to use to authenticate. If just a
// certificate is provided, it is assumed to contain both the certificate and
// the key to convert to an X509 certificate. If both the certificate and
// key are specified, Consul Template will automatically combine them into an
// X509 certificate for you.
cert = "/path/to/client/cert"
key = "/path/to/client/key"

// This is the path to the certificate authority to use as a CA. This is
// useful for self-signed certificates or for organizations using their own
// internal certificate authority.
ca_cert = "/path/to/ca"
}

// This block defines the configuration for connecting to a syslog server for
// logging.
syslog {
// This enables syslog logging. Specifying any other option also enables
// syslog logging.
enabled = true

// This is the name of the syslog facility to log to.
facility = "LOCAL5"
}

// This block defines the configuration for de-duplication mode. Please see the
// de-duplication mode documentation later in the README for more information
// on how de-duplication mode operates.
deduplicate {
// This enables de-duplication mode. Specifying any other options also enables
// de-duplication mode.
enabled = true

// This is the prefix to the path in Consul's KV store where de-duplication
// templates will be pre-rendered and stored.
prefix = "consul-template/dedup/"
}

// This block defines the configuration for a template. Unlike other blocks,
// this block may be specified multiple times to configure multiple templates.
// It is also possible to configure templates via the CLI directly.
template {
// This is the source file on disk to use as the input template. This is often
// called the "Consul Template template". This option is required.
source = "/path/on/disk/to/template.ctmpl"

// This is the destination path on disk where the source template will render.
// If the parent directories do not exist, Consul Template will attempt to
// create them.
destination = "/path/on/disk/where/template/will/render.txt"

// This is the optional command to run when the template is rendered. The
// command will only run if the resulting template changes. The command must
// return within 30s (configurable), and it must have a successful exit code.
// Consul Template is not a replacement for a process monitor or init system.
command = "restart service foo"

// This is the maximum amount of time to wait for the optional command to
// return. Default is 30s.
command_timeout = "60s"

// This is the permission to render the file. If this option is left
// unspecified, Consul Template will attempt to match the permissions of the
// file that already exists at the destination path. If no file exists at that
// path, the permissions are 0644.
perms = 0600

// This option backs up the previously rendered template at the destination
// path before writing a new one. It keeps exactly one backup. This option is
// useful for preventing accidental changes to the data without having a
// rollback strategy.
backup = true

// These are the delimiters to use in the template. The default is "{{" and
// "}}", but for some templates, it may be easier to use a different delimiter
// that does not conflict with the output file itself.
left_delimiter = "{{"
right_delimiter = "}}"

// This is the minimum(:maximum) to wait before rendering a new template to
// disk and triggering a command, separated by a colon (:). If the optional
// maximum value is omitted, it is assumed to be 4x the required minimum value.
// This is a numeric time with a unit suffix ("5s"). There is no default value.
// The wait value for a template takes precedence over any globally-configured
// wait.
wait = "2s:6s"
}

consul模板配置参数值示例的更多相关文章

  1. consul 模板配置内容的参数说明

    datacenters {{datacenters}} 数据中心 file {{file "/path/to/local/file"}} 读取本地文件的内容.如果不可读的话,会报错 ...

  2. Pycharm 文件模板配置

    Pycharm 模板配置 #!/usr/bin/python # -*- coding: UTF-8 -*- # Author:${USER} 作者 # FileName:${NAME} 文件名称 # ...

  3. consul模板的说明2

    保证模板的正常执行 使用||true $ consul-template -template "in.ctmpl:out.file:service nginx restart || true ...

  4. EditPlus自动补全、模板配置

    EditPlus真的是一款非常好用的编辑器,虽然小,但是短小精悍,速度快.只要配置好了,功能也是很强大的.下面来总结一下如何配置EditPlus的自动补全,和模板配置. 一.配置自动补全:(以开发CS ...

  5. asp.net模板控件示例

    原文:asp.net模板控件示例 模板控件允许将控件数据与其表示形式相分离,模板化控件不提供用户界面. 编写它则是为了实现一个命名容器以及包含属性和方法可由宿主页访问的类,MSDN是这样解释的. 下面 ...

  6. trait与policy模板应用简单示例

    trait与policy模板应用简单示例 accumtraits.hpp // 累加算法模板的trait // 累加算法模板的trait #ifndef ACCUMTRAITS_HPP #define ...

  7. jeecg入门操作—模板配置(录入界面)

    点击online表单的模板配置,进入模板设计列表页面,点击创建模板 点击创建模板 点击激活 设计完成,点击激活(表单模板可以多个,激活状态只能有一个) 激活后,重新加入功能测试,点击添加页面,效果如下 ...

  8. .net core consul 服务配置 服务发现 服务健康检测 服务变更加载

    准备环境 安装consul之后 1. 创建一个.net core webapi 举例为UsercenterService 2. nuget引用Consul组件  https://github.com/ ...

  9. Spring Cloud Consul使用——配置中心

    1.pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www ...

随机推荐

  1. IOS第八天(6:UITableViewController新浪微博, 模型和 控件位置封装一起statusFrame)

    *****HMViewController #import "HMViewController.h" #import "HMStatus.h" #import ...

  2. 一次与iptables有关的Openstack排错

    先说下环境: 宿主机A(192.168.1.242)上运行着实例a(192.168.1.176), 宿主机B(192.168.1.56)上运行着实例b(192.168.1.50). 用户说从实例b上t ...

  3. GDC2016【For Honor-荣耀战魂】的次世代动画技术

    生成自然丰富,反应灵敏的动作的“Motion Matching”是什么?         Ubisoft在2016年内预定发售的[荣誉战魂],是基于MOBA类集团战斗,并加入了高度紧张的剑斗动作的多人 ...

  4. JavaScript方法的调用

    1.假如是有名字的函数 调用是用名字调用,并且会把返回值赋值给接受它的参数 代码: function f() { alert("我是f"); return '我是返回值'; } f ...

  5. jQuery获取一般处理程序(ashx)的JSON数据

    昨天有在开发的软件生产线生产流程,RFID扫描IC卡的数据,当中有用到jQuery获取一般处理程序(ashx)的JSON数据.今有把它写成一个小例子,望需要的网友能参考. 在网站中,创建一个一般应用程 ...

  6. Java学习-047-数值格式化及小数位数四舍五入

    此小工具类主要用于数值四舍五入.数值格式化输出,很简单,若想深入研究,敬请自行查阅 BigDecimal 或 DecimalFormat 的 API,BigDecimal.setScale(位数,四舍 ...

  7. python_os

    1. 基本功能的介绍 os模块包含普通的操作系统的功能 2. 常用的变量 (1)os.name 获取正在使用的平台, Windows 返回 nt, Linux或者Unix 返回 posix 3. 常用 ...

  8. HttpClient(JAVA)使用笔记

    HTTPCLIENT 此工具是由apache基金会支持开发的一套 开源 http client 组件, 目前属于 http components的一部分, 官网:http://hc.apache.or ...

  9. ucos 学习

    1.UCOSII 早期版本只支持 64 个任务,但是从 2.80 版本开始,支持任务数提高到 255 个,不过对我们来说一般 64 个任务都是足够多了,一般很难用到这么多个任务. UCOSII 保留了 ...

  10. java-EL

    语法 ¥{} 运算符 算数 加+.减-.乘*.除/.模% 比较 大于>.小于<.等于==.不等于!=.empty(判断是否为空,空位true,非空为false)(null 未实例化,&qu ...