Add-SBHost:系统找不到指定的文件

时间:2018-11-16 19:19:02

标签: powershell azureservicebus servicebus

我试图将主机添加到新创建的Windows Service Bus 1.1服务器场中,但是无论我做什么,我都会永远收到以下错误:

VERBOSE: [11/16/2018 2:54:06 PM]: Validating input and configuration parameters.
VERBOSE: [11/16/2018 2:54:06 PM]: Installing auto-generated certificate.
VERBOSE: [11/16/2018 2:54:16 PM]: Granting 'Log on as Service' privilege to the run as account.
VERBOSE: [11/16/2018 2:54:16 PM]: Windows Fabric configuration started.
VERBOSE: [11/16/2018 2:54:28 PM]: Windows Fabric cluster manifest generated.
VERBOSE: [11/16/2018 2:54:28 PM]: Running Windows Fabric deployment.
Add-SBHost : The system cannot find the file specified
At line:1 char:1
+ Add-SBHost -SBFarmDBConnectionString "Data Source=MYHOST;Initial C ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Add-SBHost], Win32Exception
    + FullyQualifiedErrorId : System.ComponentModel.Win32Exception,Microsoft.ServiceBus.Commands.AddSBHost

由于组织使用Azure AD,我一直在努力配置服务器场的初始部署。我遵循this very helpful Blog post来完成安装和部署,但是现在所遇到的问题没有解决。

这个问题的Google带领我进入this page,他们谈论检查DLL。我尝试从Service Bus安装文件夹中检查Microsoft.ServiceBus.Commands.dll,但是老实说,我对所要查找的内容还不了解。

之前有没有其他人遇到过这个问题?非常感谢能找到我的所有建议!

1 个答案:

答案 0 :(得分:0)

根据我对 Add-SBHost 命令中实际发生的情况的研究,可能在以下情况下发生此错误:

  1. 代码正在尝试在%userprofile%\AppData\Local\Temp目录中为名为“ ClusterManifest”的文件创建新的临时文件。
  2. 代码正在尝试在注册表路径:FabricDeployer.exe中为文件夹{{1中的变量HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Service Bus\1.1定义的目录中执行WinFabric(以创建的“ ClusterManifest”文件路径作为参数) }}。就我而言,可执行文件已放置在bin\Fabric\Fabric.Code.1.0
  3. 代码正在尝试从C:\Program Files\Windows Fabric\bin\Fabric\Fabric.Code.1.0\FabricDeployer.exe删除临时文件(创建1个点)

在执行此步骤并收到消息%userprofile%\AppData\Local\Temp之后,将不再执行文件操作。

该怎么办?

  1. 首先检查是否在VERBOSE: [09.08.2019 13:32:26]: Windows Fabric starting.目录中创建了临时文件(按资源管理器中的修改日期排序文件,运行脚本并等待)-可能由于权限不足而无法创建文件。
  2. 如果文件创建正确并且内部包含XML,请检查是否安装了Service Fabric,并且目录中存在%userprofile%\AppData\Local\Temp。就我而言,它不存在,因此我不得不删除Windows Fabric和Service Bus。下次安装后,我确保所有文件都到位。

完成这些步骤后,脚本运行成功。

我希望它会对您有所帮助:)