Envoy 启动相关参数整理

文章详细介绍了Envoy启动时使用的参数处理,主要涉及OptionsImpl类及TCLAP库的应用。参数解析在OptionsImpl的构造函数中进行,首先设置默认值,然后根据启动参数覆盖。列举了多个启动参数,如base-id、concurrency、config-path等,讨论了它们的用途和默认值。
摘要由CSDN通过智能技术生成

本篇属于Envoy代码的阅读笔记,整理了envoy启动所使用到的参数信息,代码实现在类 OptionsImpl 中,使用了TCLAP来进行参数的行解析处理。

// 文件路径如下所示:
"source/server/options_impl.h"
"source/server/options_impl.cc"

实现逻辑在下面的构造函数中:

OptionsImpl::OptionsImpl(std::vector<std::string> args,
                         const HotRestartVersionCb& hot_restart_version_cb,
                         spdlog::level::level_enum default_log_level) {
                         ......
                         // 参数会先设置一个默认值,如果envoy的启动参数里面设置了对应的参数,会替换掉这些默认数据
                         }

TCLAP的相关知识可以参考:C++ 命令行解析库TCLAP

参数列表:

序号
参数名称
参数描述
类型
默认值
1
base-id"base ID so that multiple envoys can run on the same host if needed"uint32_t0
2
use-dynamic-base-id

"the server chooses a base ID dynamically. Supersedes a static base ID. May not be used when the restart epoch is non-zero."

bool
false
3
base-id-path"path to which the base ID is written"string""
4
concurrency"# of worker threads to run"uint32_tstd::thread::hardware_concurrency()
5
config-path"Path to configuration file"string
""
6
config-yaml"Inline YAML configuration, merges with the contents of --config-path"string
""
7
bootstrap-version

"API version to parse the bootstrap config as (e.g. 3). If "

"unset, all known versions will be attempted"

uint32_t0
8
allow-unknown-fields"allow unknown fields in static configuration (DEPRECATED)"bool
false
9
allow-unknown-static-fields"allow unknown fields in static configuration"bool
false
10
reject-unknown-dynamic-fields
bool
false
11
ignore-unknown-dynamic-fields"ignore unknown fields in dynamic configuration"bool
false
12
admin-address-path "Admin address path"string
""
13
local-address-ip-version

The local  IP address version (v4 or v6)."

string
"v4"
14
log-levellog_levels_stringstring
spdlog::level::level_string_views[default_log_level].data()
15
component-log-levelcomponent_log_level_stringstring
""
16
log-formatlog_format_stringstring
Logger::Logger::DEFAULT_LOG_FORMAT
17
log-format-escaped"Escape c-style escape sequences in the application logs"bool
false
18
enable-fine-grain-logging"Logger mode: enable file level log control(Fancy Logger)or not"bool
false
19
log-path"Path to logfile"string
""
20
restart-epoch"hot restart epoch #"uint32_t0
21
hot-restart-version"hot restart compatibility version"bool
false
22
service-cluster"Cluster name"string
""
23
service-node"Node name"string
""
24
service-zone"Zone name"string
""
25
file-flush-interval-msec"Interval for log flushing in msec"uint32_t10000ms
26
drain-time-s"Hot restart and LDS removal drain time in seconds"uint32_t600ms
27
drain-strategy"Hot restart drain sequence behaviour, one of 'gradual' (default) or 'immediate'."string
"gradual"
28
parent-shutdown-time-s"Hot restart parent shutdown time in seconds"uint32_t900ms
29
mode

"One of 'serve' (default; validate configs and then serve "

"traffic normally) or 'validate' (validate configs and exit)."

string
"serve"
30
disable-hot-restart"Disable hot restart functionality"bool
false
31
enable-mutex-tracing"Enable mutex contention tracing functionality"bool
false
32
cpuset-threads"Get the default # of worker threads from cpuset size"bool
false
33
disable-extensions"Comma-separated list of extensions to disable"string
""
34
socket-path"Path to hot restart socket file"string
"@envoy_domain_socket"
35
socket-mode"Socket file permission"string
"600"
36
enable-core-dump"Enable core dumps"bool
false





参考:istio-proxy 1.11.2版本的envoy  代码

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值