MsDeploy远程处理执行清单两次 [英] MsDeploy remoting executing manifest twice

查看:156
本文介绍了MsDeploy远程处理执行清单两次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有:


  1. 为msdeploy创建了一个清单:

    停止,卸载,复制,安装,并启动Windows服务。

  2. 从清单创建一个包

  3. 针对远程服务器对包执行msdeploy。

问题:它执行整个清单两次。尝试:我已经修改了waitInterval和waitAttempts认为它是超时和重新开始,但没有帮助。



问题:可能会执行两次?



清单

 < sitemanifest> 
< runCommand path =net stop TestSvc
waitInterval =240000
waitAttempts =1/>

< runCommand
path =C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe / u
C:\\ \\ msdeploy\TestSvc\TestSvc\bin\Debug\TestSvc.exe
waitInterval =240000
waitAttempts =1/>

< dirPath path =C:\msdeploy\TestSvc\TestSvc\bin\Debug/>

< runCommand
path =C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe
C:\msdeploy \TestSvc\TestSvc\bin\Debug\TestSvc.exe
waitInterval =240000
waitAttempts =1/>

< runCommand path =net start TestSvc
waitInterval =240000
waitAttempts =1/>

< / sitemanifest>

要包装的命令:

 C:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy
-verb:sync
- source:manifest = c:\msdeploy\custom.xml
-dest:package = c:\msdeploy\package.zip

执行命令:

  C:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy
-verb:sync
-source:package = c:\msdeploy\package.zip
-dest:auto,computername =< computerNameHere>

我作为具有管理访问权限的域用户运行。我也尝试传递凭据 - 这不是一个权限问题,命令是成功的,只是执​​行两次。






编辑:



我启用了 -verbose ,并在日志中找到一些有趣的行: / p>

详细说明:执行同步传递#1。



...



详细信息:源filePath(C:\msdeploy\MyTestWindowsService\MyTestWindowsService\bin\Debug\MyTestWindowsService.exe)与目标不匹配(C:\msdeploy\MyTestWindowsService\MyTestWindowsService\\ \\ bin \Debug\MyTestWindowsService.exe)属性不同(lastWriteTime ['11 / 08/2011 23:40:30','11/08/2011 23:39:52'])。更新待定。



详细信息:源filePath(C:\msdeploy\MyTestWindowsService\MyTestWindowsService\bin\Debug\MyTestWindowsService.pdb)与目标不匹配(C:\msdeploy\MyTestWindowsService\MyTestWindowsService\bin\Debug\MyTestWindowsService.pdb)属性不同(lastWriteTime ['11 / 08/2011 23:40:30','11/08/2011 23 :39:52' ])。更新待定。



这些行后,文件不会第一次复制,但第二次复制



...



详细信息:依赖关系检查'DependencyCheckInUse'没有发现任何问题。

详细:收到的回复来自代理(HTTP状态确定)。

详细信息:当前同步传递缺少2个对象的流内容。



详细说明:执行同步传递#2。



...






高级



通常我部署一个新建的包,服务器。



在第二遍期间,它会复制通过一次完成的所有内容。



它将:




  • 停止,卸载,(删除由服务安装创建的一些日志文件),安装和启动Windows服务



通过2,它将:




  • 停止,卸载,通过复制文件,安装和启动Windows服务。



我不知道为什么它不会复制通过1中的文件,或者为什么通过2被触发。 >

如果我重新部署相同的软件包而不是部署新的位,则它将运行通过1中的所有步骤,而不是运行pass 2.可能是因为文件具有相同的时间戳。

解决方案

问题中没有足够的信息真正重现问题给出具体答案...但有几个要检查/更改/尝试使此工作的事情:





编辑 - 添加 -verbose 输出后:



我看到这些可能性:




  • 时间
    两台机器有时间差异(其中一个只是一点点关闭或某个时区问题...)

  • 文件系统
    如果其中一个文件系统是FAT,可能会导致问题(时间戳分辨率...) li>


编辑2 - 根据评论:



在我上次的编辑中,我写了时间戳,因为我的怀疑是这些比较出现问题,例如两台机器之间的时钟差异(即使是30秒的差异也会产生影响)和/或某些时区问题。



我写了关于filesystem esp。 FAT,因为FAT的时间戳分辨率有2秒左右,而NTFS具有更高的分辨率,这可能会影响到比较时间戳...



从你所描述的会建议以下解决方法:





编辑3 - 根据Merlyn Morgan-Graham的评论结果,供将来参考:



使用 runCommand 提供程序时,请使用批处理文件。由于某种原因,这使得它停止运行两遍。



此解决方案的问题是,无法通过 SetParameters.xml 文件(对于 dontUseCommandExe / preSync / postSync SetParameters.xml )。



编辑4 - 根据Merlyn Morgan-Graham的评论:



超时参数适用于是否杀死该特定命令,而不是关闭Windows服务本身...在这种情况下,似乎Windows服务需要相当长的时间才能停止,因此只有 runCommand 在没有复制/同步的情况下执行,并启动了整个运行的新尝试...


I have:

  1. Created a manifest for msdeploy to:
    Stop, Uninstall, Copy over, Install, and Start a Windows service.
  2. Created a package from the manifest
  3. Executed msdeploy against the package against a remote server.

Problem: It executes the entire manifest twice.

Tried: I have tinkered with the waitInterval and waitAttempts thinking it was timing out and starting over, but that hasn't helper.

Question: What might be making it execute twice?

The Manifest:

<sitemanifest>
  <runCommand path="net stop TestSvc"
              waitInterval="240000"
              waitAttempts="1"/>

  <runCommand 
    path="C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe /u
       C:\msdeploy\TestSvc\TestSvc\bin\Debug\TestSvc.exe"
       waitInterval="240000"
       waitAttempts="1"/>

  <dirPath path="C:\msdeploy\TestSvc\TestSvc\bin\Debug" />

  <runCommand 
    path="C:\Windows\Microsoft.NET\Framework\v4.0.30319\installutil.exe
    C:\msdeploy\TestSvc\TestSvc\bin\Debug\TestSvc.exe"
    waitInterval="240000"
    waitAttempts="1"/>

  <runCommand path="net start TestSvc"
    waitInterval="240000"
    waitAttempts="1"/>

</sitemanifest>

The command issued to package it:

"C:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy" 
         -verb:sync 
         -source:manifest=c:\msdeploy\custom.xml 
         -dest:package=c:\msdeploy\package.zip

The command issued to execute it:

"C:\Program Files\IIS\Microsoft Web Deploy V2\msdeploy" 
         -verb:sync 
         -source:package=c:\msdeploy\package.zip 
         -dest:auto,computername=<computerNameHere>

I am running as a domain user who has administrative access on the box. I have also tried passing credentials - it is not a permissions issue, the commands are succeeding, just executing twice.


Edit:

I enabled -verbose and found some interesting lines in the log:

Verbose: Performing synchronization pass #1.

...

Verbose: Source filePath (C:\msdeploy\MyTestWindowsService\MyTestWindowsService\bin\Debug\MyTestWindowsService.exe) does not match destination (C:\msdeploy\MyTestWindowsService\MyTestWindowsService\bin\Debug\MyTestWindowsService.exe) differing in attributes (lastWriteTime['11/08/2011 23:40:30','11/08/2011 23:39:52']). Update pending.

Verbose: Source filePath (C:\msdeploy\MyTestWindowsService\MyTestWindowsService\bin\Debug\MyTestWindowsService.pdb) does not match destination (C:\msdeploy\MyTestWindowsService\MyTestWindowsService\bin\Debug\MyTestWindowsService.pdb) differing in attributes (lastWriteTime['11/08/2011 23:40:30','11/08/2011 23:39:52']). Update pending.

After these lines, files aren't copied the first time, but are copied the second time

...

Verbose: The dependency check 'DependencyCheckInUse' found no issues.
Verbose: Received response from agent (HTTP status 'OK').
Verbose: The current synchronization pass is missing stream content for 2 objects.

Verbose: Performing synchronization pass #2.

...


High Level

Normally I deploy a freshly built package with newer bits than are on the server.

During pass two, it duplicates everything that was done in pass one.

In pass 1, it will:

  • Stop, Uninstall, (delete some log files created by the service install), Install, and Start a Windows service

In pass 2, it will:

  • Stop, Uninstall, Copy files over, Install, and Start a Windows service.

I have no idea why it doesn't copy over the files in pass 1, or why pass 2 is triggered.

If I redeploy the same package instead of deploying fresh bits, it will run all the steps in pass 1, and not run pass 2. Probably because the files have the same time stamp.

解决方案

There is not enough information in the question to really reproduce the problem to give a specific answer... but there are several things to check/change/try to make this work:

EDIT - after the addition of -verboseoutput:

I see these possibilities:

  • Time
    Both machines have a difference in time (either one of them is just a bit off or some timezone issue...)
  • Filesystem
    If one of the filesystems is FAT this could lead to problems (timestamp resolution...)

EDIT 2 - as per comments:

In my last EDIT I wrote about timestamp because my suspicion is that something goes wrong when these are compared... that can be for example differring clocks between both machines (even a difference of 30 sec can have an impact) and/or some timezone issues...

I wrote about filesystem esp. FAT since the timestamp resolution of FAT is someabout 2 seconds while NTFS has much higher resolution, again this could have an impact when comparing timestamps...

From what you describe I would suggest the following workarounds:

EDIT 3 - as per comment from Merlyn Morgan-Graham the result for future reference:

When using the runCommand provider, use batch files. For some reason this made it stop running two passes.

The problem with this solution is that one can't specify the installation directory of the service via a SetParameters.xml file (same for dontUseCommandExe / preSync / postSync regarding SetParameters.xml).

EDIT 4 - as per comment from Merlyn Morgan-Graham:

The timeout params apply to whether to kill that specific command, not to the closing of the Windows Service itself... in this case it seems that the Windows Service takes rather long to stop and thus only the runCommands get executed without the copy/sync and a new try for the whole run is initiated...

这篇关于MsDeploy远程处理执行清单两次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆