README.txt 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. The standalone/deployments directory in the JBoss Application Server
  2. distribution is the location end users can place their deployment content
  3. (e.g. war, ear, jar, sar files) to have it automatically deployed into the server
  4. runtime.
  5. Users, particularly those running production systems, are encouraged to use the
  6. JBoss AS management APIs to upload and deploy deployment content instead of
  7. relying on the deployment scanner subsystem that periodically scans this
  8. directory. See the JBoss AS documentation for details.
  9. DEPLOYMENT MODES
  10. The filesystem deployment scanner in AS 7 and later works differently from
  11. previous JBoss AS releases. The scanner can operate in one of two different
  12. modes, depending on whether it will directly monitor the deployment content
  13. in order to decide to deploy (or redeploy) it.
  14. 1) Auto-deploy mode: The scanner will directly monitor the deployment content,
  15. automatically deploying new content and redeploying content whose timestamp
  16. has changed. This is similiar to the behavior of previous AS releases, although
  17. there are differences:
  18. a) A change in any file in an exploded deployment triggers redeploy. Because
  19. EE 6 applications do not require deployment descriptors, there is no attempt
  20. to monitor deployment descriptors and only redeploy when a deployment
  21. descriptor changes.
  22. b) The scanner will place marker files in this directory as an indication of
  23. the status of its attempts to deploy or undeploy content. These are detailed
  24. below.
  25. 2) Manual deploy mode: The scanner will not attempt to directly monitor the
  26. deployment content and decide if or when the end user wishes the content to
  27. be deployed or undeployed. Instead, the scanner relies on a system of marker
  28. files, with the user's addition or removal of a marker file serving as a sort
  29. of command telling the scanner to deploy, undeploy or redeploy content.
  30. Auto-deploy mode and manual deploy mode can be independently configured for
  31. zipped deployment content and exploded deployment content. This is done
  32. via the "auto-deploy" attributes on the deployment-scanner element in the
  33. standalone.xml configuration file:
  34. <deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir"
  35. path="deployments" auto-deploy-zipped="true" auto-deploy-exploded="false"/>
  36. By default, auto-deploy of zipped content is enabled, and auto-deploy of
  37. exploded content is disabled. Manual deploy mode is strongly recommended for
  38. exploded content, as exploded content is inherently vulnerable to the scanner
  39. trying to auto-deploy partially copied content. Manual deploy mode also allows
  40. deployment resources (e.g. html and css files) to be replaced without
  41. triggering a redeploy of the application.
  42. MARKER FILES
  43. The marker files always have the same name as the deployment content to which
  44. they relate, but with an additional file suffix appended. For example, the
  45. marker file to indicate the example.war file should be deployed is named
  46. example.war.dodeploy. Different marker file suffixes have different meanings.
  47. The relevant marker file types are:
  48. .dodeploy -- Placed by the user to indicate that the given content should
  49. be deployed into the runtime (or redeployed if already
  50. deployed in the runtime.)
  51. .skipdeploy -- Disables auto-deploy of the content for as long as the file
  52. is present. Most useful for allowing updates to exploded
  53. content without having the scanner initiate redeploy in the
  54. middle of the update. Can be used with zipped content as
  55. well, although the scanner will detect in-progress changes
  56. to zipped content and wait until changes are complete.
  57. .isdeploying -- Placed by the deployment scanner service to indicate that it
  58. has noticed a .dodeploy file or new or updated auto-deploy
  59. mode content and is in the process of deploying the content.
  60. This marker file will be deleted when the deployment process
  61. completes.
  62. .deployed -- Placed by the deployment scanner service to indicate that the
  63. given content has been deployed into the runtime. If an end
  64. user deletes this file, the content will be undeployed.
  65. .failed -- Placed by the deployment scanner service to indicate that the
  66. given content failed to deploy into the runtime. The content
  67. of the file will include some information about the cause of
  68. the failure. Note that with auto-deploy mode, removing this
  69. file will make the deployment eligible for deployment again.
  70. .isundeploying -- Placed by the deployment scanner service to indicate that it
  71. has noticed a .deployed file has been deleted and the
  72. content is being undeployed. This marker file will be deleted
  73. when the undeployment process completes.
  74. .undeployed -- Placed by the deployment scanner service to indicate that the
  75. given content has been undeployed from the runtime. If an end
  76. user deletes this file, it has no impact.
  77. .pending -- Placed by the deployment scanner service to indicate that it
  78. has noticed the need to deploy content but has not yet
  79. instructed the server to deploy it. This file is created if
  80. the scanner detects that some auto-deploy content is still in
  81. the process of being copied or if there is some problem that
  82. prevents auto-deployment. The scanner will not instruct the
  83. server to deploy or undeploy any content (not just the
  84. directly affected content) as long as this condition holds.
  85. Basic workflows:
  86. All examples assume variable $AS points to the root of the JBoss AS distribution.
  87. Windows users: the examples below use Unix shell commands; see the "Windows
  88. Notes" below.
  89. A) Add new zipped content and deploy it:
  90. 1. cp target/example.war $AS/standalone/deployments
  91. 2. (Manual mode only) touch $AS/standalone/deployments/example.war.dodeploy
  92. B) Add new unzipped content and deploy it:
  93. 1. cp -r target/example.war/ $AS/standalone/deployments
  94. 2. (Manual mode only) touch $AS/standalone/deployments/example.war.dodeploy
  95. C) Undeploy currently deployed content:
  96. 1. rm $AS/standalone/deployments/example.war.deployed
  97. D) Auto-deploy mode only: Undeploy currently deployed content:
  98. 1. rm $AS/standalone/deployments/example.war
  99. Note that this approach is not recommended with unzipped content as the server
  100. maintains no other copy of unzipped content and deleting it without first
  101. triggering an undeploy temporarily results in a live application with
  102. potentially critical resources no longer available. For unzipped content use
  103. the 'rm $AS/standalone/deployments/example.war.deployed' approach.
  104. E) Replace currently deployed zipped content with a new version and deploy it:
  105. 1. cp target/example.war/ $AS/standalone/deployments
  106. 2. (Manual mode only) touch $AS/standalone/deployments/example.war.dodeploy
  107. F) Manual mode only: Replace currently deployed unzipped content with a new
  108. version and deploy it:
  109. 1. rm $AS/standalone/deployments/example.war.deployed
  110. 2. wait for $AS/standalone/deployments/example.war.undeployed file to appear
  111. 3. cp -r target/example.war/ $AS/standalone/deployments
  112. 4. touch $AS/standalone/deployments/example.war.dodeploy
  113. G) Auto-deploy mode only: Replace currently deployed unzipped content with a
  114. new version and deploy it:
  115. 1. touch $AS/standalone/deployments/example.war.skipdeploy
  116. 2. cp -r target/example.war/ $AS/standalone/deployments
  117. 3. rm $AS/standalone/deployments/example.war.skipdeploy
  118. H) Manual mode only: Live replace portions of currently deployed unzipped
  119. content without redeploying:
  120. 1. cp -r target/example.war/foo.html $AS/standalone/deployments/example.war
  121. I) Auto-deploy mode only: Live replace portions of currently deployed unzipped
  122. content without redeploying:
  123. 1. touch $AS/standalone/deployments/example.war.skipdeploy
  124. 2. cp -r target/example.war/foo.html $AS/standalone/deployments/example.war
  125. J) Manual or auto-deploy mode: Redeploy currently deployed content (i.e. bounce
  126. it with no content change):
  127. 1. touch $AS/standalone/deployments/example.war.dodeploy
  128. K) Auto-deploy mode only: Redeploy currently deployed content (i.e. bounce
  129. it with no content change):
  130. 1. touch $AS/standalone/deployments/example.war
  131. Windows Notes:
  132. The above examples use Unix shell commands. Windows equivalents are:
  133. cp src dest --> xcopy /y src dest
  134. cp -r src dest --> xcopy /e /s /y src dest
  135. rm afile --> del afile
  136. touch afile --> echo>> afile
  137. Note that the behavior of 'touch' and 'echo' are different but the
  138. differences are not relevant to the usages in the examples above.