簡介
本文說明如何配置餘額資料庫(DB)的分段閾值。
必要條件
需求
思科建議您瞭解以下主題:
- Linux
- 思科原則套件(CPS)
- MongoDB
採用元件
本文中的資訊係根據以下軟體和硬體版本:
本文中的資訊是根據特定實驗室環境內的裝置所建立。文中使用到的所有裝置皆從已清除(預設)的組態來啟動。如果您的網路運作中,請確保您瞭解任何指令可能造成的影響。
背景資訊
兩種應用程式模式會導致分段、文檔增長和文檔刪除增加。這兩個操作通常在MongoDB級別。進行碎片整理的最佳方法是在副本成員之間重新同步資料。但是,仍然出現分段警報。
- 在/etc/collectd.d/dbMonitorList.cfg檔案(在sessionmgr虛擬機器上)中為所有資料庫配置碎片百分比閾值。所有資料庫的預設閾值配置為40%。可以根據需要更改預設的分段閾值。有關詳細資訊,請參閱《CPS操作指南》中的「配置自定義資料庫碎片閾值百分比」部分。
- 此外,使用diagnostics.sh —get_frag_status命令驗證session_cache、sk_cache、diameter和Subscriber Profile Repository(SPR)資料庫的主成員的當前分段百分比。
- diagnostics.sh —get_frag_status支援session_cache、sk_cache、diameter和SPR資料庫的分段百分比計算。
- 根使用者僅支援多群集高可用性(HA)和異地冗餘(GR)設定的diagnostics.sh —get_frag_status(如diagnostics.sh —get_session_shard_health)。
步驟
預檢查
附註:所有命令都是從雲端運行。
獲取當前在驗證階段中使用的平衡資料庫碎片閾值。
# 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 "\n balance_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
更新sessionmgr虛擬機器中的閾值
# /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
附註:在嘗試生產設定之前,在實驗室中對其進行測試。