1. 程式人生 > 其它 >SQLServer AlwaysON修改可用性組的監聽埠

SQLServer AlwaysON修改可用性組的監聽埠

1.使用圖形工具進行修改

在主節點登入


登入SQL Server Management Studio


---->物件資源管理器(object explorer)


---->AlwaysON高可用性組(always on high availability)


---->可用性組(Availability Groups)


---->可用性組偵聽器(Availability group Listeners)


---->右擊已有的監聽器


---->點選屬性(Properties)


---->編輯port


---->確定(ok)

2.使用命令修改

(1).修改埠

alter endpoint [<endpoint name>]
state = started
as tcp (listener_port = 1233, listener_ip = (10.x.x.x))
for data_mirroring (role = all, authentication = windows negotiate, encryption = required algorithm aes)
go

簡單點可以這樣:

alter endpoint [<endpoint name>]
state = started
as tcp (listener_port = 1233)
go

(2).修改複製URL

alter availability group [<ag name>]
modify replica on 'mynode1' with (endpoint_url = 'tcp://mynode1.mydomain.com:1233')
go

  

3.啟停

master庫:
啟動埠:

use [master]
ALTER ENDPOINT [MyEndpoint] STATE = STARTED;

  

停止埠:

use [master]
ALTER ENDPOINT [MyEndpoint] STATE = STOPPED;