我試圖與廚師管理的Splunk和跨越的一個問題跑採用廚師以編程方式啓動時/停止/重啓Splunkforwarder服務:的Splunk:「淨停止Splunk的」只適用*有時*
The request did not respond to the start or control request in a timely fashion. - ControlService: The service did not respond to the start or control request in a timely fashion.
一旦廚師運行失敗,我可以用net start splunkforwarder
開始服務。
,我決定嘗試通過重新啓動在PowerShell中手動去(停止/啓動)過程,現在當我嘗試用net stop splunkfowarder
停止服務,我得到一個錯誤:
The service is not responding to the control function.
Somtimes停止服務工作,但很少。在這一點上,我不知道發生了什麼,因爲我不習慣在Windows(或Splunk)上工作,我不確定廚師的錯誤和net stop splunkforwarder
錯誤是否有關。
我也發現如果我直接通過C:\Program Files\SplunkUniversalForwarder\bin\splunk.exe
中的可執行文件與splunk進行交互,那麼一切正常。我可以cd
到那個目錄,並運行./splunk restart
沒有問題。
任何人都知道發生了什麼事情或對下一步的故障排除提供建議?
如果您手動獲取相同的錯誤,這不太可能與廚師有關。去除標籤。 – coderanger
'net stop splunkforwarder'在PowerShell中沒有經過它,這將是'Get-Service'和'Restart-Service' cmdlet。 (並不是說如果Splunk沒有響應服務控制請求,而是有'-Force'參數可用,那麼這些行爲會有所不同。 – TessellatingHeckler
這實際上不是一個編程問題,而是一個關於爲什麼Splunk不響應服務停止命令的問題(向Splunk報告它們 - 它們應該能夠確定哪個線程阻止了進程轉儲,或者一系列過程轉儲)。我有另一個類似的問題服務,我使用powershell腳本來停止服務('stop-service'),然後休眠一下,然後檢查進程是否正在運行。如果進程仍在運行,我使用'stop-process'來殺死它,然後使用'start-service'來重新啓動它。 –