溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

SQL Server AlwaysOn中445端口使用的調(diào)查報告

發(fā)布時間:2020-07-17 06:20:49 來源:網(wǎng)絡(luò) 閱讀:10535 作者:UltraSQL 欄目:關(guān)系型數(shù)據(jù)庫

SQL Server AlwaysOn中445端口使用的調(diào)查報告


第一部分:來自微軟官方的文檔說明


Microsoft Knowledge Base article 832017: Service overview and network port requirements for Windows


針對我們生產(chǎn)環(huán)境SQL Server 2014 AlwaysOn FCI & AG混合部署,基于Active Directory和Cluster Service。


下面信息引用自KB 832017,描述了基于這兩個服務(wù)的相關(guān)端口要求:


1. Active Directory (Local Security Authority)

Active Directory runs under the Lsass.exe process and includes the authentication and replication engines for Windows domain controllers. Domain controllers, client computers and application servers require network connectivity to Active Directory over specific hard-coded ports. Additionally, unless a tunneling protocol is used to encapsulate traffic to Active Directory, a range of ephemeral TCP ports between 1024 to 5000 and 49152 to 65535 are required.


依賴端口列表:

Application protocol

Protocol

Ports

Active Directory Web Services (ADWS)

TCP

9389

Active Directory Management Gateway Service

TCP

9389

Global Catalog

TCP

3269

Global Catalog

TCP

3268

ICMP


No port number

LDAP Server

TCP

389

LDAP Server

UDP

389

LDAP SSL

TCP

636

IPsec ISAKMP

UDP

500

NAT-T

UDP

4500

RPC

TCP

135

RPC randomly allocated high TCP ports1

TCP

1024 - 5000
49152 - 655352

SMB

TCP

445


2. Cluster Service

The Cluster service controls server cluster operations and manages the cluster database. A cluster is a collection of independent computers that act as a single computer. Managers, programmers, and users see the cluster as a single system. The software distributes data among the nodes of the cluster. If a node fails, other nodes provide the services and data that were formerly provided by the missing node. When a node is added or repaired, the cluster software migrates some data to that node.


System service name: ClusSvc

Application

Protocol

Ports

Cluster Service

UDP

3343

Cluster Service

TCP

3343 (This port is required during a node join operation.)

RPC

TCP

135

Cluster Administrator

UDP

137

Randomly allocated high UDP ports1

UDP

Random port number between 1024 and 65535
Random port number between 49152 and 655352

Note:

Additionally, for successful validation on Windows Failover Clusters on 2008 and above, allow inbound and outbound traffic for ICMP4, ICMP6, and port 445/TCP for SMB.


第二部分:來自微軟Data Platform MVP Mail List的回復(fù)


SQL Server AlwaysOn中445端口使用的調(diào)查報告


第三部分:關(guān)于AD和WSFC原理的深入學(xué)習(xí)


1. AD對445的依賴

各個客戶端開機時,需要訪問AD里面DC上的一個sysvol共享,下載組策略。每次開機都要訪問,通過這個共享下發(fā)組策略。


SYSVOL:

SYSVOL是指存儲域公共文件服務(wù)器副本的共享文件夾,它們在域中所有的域控制器之間復(fù)制。 Sysvol文件夾是安裝AD時創(chuàng)建的,它用來存放GPO、Script等信息。同時,存放在Sysvol文件夾中的信息,會復(fù)制到域中所有DC上。


Netlogon:

Netlogon(網(wǎng)絡(luò)登錄)服務(wù)為域控制器注冊所有的srv資源紀(jì)錄。這些記錄出現(xiàn)在DNS服務(wù)器的正向查詢區(qū)域你的域名中的_msdcs, _sites, _tcp, and _udp等文件夾中。其他計算機利用這些記錄查詢域活動目錄相關(guān)的信息。


2. WSFC對445的依賴

群集數(shù)據(jù)庫是WSFC的運作的主要概念之一,群集數(shù)據(jù)庫里面會記載著群集應(yīng)用當(dāng)前的狀態(tài),例如當(dāng)前節(jié)點1運行了一個DHCP角色,狀態(tài)是上線,運行了一個文件服務(wù)器角色,狀態(tài)是離線,以及群集配置,群集成員配置,群集資源的添加,創(chuàng)建,啟動,刪除,停止,下線等狀態(tài)變化,群集數(shù)據(jù)庫就是為了幫助各個節(jié)點知道對方上面運行了什么樣的群集服務(wù),一旦對方宕機之后,將按照群集數(shù)據(jù)庫里面的進行的狀態(tài)信息連接上共享存儲進行故障轉(zhuǎn)移上線操作。


WSFC會通過管理共享在復(fù)制集群數(shù)據(jù)庫用到。群集數(shù)據(jù)庫在各節(jié)點C盤和注冊表,當(dāng)一個節(jié)點修改群集信息,會復(fù)制到其他節(jié)點和見證磁盤。


SQL Server AlwaysOn中445端口使用的調(diào)查報告

SQL Server AlwaysOn中445端口使用的調(diào)查報告

一個節(jié)點宕機,其他節(jié)點參照群集數(shù)據(jù)庫,訪問共享磁盤,聯(lián)機上線該節(jié)點承載的應(yīng)用。日常運行時在各節(jié)點同步,確保各節(jié)點記錄一致。


第四部分:關(guān)于Windows Server 2016和SQL Server 2016/2017相關(guān)新功能的學(xué)習(xí)


1. Domain Independent Availability Groups(a new feature introduced in SQL Server 2016)

https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/domain-independent-availability-groups


在Windows Server 2016 + SQL Server 2016環(huán)境下,AlwaysOn AG支持在工作組環(huán)境、或跨域環(huán)境搭建AG。即便搭建無域AG,AG還是需要WSFC的支持,而WSFC需要開通445端口;FCI到目前為止,仍然需要在域環(huán)境下部署。該特性無法消除445端口訪問。


2. Distributed availability groups(a new feature introduced in SQL Server 2016)

https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/distributed-availability-groups


分布式可用性組,可將AlwaysOn AG跨兩個不同的WSFC,來擴展AG。該特性同樣無法消除445端口訪問。


3. Read-scale availability groups(a new feature introduced in SQL Server 2017)

https://docs.microsoft.com/en-us/sql/database-engine/availability-groups/windows/read-scale-availability-groups


在 SQL Server 2016 及更早版本中,所有可用性組都需要群集。 群集用于提供業(yè)務(wù)連續(xù)性,實現(xiàn)高可用性和災(zāi)難恢復(fù) (HADR)。 此外,配置次要副本以執(zhí)行讀取操作。 如果目標(biāo)不是高可用性,配置和運行群集消耗了相當(dāng)大的運營開銷。 SQL Server 2017 引入了不需要群集的讀取縮放可用性組。


如果業(yè)務(wù)要求是轉(zhuǎn)換主要副本上運行的任務(wù)關(guān)鍵型工作負(fù)荷的資源,用戶現(xiàn)在可以使用只讀路由或直接連接到可讀次要副本。 而無需依賴于與任何群集技術(shù)的集成。 Windows 和 Linux 平臺上的 SQL Server 2017 支持這些新功能。


這不是高可用性配置。 不需要監(jiān)視基礎(chǔ)結(jié)構(gòu)、協(xié)調(diào)故障檢測和進行自動故障轉(zhuǎn)移。 如果沒有群集,SQL Server 無法提供自動化高可用性解決方案可提供的低恢復(fù)時間目標(biāo) (RTO)。 如果需要高可用×××,請使用群集管理器(Windows 上的 Windows Server 故障轉(zhuǎn)移群集或 Linux 上的 Pacemaker)。


讀取縮放可用性組可提供災(zāi)難恢復(fù)功能。 當(dāng)只讀副本處于同步提交模式時,可提供恢復(fù)點目標(biāo) (RPO) 0。 要對讀取縮放可用性組進行故障轉(zhuǎn)移,請參閱對讀取縮放可用性組上的主要副本進行故障轉(zhuǎn)移。


總體來說,該特性只有DR功能,不支持HA。該特性適用于只是為了在多個服務(wù)器上部署多個只讀副本,分擔(dān)讀取壓力。


4. SQL Server 2017 Availability Groups on linux

https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-availability-group-overview


在Linux上配置AG基于Pacemaker。


5. SQL Server 2017 Failover Cluster Instance on linux

https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-shared-disk-cluster-concepts


在Linux上配置FCI官方文檔還很簡陋,從共享存儲來看,目前支持iSCSI、NFS和SMB協(xié)議。期待后續(xù)支持光纖協(xié)議,并與AG混合部署。


第五部分:關(guān)于防范蠕蟲病毒的解決方案和建議


分析了下,有如下3個解決方案:

1. 升級相應(yīng)安全補丁

對于重要的安全補丁建議打上,從Secondary到Primary在維護窗口滾動升級。


2. 修改數(shù)據(jù)庫服務(wù)器共享端口

根據(jù)以往經(jīng)驗,可以修改客戶端和服務(wù)器端的445端口,共享能正常運行。但該方案不能阻止對共享的訪問。


3. 將數(shù)據(jù)庫服務(wù)器放入核心隔離區(qū)域

根據(jù)以往經(jīng)驗,電商公司為了通過PCI國際權(quán)威認(rèn)證,在搭建PCI環(huán)境時,會將生產(chǎn)支付和賬號數(shù)據(jù)庫放入該環(huán)境,其實是一個核心隔離區(qū)域,限制訪問該區(qū)域數(shù)據(jù)庫服務(wù)器的IP和端口。


我建議:

1. 打上SMB漏洞的安全補丁。

2. 將數(shù)據(jù)庫服務(wù)器訪問核心隔離區(qū)域。


向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI