前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Envoy 启动相关参数整理

Envoy 启动相关参数整理

作者头像
灰子学技术
发布2023-02-28 17:00:53
5840
发布2023-02-28 17:00:53
举报
文章被收录于专栏:灰子学技术灰子学技术

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

代码语言:javascript
复制
// 文件路径如下所示:
"source/server/options_impl.h"
"source/server/options_impl.cc"

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

代码语言:javascript
复制
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_t

0

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_t

std::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_t

0

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-level

log_levels_string

string

spdlog::level::level_string_views[default_log_level].data()

15

component-log-level

component_log_level_string

string

""

16

log-format

log_format_string

string

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_t

0

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_t

10000ms

26

drain-time-s

"Hot restart and LDS removal drain time in seconds"

uint32_t

600ms

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_t

900ms

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 代码

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2023-01-02,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 灰子学技术 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
日志服务
日志服务(Cloud Log Service,CLS)是腾讯云提供的一站式日志服务平台,提供了从日志采集、日志存储到日志检索,图表分析、监控告警、日志投递等多项服务,协助用户通过日志来解决业务运维、服务监控、日志审计等场景问题。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档