在測試饋贈促銷工作臺根據(jù)小票流水返券的時候,點擊饋贈確定之后,再點擊審核的時候,報錯,錯誤大致內(nèi)容為
【
鏈接服務(wù)器card_srv的OLE DB 訪問接口‘SQLNCLI無法啟動分布式事務(wù),
鏈接服務(wù)器card_srv的OLE DB 訪問接口‘SQLNCLI返回了消息'該事務(wù)管理器已經(jīng)禁止了它對遠程/網(wǎng)絡(luò)事務(wù)的支持。'
】
經(jīng)過在網(wǎng)上查詢相關(guān)解決辦法及同事們的幫助,終于將問題得以解決,解決方法在網(wǎng)上基本上都可以找到,但是都不是很全面,
現(xiàn)將解決辦法匯總整理下,方便大家遇到類似的情況時進行配置
1、檢查相關(guān)的服務(wù)器上是否有安裝msdtc服務(wù),我這邊是門店服務(wù)器和卡中心的服務(wù)器, 如果沒有安裝的話,進行如下安裝
①. 單擊“開始”,指向“控制面板”,然后單擊“添加/刪除程序”。
②. 單擊“添加/刪除 Windows 組件”。
③. 選擇“應(yīng)用程序服務(wù)器”,然后單擊“詳細信息”。
④. 選擇“啟用網(wǎng)絡(luò) DTC 訪問”,然后單擊“確定”。
⑤. 單擊“下一步”。
⑥. 單擊“完成”。
⑦. 停止分布式事務(wù)協(xié)調(diào)器服務(wù),然后重新予以啟動。
⑧. 停止參與分布式事務(wù)的任何資源管理器服務(wù)(如 Microsoft SQL Server 或 Microsoft Message Queue Server),然后重新予以啟動。
2、如果機器上已經(jīng)安裝msdtc服務(wù),檢查MSDTC設(shè)置是否正確.
①.打開命令提示,運行"net stop msdtc",然后運行"net start msdtc"。
②.轉(zhuǎn)至"控制面板-組件服務(wù)管理工具"。
③.瀏覽至"啟動管理工具"。
④.選擇"組件服務(wù)"。
a.展開"組件服務(wù)"樹,然后展開"我的電腦"。
b.右鍵單擊"我的電腦",然后選擇"屬性"。
c.在 MSDTC 選項卡中,確保選中了下列選項(都要打勾):
選中“網(wǎng)絡(luò)DTC訪問” 網(wǎng)絡(luò)管理 網(wǎng)絡(luò)事務(wù) XA 事務(wù)
在客戶端管理中選中“允許遠程客戶端”“允許遠程管理”
在事務(wù)管理通訊中選“允許入站”“允許出站”“不要求進行驗證”
d.另外,"DTC 登錄帳戶"一定要設(shè)置為"NT Authority/NetworkService"。
⑤.單擊"確定"。這樣將會提示您"MS DTC 將會停止并重新啟動。 所有的依賴服務(wù)將被停止。請按'是'繼續(xù)"。單擊"是"繼續(xù)。
⑥.單擊"確定"關(guān)閉"我的電腦"屬性窗口。
3、禁用SQL Server 的DTC RPC安全,具體為在HKEY_LOCAL_MACHINE/Software/Microsoft/MSDTC下新建一個DWord鍵,名稱為TurnOffRpcSecurity,設(shè)置其值為1 ,如果有的話,檢查確認其值是否為1
4、通過查找,在C:找到名為“hosts”的文件(沒有擴展名),
通常路徑為C:\WINDOWS\system32\drivers\etc,將對方服務(wù)器的IP和計算機對應(yīng)起來,參考如下(我這邊是門店服務(wù)器和卡中心服務(wù)器):
分店的hosts文件為--指向卡中心的服務(wù)器地址:
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
192.168.0.17 cardmis
卡中心服務(wù)器的hosts文件配置為:--指向分店的服務(wù)器地址
# Copyright (c) 1993-1999 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 localhost
192.168.2.109 leader
192.168.1.103 server2003
192.168.8.109 GHLS-SRV
192.168.5.109 lyenjoy
192.168.7.109 misserver
192.168.10.109 zslserver
5、可以下載Dtcping.exe工具進行監(jiān)測是否兩個服務(wù)器之間的Dtc服務(wù)是否暢通
Dtcping.exe 程序包中包含以下文本文件描述如何使用 DTCPing 工具:
①請參閱有關(guān)如何測試 RPC 通信和兩臺計算機之間的 MS DTC 通信的信息的 Readme.txt 文件。
②請參閱 HowtoAnalyze_Dtcping_Output.txt 文件如何獲得 RPC 端口信息、 CID注冊表項信息和其他 MS DTC 相關(guān)的信息有關(guān)的信息。
上面4條如果全部配置沒有問題的話,用Dtcping.exe工具檢測是沒有問題的