使用 NorthStar CLI 配置 NorthStar 设置
从 NorthStar 版本 6.1.0 开始,以前在 northstar.cfg 文件中维护的特定于组件和特定于服务的 NorthStar 设置将保留在内部缓存中,并且可以使用 NorthStar CLI 进行配置。NorthStar CLI 与 Junos OS CLI 非常相似。
某些引导和基础架构配置设置将继续保留在 northstar.cfg 文件中。
如果您还不熟悉 Junos OS CLI,请参阅 Junos OS CLI 用户指南 ,其中涵盖:
访问操作和配置命令模式,以及在模式之间切换
命令层次结构的概念
层次结构级别之间的导航
获取有关命令语法的帮助,包括如何显示部分命令的所有可能补全
有用的键盘序列,包括命令完成快捷键
提交或退出配置更改
访问 NorthStar CLI
要访问 NorthStar CLI,请执行以下操作:
安装成功北极星后,登录到北极星应用服务器。
启动 NorthStar CLI:
[root@ns]# /opt/northstar/utils/cmgd_cli root@ns>
>提示符表示您处于操作模式。在此模式下,您可以显示 NorthStar 配置,但不能更改它。例如:
root@ns> show configuration northstar config-server { health-monitor { heartbeat-interval 5s; poll-interval 10m; history-ttl 2d; heartbeat-holdown-timer 15s; } } path-computation-server { health-monitor { heartbeat-interval 5s; poll-interval 10m; history-ttl 2d; heartbeat-holdown-timer 15s; } } netconfd { in-memory-datastore { reconnect-delay 1000; reconnect-retries 10000; } } programmable-rpd-client { health-monitor { heartbeat-interval 5s; poll-interval 10m; history-ttl 2d; heartbeat-holdown-timer 15s; } enable-top-prefix-filter; publish-top-prefix-only; } root@ns1>
使用 edit 命令进入配置模式(提示更改为 #):
root@ns> edit Entering configuration mode Users currently editing the configuration: root terminal pts/1 (pid 246) on since 2020-08-25 17:26:47 UTC, idle 1d 23:54 [edit] root terminal pts/2 (pid 262) on since 2020-08-26 23:05:31 UTC, idle 17:13:12 [edit] [edit] root@ns1#
[edit] 表示命令层次结构的顶部。
所有 NorthStar 配置命令都以 开头。 set northstar带问号输入 set northstar 以显示 NorthStar 配置命令顶级类别:
root@ns1# set northstar ? Possible completions: > analytics General configuration parameters related to analytics > config-server Config Server run time parameters > mladapter General configuration parameters related to ML Adapter. Common configuration parameters like amqp or database are taken from amqpSettings, but can be overridden for MLAdapter. > netconfd General configuration parameters related to netconfd > path-computation-server Path computation server run time parameters > peer-engineering General configuration parameters for IPE > programmable-rpd-client General configuration parameters related to the PRPD client > system > topology-server General configuration parameters related to the Topology Server. Common configuration parameters like amqp or database are taken from amqpSettings, but can be overridden for the Topology Server. [edit] root@ns1# set northstar
继续处理任何类别和问号,以查看下一级细分。例如:
root@ns1# set northstar config-server ? Possible completions: > health-monitor Configuration parameters related to Health Monitor + include-interface-type The interfaces to be published by Config Server Space-separated list enclosed in [ ] or single interface type with no brackets. Indicates discovered interface types to be added to NorthStar. The following interface types are supported: - physical Physical interfaces : interface name without dot (.) in it - loopback-mgmt Loopback and management interfaces : interface name starting with lo, fxp, me and em - vrf-if Interfaces associated with VRF - links-if Interfaces on links - all all interfaces > log-destination List of logging configuration publish-aslink Enable ConfigServer to publish aslink created by getipconf to the Northstar model [edit] root@ns1# set northstar config-server
以这种方式继续以到达配置设置,如果命令需要,请指定要更改的值。例如:
root@ns1# set northstar config-server include-interface-type ? Possible completions: [ Open a set of values all links-if loopback-mgmt physical vrf-if [edit] root@ns1# set northstar config-server include-interface-type [links-if physical] [edit] root@ns1#
熟悉命令层次结构后,可以在进入配置模式后直接导航到其他级别。例如:
root@ns> edit Entering configuration mode Users currently editing the configuration: root terminal pts/0 (pid 162) on since 2020-09-05 17:08:10 UTC, idle 1d 07:59 [edit] [edit] root@ns# edit northstar system health-monitor [edit northstar system health-monitor] root@ns# set ? Possible completions: heartbeat-holdown-timer Health monitor holdown timer. Can be expressed as seconds ('s' or 'seconds'). Examples: 30s, 30seconds. (default=15s) heartbeat-interval Health monitoring heartbeat interval. Can be expressed as seconds ('s' or 'seconds'). Examples: 10s, 10seconds. (0 or -ve value = disabled, default=5s) history-ttl Health monitor history retention. Can be expressed as days ('d' or 'days'). Examples: 7d, 7days. (default=2d) poll-interval Health monitor poll interval. Can be expressed as minutes ('m' or 'minutes'). Examples: 4m, 4minutes. (default=10m) [edit northstar system health-monitor]
NorthStar 配置设置
表 1 列出了最有可能需要修改的 NorthStar 配置设置。它不是所有可用设置的完整列表。
设置 |
命令 |
描述 |
---|---|---|
港口 (网讯) |
set northstar netconfd device-connection-pool netconf port |
使用此命令将 NETCONFD 的默认端口从 830 更改为 830。在某些安装中,首选端口 22。 |
按前缀聚合 (Netflow 收集器) |
set northstar analytics netflowd aggregate-by-prefix |
默认情况下,Netflow 按 PE 聚合流量,但对于某些应用程序(如 IPE),您可能希望按前缀聚合流量。如果启用该参数,Netflow 会在定义的时间段内将所有流量从特定入口 PE 路由器聚合到特定目标(前缀)。 |
enable-ssl (Netflow 收集器) |
set northstar analytics netflowd enable-ssl |
启用安全套接字层 (SSL)。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 Netflow 收集器。 |
水平 (Netflow 收集器) |
set northstar analytics netflowd log-destination destination-name level |
日志文件中捕获的信息级别。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 Netflow 收集器。 |
默认采样间隔 (Netflow 收集器) |
set northstar analytics netflowd default-sampling-interval |
默认采样间隔(如果路由器未在模板流集中提供间隔)。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 Netflow 收集器。 |
发布间隔 (Netflow 收集器) |
set northstar analytics netflowd publish-interval |
Elasticsearch 和 PCS 的发布间隔。流量按发布间隔聚合。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 Netflow 收集器。 |
工人 (Netflow 收集器) |
set northstar analytics netflowd workers |
要启动的工作进程数。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 Netflow 收集器。 有关分布式数据收集的详细信息,请参阅 分布式数据收集的辅助收集器安装 。 |
通知最终带宽非活动流 (Netflow 收集器) |
set northstar analytics netflowd notify-final-bandwidth-on-inactive-flow |
如果启用,netflowd 会在流不再处于活动状态后发送一个最终更新,将带宽报告为 0。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 Netflow 收集器。 |
统计信息间隔 (Netflow 收集器) |
set northstar analytics netflowd stats-interval |
将统计信息打印到日志文件的时间间隔。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 Netflow 收集器。 |
按需生成 (Netflow 收集器) |
set northstar analytics netflowd generate-as-demands |
支持通过净流量生成 AS 需求。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 Netflow 收集器。 |
轮询间隔 (多层) |
set northstar mladapter polling-interval |
控制不支持通知的接口的轮询间隔。 有关详细信息,请参阅 NorthStar 控制器用户指南中的配置多层功能。 |
区间 (集合清理) |
set northstar system scheduler tasks collection-cleanup interval |
控制收集清理系统任务的运行频率(以天为单位)。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 NorthStar Analytics 原始数据和聚合数据保留。 |
原始数据保留持续时间 (集合清理) |
set northstar system scheduler tasks collection-cleanup raw-data-retention-duration |
定义以天数为单位的原始数据的“旧”日志。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 NorthStar Analytics 原始数据和聚合数据保留。 |
汇总数据保留期 (集合清理) |
set northstar system scheduler tasks collection-cleanup rollup-data-retention-duration |
定义以天数表示的“旧”聚合数据。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 NorthStar Analytics 原始数据和聚合数据保留。 |
区间 (汇总) |
set northstar system scheduler tasks rollup interval |
设置 ESRollup 系统任务的运行频率(以小时为单位)。 有关详细信息,请参阅 NorthStar 控制器用户指南中的 NorthStar Analytics 原始数据和聚合数据保留。 |
LSP 延迟间隔 (分析) |
set northstar path-computation-server lsp-latency-interval |
使 PCViewer 能够计算 LSP 延迟并在 Web UI 中显示数据。 有关详细信息,请参阅 NorthStar 控制器用户指南中的在 Web UI 中查看分析数据。 |
包含接口类型 (与接口相关的所有任务) |
set northstar config-server include-interface-type |
可在设备上发现并由流量收集使用的接口类型。 支持的接口类型包括:
注意:
configServer 仅将您指定的接口类型发布到所有组件。Web UI 和数据收集仅接收有关表示这些接口类型的接口的信息。 如果修改此设置,取消选择已由 NorthStar 模型中的接口表示的接口类型,则这些现有接口将保留在模型中。 |