简介
本文档介绍如何配置平衡数据库(DB)分段的阈值。
先决条件
要求
Cisco 建议您了解以下主题:
- Linux
- 思科策略套件(CPS)
- MongoDB
使用的组件
本文档中的信息基于以下软件和硬件版本:
本文档中的信息都是基于特定实验室环境中的设备编写的。本文档中使用的所有设备最初均采用原始(默认)配置。如果您的网络处于活动状态,请确保您了解所有命令的潜在影响。
背景信息
两种应用模式会导致碎片增加、文档增长和文档删除。MongoDB级别上的两个操作通常是。对数据进行碎片整理的最佳方法是跨副本成员重新同步数据。但是,仍然存在碎片化警报。
- 在/etc/collectd.d/dbMonitorList.cfg文件(在会话管理器虚拟机上)中为所有数据库配置分段百分比阈值。所有数据库的默认阈值都配置为40%。默认分段阈值可根据需要更改。有关详细信息,请参阅《CPS操作指南》中的“配置自定义数据库分段阈值百分比”部分。
- 此外,使用diagnostics.sh —getfragstatus命令验证sessioncache、skcache、diameter和Subscriber Profile Repository(SPR)数据库的主成员的当前分段百分比。
- diagnostics.sh —get_frag_status支持session_cache、sk_cache、diameter和SPR数据库的分段百分比计算。
- diagnostics.sh —getfragstatus与diagnostics.sh —getsessionshardhealth仅对多群集高可用性(HA)和地理冗余(GR)设置支持根用户。
步骤
预检
注意:所有命令都从cluman运行。
获取验证阶段使用的当前余额数据库分段阈值。
# for host in $(hosts-all.sh | grep 'sessionmgr'); do echo check in progress on $host; ssh $host "cat /etc/collectd.d/dbMonitorList.cfg | grep balance"; done
应用更改
将此条目添加到/var/qps/config/deploy/csv/Configuration.csv中,并添加阈值(将50更改为所需值,例如,在正常分段级别将60)。
balance_mgmt,50,
echo -e "\nbalance_mgmt,50," >> /var/qps/config/deploy/csv/Configuration.csv
[root@cps194cluman ]# echo -e "\nbalance_mgmt,50," >> /var/qps/config/deploy/csv/Configuration.csv
[root@cps194cluman ]# grep balance_mgmt Configuration.csv
balance_mgmt,50,
导入csv更改
/var/qps/install/current/scripts/import/import_deploy.sh
[root@cps194cluman csv]# /var/qps/install/current/scripts/import/import_deploy.sh
Filenames to be processed are listed here.
AdditionalHosts.csv Configuration.csv DBConfigServer.csv Definitions.csv Hosts.csv ReplicationSets.csv SessionCache.csv VLANs.csv VMSpecification.csv SecureConfig.csv VipProxyConfiguration.csv DSCPConfig.csv CriticalFiles.csv
Warning: The first build is not processed. We process only the list of files mentioned.
Warning: old files are not processed. We process only list of files mentioned.
The CSV files in /var/qps/config/deploy/csv are converted to json files in /var/qps/config/deploy/json..
build the hosts file to /var/www/html/hosts...
build the /etc/hosts file from the json configuation... /etc/hosts is backed to /etc/hosts.back
Rotate backup '/etc/hosts.back' to '/etc/hosts.back.0'
Backed up '/etc/hosts' to '/etc/hosts.back'
‘/etc/hosts’ -> ‘/etc/hosts.back’
Redis by default disabled -DenableQueueSystem=false in /etc/broadhop/qns.conf
Removing feature configs moved to core
Removing ws feature from pb and pcrf feature file
Building /etc/broadhop...
Copying to /var/qps/images/etc.tar.gz...
Creating MD5 Checksum...
Generating /etc/broadhop/servers.all
Rebuilding facts for: 'installer' (aka 'installer')
Creating md5sum for hosts file to validate later
Rebuilding facts for: 'casant01-ps01' (aka 'qns01')
Rebuilding facts for: 'casant01-pd02' (aka 'lb02')
Rebuilding facts for: 'casant01-sessionmgr01' (aka 'sessionmgr01')
Rebuilding facts for: 'casant01-sessionmgr02' (aka 'sessionmgr02')
Rebuilding facts for: 'casant01-oam01' (aka 'pcrfclient01')
Rebuilding facts for: 'casant01-ps02' (aka 'qns02')
Rebuilding facts for: 'casant01-pd01' (aka 'lb01')
Rebuilding facts for: 'casant01-oam02' (aka 'pcrfclient02')
Copying /etc/puppet to /var/qps/images/puppet.tar.gz...
Creating MD5 Checksum...
[root@cps194cluman csv]#
生成更新的虚拟机映像
# /var/qps/bin/build/build_all.sh
更新会话管理器虚拟机中的阈值
# /var/qps/install/current/scripts/upgrade/reinit.sh
确认
验证余额数据库分段的阈值是否已更改为已配置的值。
# for host in $(hosts-all.sh | grep 'sessionmgr'); do echo check in progress on $host; ssh $host "cat /etc/collectd.d/dbMonitorList.cfg | grep balance"; done
验证警报生成脚本是否包含更新的阈值。
# for host in $(hosts-all.sh | grep 'sessionmgr'); do echo checking in $host; ssh $host "cat /var/log/broadhop//scripts/gen-frag-trap.log | grep DEBUG | tail -5"; done
注意:在尝试进行生产设置之前,请在实验室中测试此设置。