2016-04-20 81 views
1

我正在玩DSC來管理2個節點,我已經能夠設置我的拉服務器,但現在問題是從拉服務器不能正常工作的推/拉配置。DSC配置錯誤

我試着解決問題,我可以看到GetAction請求的響應中的錯誤,但我不知道它是什麼意思。

http://server1:8080/PSDSCPullServer.svc/Action(ConfigurationId='8394f90e-0525-4d0d-aa75-653b64981fc4')/GetAction

{ 
    "odata.error": { 
    "code": "", 
    "message": { 
     "lang": "en-US", 
     "value": "nodeComplianceStatus or mofChecksum not found for MSFT.PSDSCAction." 
    }, 
    "innererror": { 
     "message": "nodeComplianceStatus or mofChecksum not found for MSFT.PSDSCAction.", 
     "type": "System.ArgumentException", 
     "stacktrace": "" 
    }, 
    "MODATA.Exception.ErrorRecord": { 
     "odata.type": "MODATA.Exception.DataServiceException", 
     "ErrorCode": "", 
     "MessageLanguage": "en-US", 
     "StatusCode": 400, 
     "Message": "nodeComplianceStatus or mofChecksum not found for MSFT.PSDSCAction.", 
     "Data": [], 
     "InnerException": { 
     "Message": "nodeComplianceStatus or mofChecksum not found for MSFT.PSDSCAction.", 
     "Data": [], 
     "InnerException": null, 
     "TargetSite": null, 
     "StackTrace": null, 
     "HelpLink": null, 
     "Source": null, 
     "HResult": -2147024809 
     }, 
     "TargetSite": null, 
     "StackTrace": " at Microsoft.Management.Odata.Core.OperationManagerAdapter.InvokeMethod(IInvoker invoker, String functionName, String resourceTypeName, Boolean ignoreNotImplementedException)\r\n at Microsoft.Management.Odata.Core.OperationManagerAdapter.InvokeOperationManagerFunction[T](Func`1 func, String functionName, String resourceTypeName, Boolean ignoreNotImplementedException, T defaultResultForNotImplementedException)\r\n at Microsoft.Management.Odata.Core.OperationManagerAdapter.InvokeAction(ResourceType resourceType, IEnumerable`1 resourceKeys, String actionName, IEnumerable`1 inputParameters, ResourceType returnType)\r\n at Microsoft.Management.Odata.Core.DataServiceInvokable.InvokeActionOnAst(RequestAstNode root)\r\n at Microsoft.Management.Odata.Core.DataServiceInvokable.Invoke()\r\n at Microsoft.Management.Odata.Core.DataServiceUpdateProvider.SaveChanges()\r\n at System.Data.Services.DataService`1.HandleNonBatchRequest(RequestDescription description)\r\n at System.Data.Services.DataService`1.HandleRequest()", 
     "HelpLink": null, 
     "Source": "Microsoft.Management.OData", 
     "HResult": -2146233079 
    } 
    } 
} 

任何想法有什麼不對?

回答

0

將配置放在拉服務器上時,必須包含從配置生成的校驗和文件。你可以用the New-DscChecksum cmdlet來產生這個結果。

+0

我這樣做,我能夠啓動一個配置,雖然它工作'開始-DscConfiguration -Computer server1 -Path。\ DashboardWebsite -Verbose' –

+0

@AdetiloyePhilipKehinde你的錯誤信息是明確指出它找不到校驗和文件。每個配置有兩個文件?除了'.checksum'命名相同?請注意,推送配置不需要校驗和文件,所以'Start-DscConfiguration'不會因缺少校驗和而失敗。 – briantist

+0

是的,我在我的配置目錄'\\ server1 \ c $ \ program中有兩個文件'8394f90e-0525-4d0d-aa75-653b64981fc4.mof'和'8394f90e-0525-4d0d-aa75-653b64981fc4.mof.checksum' files \ windowspowershell \ dscservice \ configuration' –

0

從錯誤中可以看出,呼叫未到達DSC拉取服務終點,並且由於請求正文中缺少OData服務而被拒絕。您可以使用Invoke-WebRequest來嘗試請求進行故障排除。

$bodyArgs = @{Checksum="somechecksum"; ChecksumAlgorithm="SHA 256";NodeCompliant="false"} 
$jsonBodyArgs = $bodyArgs|ConvertTo-Json 

Invoke-WebRequest -Uri "http://server1:8080/PSDSCPullServer.svc/Action(ConfigurationId='8394f90e-0525-4d0d-aa75-653b64981fc4')/GetAction" 
-UseBasicParsing -Method Post -Body $jsonBodyArgs -Headers @{Accept="application/json"} -ContentType "application/json;odata=minimalmetadata;charset=utf-8" 

拉服務器日誌將包含有關向節點報告故障的信息。日誌可以使用:

Get-WinEvent -LogName 
"Microsoft-Windows-Powershell-DesiredStateConfiguration-PullServer/Operational" 

Get-WinEvent -LogName 
"Microsoft-Windows-ManagementOdataService/Operational" 

這些日誌通常包含足夠的信息來解決潛在的問題。

0

嘗試檢查您的pullserver實際上是否指向proram文件\ windowspowershell而不是程序文件(x86)\ windowspowershell。 這可能是問題。 DSC錯誤消息並不總是很有幫助。
查看您的pullservers webconfig文件以查看pullserver嘗試爲客戶端提取其配置的位置。