文章編號: 244368 - 上次校閱: 2006年12月21日 - 版次: 5.1 如何在大型網路中最佳化 Active Directory 複寫
本文曾發行於 CHT244368 重要
本文包含如何修改登錄的相關資訊。修改登錄之前,請務必將它備份起來,並瞭解如何在發生問題時還原登錄。如需有關如何備份、還原和修改登錄的詳細資訊,請按一下下面的文件編號,檢視「Microsoft
知識庫」中的文件: 256986?
(http://support.microsoft.com/kb/256986/
)
Microsoft Windows 登錄說明 在此頁中結論 本文將告訴您,如何在大型網路設定中最佳化 Active Directory 複寫。 其他相關資訊警告
如果您使用「登錄編輯程式」或其他方法不當地修改登錄,可能會發生嚴重問題。您可能需要重新安裝作業系統,才能解決這些問題。Microsoft
不保證可以解決這些問題。請自行承擔修改登錄的一切風險。
當網路中新增或移除網域控制站、網域控制站無法使用或資料複寫排程變更時,「知識一致性檢查程式」(KCC) 會動態調整網路的資料複寫拓撲。 KCC 的工作是:
範例在包含許多站台、網域或站台間有許多路由的大型站台設定中,站台間 KCC 執行速度很慢,而且占用太多中央處理器 (CPU) 時間和記憶體資源。如果 D 是網路中的網域數量,S 是網路中的站台數量,而且
(1 + D) * S^2 <= 100,000
您可以放心地略過本文的其餘部分。下表列出站台間 KCC 以未套用效能調整的各種中樞與支點設定執行時,所執行的執行時間和記憶體消耗量數字。每個站台都具有單一網域的網域控制站和通用類別目錄。網域會平均分佈在站台之間。自動站台連結橋接已啟用。測量是在具有 1 GB「隨機存取記憶體」(RAM) 的 Intel Pentium III Xeon (速度為 500MHz) 上進行的。記憶體使用量包括資料庫快取。在實體記憶體較少的電腦上,記憶體消耗量也較低。 摺疊此表格
(1 + num domains) * num sites ^ 2 * 0.0000075 minutes
您可以使用「Active Directory 站台及服務」嵌入式管理單元,判斷 KCC 以現有設定執行了多久:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\NTDS\Diagnostics
將「1 知識一致性檢查程式」的值變更為 3 以上。當這個值設定為 3 以上時,KCC 會記錄事件 1009 和 1013 以表示檢查的開始和結束。 建議如果您的設定不符合上述條件,請使用適當的方法:減少使用站台設定中的站台連結橋接這個選項會減少站台之間的潛在路由數目,在一般的中樞與支點設定中很管用。自動站台連結橋接表示整個網路完全是由網際網路通訊協定 (IP) 傳送的。在這種情況下,指定站台上的任何電腦都可以透過 IP 與任何其他站台中的任何電腦通訊。根據預設,IP 和 Simple Mail Transport Protocol (SMTP) 站台間傳輸都會啟用自動站台連結橋接。您必須在有需要的地方新增明確的站台連結橋接物件,才能停用此功能。只有當某個特定站台含有不在任何相臨站台中的網域的網域控制站,但該網域的另一個網域控制站卻出現在樹系的其他站台中時,才需要站台連結橋接。相臨站台定義為含有所討論的站台的任何站台連結中的任何站台。大部分設定都不需要使用站台連結橋接,因為任何含有位於多個站台中的指定網域的網域控制站的站台,幾乎一定會與至少一個含有相同網域的網域控制站的其他站台相臨。 在停用自動站台連結橋接之後,如果 KCC 無法直接或間接連接所有含有特定網域的網域控制站的站台,KCC 將會記錄事件 1311。 範例目錄服務一致性檢查程式判定可能:
停用自動站台連結橋接:
摺疊此表格
(1 + number of domains) * number of sites * 0.0006 minutes
其中 number of domains 是網域的數目,而
number of sites 是站台的數目。中心站台的公式為:
(1 + number of domains) * number of sites * 0.0015 minutes
只在非尖峰時段執行站台間 KCC當電腦有幾乎沒有工作的時段,而且站台間 KCC 正好可在此時段內執行時,此選項很管用。通常只有在已經減少站台連結橋接的使用,而且 KCC 的執行時間或記憶體使用量在重要營業時間內仍有問題時,才會使用此技術。指定站台中的 KCC 可以設定為只停用站台間拓撲計算,而保留其回應站台內變更複寫需求的能力。接著可以在一天的特定時間重新啟用站台間拓撲計算,並持續一段時間,使站台中的 KCC 有足夠的時間執行站台間檢查,然後再次停用。 當停用特定站台的站台間拓撲檢查時,該站台不會回應站台間拓撲的變化。如果複寫指定網域的所有站台間連線的一個或兩個複寫協力電腦都無法使用,則直到網域控制站重新連線或 KCC 的站台間部分再次執行之前,KCC 都不會自動連至新的來源或目的地。 注意:系統管理員可以在停用站台間 KCC 時手動新增連線。 如果要評估此選項在您的設定中是否實際可行,請先判斷 KCC 在您的環境中執行的時間。然後判斷每個站台中是否有一個網域控制站上有符合時間和記憶體需求的時段。KCC 的站台間部分不必同時在所有的站台中執行。 如果要排程站台間 KCC,請使用「工作排程器」元件來排程「wscript /b runkcc.vbs」(本文稍後有文字形式的指令碼) 的執行。如需有關「工作排程器」的詳細資訊,請參閱 Windows 2000 說明中的「工作排程器」主題。Runkcc.vbs 需要在它執行的電腦上安裝 Windows 2000 CD-ROM 中的 Support\Tools 資料夾中的支援工具。 完全停用站台間 KCC,手動設定連線此選項在一般的中樞與支點設定中很管用。通常只有在前兩種方法不可行,特別是在設定中有上千個站台時,才使用此選項。當自動站台間拓撲完全停用時,建立必要的站台間複寫連線物件以確保複寫資料在樹系中繼續流動,就變成系統管理員的責任。一般而言,如果客戶的站台數目超過 KCC 限制,可以使用中樞與支點網路拓撲,讓總公司與大量同類的分公司站台連線。這種對稱技術可以大幅簡化處理程序。 如果沒有 KCC 的協助,在建立您自己的連線物件之前,應考慮以下幾點:
Runkcc.vbs (觸發 KCC 的一次性執行的 VBScript)Microsoft 僅提供示範性的程式設計範例,不做任何明示或默示的保證。其中包括 (但不限於) 其適售性與適合某特定用途之默示擔保。本文將假設您已相當熟悉示範所使用的程式設計語言,以及用於建立和偵錯程序的工具。Microsoft 技術支援工程師可以協助說明特定程序的功能,但不會修改這些範例以提供附加功能或建構程序來滿足您的特定需求。 '*/ runkcc.vbs'*/ '*/ Parameters:<none> '*/ Purpose:When run on a domain controller, this script makes the local domain controller the Inter-Site '*/ Topology Generator for its site, enables inter-Site topology generation temporarily if it is disabled, '*/ runs the KCC topology generation process, and disables inter-site topology generation if it was '*/ configured so to begin with. '*/ '*/ On Error Resume Next Call ExecuteKCC() Public Sub ReportError () 'tell the user the error wscript.Echo "The following error occurred:(" + cstr(hex(err.number)) +") " + cstr(err.description) End Sub Public Sub ExecuteKCC () On Error Resume Next wscript.echo "Loading functions for use by this script..." set dll=createobject("iadstools.DCFunctions") if err.number <> 0 then ReportError:WScript.Quit dll.enabledebuglogging 1 'get the local box name wscript.echo "1> Connecting to local machine..." set localMachine=GetObject("LDAP://localhost/rootdse") if err.number <> 0 then ReportError:Wscript.Quit ServerName=localmachine.get("dnsHostName") if err.number <> 0 then ReportError:WScript.Quit wscript.echo "2> Found local machine " + ucase(ServerName) 'get the config NC configNC=localMachine.get("configurationNamingContext") if err.number <> 0 then ReportError:Wscript.Quit wscript.echo "3> Configuration Naming Context is:" + configNC 'get the SiteName of this box domaincontrollerSiteName=dll.dsgetsitename if err.number <> 0 then ReportError:Wscript.Quit wscript.echo "4> The site for this server is:" + domaincontrollersitename 'get the DSA DN for this box DSAObj = localMachine.get("dsServiceName") if err.number <> 0 then ReportError:Wscript.Quit wscript.echo "5> The DN for this machine's DSA is:" + DSAObj 'bind to the Site Settings object in the Directory SiteSettingsPath="LDAP://localhost/CN=NTDS Site Settings,CN="+domaincontrollerSiteName+",CN=Sites,"+configNC set SiteSettings=GetObject(SiteSettingsPath) if err.number <> 0 then ReportError:WScript.Quit 'make the current box the ISTG wscript.echo "6> Making " + ucase(ServerName) + " the Inter Site Topology Generator for the " + ucase(domaincontrollerSiteName) + " site." SiteSettings.Put "interSiteTopologyGenerator",DSAObj SiteSettings.SetInfo if err.number <> 0 then ReportError:Wscript.Quit 'get the current options origOptions=SiteSettings.Get("options") if hex(err.number) = "8000500D" then origOptions=0 elseif err.number=0 then 'do nothing else ReportError:Wscript.Quit end if modOptions=origOptions wscript.echo "7> Currently, the options specified for KCC operations for the ISTG in this site is set to:" + cstr(origOptions) 'enable the KCC if currently disabled, otherwise, leave it alone if modOPtions And 16 then mod2Options=modOptions XOr 16 wscript.echo "8> The KCC is currently disabled for inter-site topology generation.Temporarily re-enabling it.Setting options to:"+ cstr(mod2Options) SiteSettings.Put "options", mod2Options SiteSettings.SetInfo if err.number <> 0 then ReportError wscript.echo "An error occurred during the process of modifying the options attribute.Check to make sure that it has the correct original value.This script is terminating." Wscript.Quit end if else wscript.echo "8> The KCC is currently enabled to handle inter-site topology generation.No change is necessary before triggering the KCC." end if 'run the KCC Result=dll.TriggerKCC(cstr(ServerName)) if err.number > 0 then ReportError If result=0 then wscript.echo "9> The KCC was successfully triggered on " + ucase(ServerName) else wscript.echo "9> The following error occurred trigerring the KCC on " + ucase(ServerName) + ":" + dll.lasterrortext end if 'disable the KCC wscript.echo "10> Re-writing the original options (" + cstr(origOptions) + ") to the ISTG." SiteSettings.Put "options", origOptions SiteSettings.SetInfo if err.number <> 0 then ReportError:WScript.Quit End Sub 'end script 如需有關 Windows 2000 KCC 的詳細資訊,請按一下下面的文件編號,檢視「Microsoft 知識庫」中的文件: 242780?
(http://support.microsoft.com/kb/242780/
)
How to disable the Knowledge Consistency Checker from automatically creating replication topology
224815?
(http://support.microsoft.com/kb/224815/
)
The Role of the Inter-Site Topology Generator in Active Directory Replication
214745?
(http://support.microsoft.com/kb/214745/
)
Troubleshooting Event ID 1311: Knowledge Consistency Checker
這篇文章中的資訊適用於:
Microsoft及(或)其供應商不就任何在本伺服器上發表的文字資料及其相關圖表資訊的恰當性作任何承諾。所有文字資料及其相關圖表均以「現狀」供應,不負任何擔保責任。Microsoft及(或)其供應商謹此聲明,不負任何對與此資訊有關之擔保責任,包括關於適售性、適用於某一特定用途、權利或不侵權的明示或默示擔保責任。Microsoft及(或)其供應商無論如何不對因或與使用本伺服器上資訊或與資訊的實行有關而引起的契約、過失或其他侵權行為之訴訟中的特別的、間接的、衍生性的損害或任何因使用而喪失所導致的之損害、資料或利潤負任何責任。 | 其他資源 其他支援網站社群文章翻譯
|






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
回此頁最上方