~jorge/juju-core/review-configs-for-bundles

« back to all changes in this revision

Viewing changes to htmldocs/charms-destroy.html

  • Committer: Marco Ceppi
  • Date: 2013-11-15 14:52:34 UTC
  • Revision ID: marco@ceppi.net-20131115145234-gsciz49bz57stch5
Added caveats, cleaned up destroy page

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
        <div class="grid-9 doc-content">
71
71
<!--End-Preamble-->
72
72
          <article>
73
 
            <section id ="destroy-services">
74
 
              <h1>Destroy Stuff</h1>
 
73
            <section>
 
74
              <h1 id="destroying">Removal within Juju</h1>
75
75
              <p>Juju isn't just about magically spinning up services as and when you need them, it is also about quickly, sanely and efficiently destroying everything when you no longer need it. This section deals with the sort of things you can ruthlessly destroy, and how to go about it.</p>
76
 
              <h1>Destroying/Removing Services</h1>
 
76
              <h2 id="destroy-services">Destroying/Removing Services</h2>
77
77
              <p>Once a service is no longer required it can be removed with a simple command.</p>
78
78
              <pre class="prettyprint">juju destroy-service &LT;service-name&GT;</pre>
79
 
              <p class="warning"><strong>Warning!:</strong> Destroying a service which has active relations with another running service will break that relation. This can cause errors in both services, as such review and potentially destroy any relationships first if.</p>
80
 
              <p>A service can take a while to "die", but if running a juju status reveals that the service is listed as dying, but also reports an error state, then the zombied service will still be hanging around.</p>
 
79
              <p class="warning note"><strong>Warning!:</strong> Destroying a service which has active relations with another running service will break that relation. This can cause errors in both services, as such review and potentially remove any relationships first.</p>
 
80
              <p>A service can take a while to "die", but if running a juju status reveals that the service is listed as dying, but also reports an error state, then the zombied service will still be hanging around. See <a href="#caveat-dying">caveats</a> for how to manage services in a dying state.</p>
81
81
              <p class="note"><strong>Note:</strong> Destroying a service removes that service, but not any nodes which may have been created for it to run on. This is juju's way of preserving data to the best it's ability. See <a href="#destroy-machines">Destroying Machines</a> for additional details.</p>
82
82
            </section>
83
83
            <section id="destroy-units">
84
 
              <h1>Destroying Units</h1>
85
 
              <p>It is also possible to spin down individual units, or a sequence of units running a service:</p>
 
84
              <h2 id="destroy-units">Destroying Units</h2>
 
85
              <p>It is also possible to spin down individual units, or a sequence of units running within a service:</p>
86
86
              <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1</pre>
87
87
              <p>The <code>remove-unit</code> command is an alias for <code>destroy-unit</code>, and can be used interchangeably, so the above is identical to:</p>
88
88
              <pre class="prettyprint lang-yaml">juju destroy-unit mediawiki/1</pre> 
89
89
              <p>If you wish to remove more than one unit, you may list them all following the command:</p>
90
90
              <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1 mediawiki/2 mediawiki/3 mysql/2 ...</pre>
91
91
              <p class="note"><strong>Note:</strong> As with destroying a service, removing units will NOT actually remove any instances which were created, it only removes the service units. More details can be found in the <a href="charms-scaling.html">Scaling Services</a> section.</p>
 
92
              <p>As with destroying services, See <a href="#caveat-dying">caveats</a> for how to manage units in a dying state.</p>
92
93
            </section>
93
 
            <section id="destroy-machines">
94
 
              <h1>Destroying machines</h1>
 
94
            <section>
 
95
              <h2 id="destroy-machines">Destroying machines</h2>
95
96
              <p>Instances or machines which have no currently assigned workload can be removed from your cloud using the following command:
96
97
              <pre class="prettyprint">juju destory-machine &LT;number&GT;</pre>
97
98
              <p>A machine which currently idle will be removed almost instantaneously from the cloud, along with anything else which may have been on the instance which juju was not aware of. To prevent accidents and awkward moments with running services, it is not possible to remove an instance which is currently allocated to a service. If you try to do so, you will get a polite error message in the form:</p>
98
99
              <pre class="prettyprint lang-yaml">error: no machines were destroyed: machine 3 has unit "mysql/0" assigned</pre>
99
100
            </section>
100
 
            <section id="destroy-enviornments">
101
 
              <h1>Destroying Environments</h1>
 
101
            <section>
 
102
              <h2 id="destroy-environments">Destroying Environments</h2>
102
103
               <p>To completely remove and terminate all running services, the instances they were running on and the bootstrap node itself, simply run the command:</p>
103
104
               <pre class="prettyprint">juju destroy-environment</pre>
104
105
               <p> This will completely remove all instances running under the current environment profile. You can of course specify a different environment profile using the <code>-e</code> switch, or any one of <a href="config-environments.html">these other</a> methods:</p>
105
106
               <pre class="prettyprint">juju destroy-environment -e mycloud</pre>
106
107
               <p>You should be pretty sure that this is what you want to do, as there is no undo command! Everything in the selected environment will be removed.</p>  
107
108
            </section>
108
 
            <section id="destroy-relations">
109
 
              <h1>Removing Relations</h1>
 
109
            <section>
 
110
              <h2 id="destroy-relations">Removing Relations</h2>
110
111
               <p>To remove relations between deployed services, you should see <a href="charms-relations.html#removing"> the docs section on charm relationships</a>.</p>
111
112
            </section>
 
113
            <section>
 
114
              <h2 id="caveats">Caveats</h2>
 
115
              <p>These are caveats which you may encounter while trying to remove items within Juju<p>
 
116
              <h3 id="caveat-dying">life: dying</h3>
 
117
              <p>If you have a unit or serving in a dying state that has not gone away check to see if that unit, or any units within the service, are in an error state. Since Juju is an event driven orchestration client, the "removal" of a unit and service is also modeled as an event within Juju. As such, when a unit enters an error state all other events within that unit's lifecycle are queued. To clear this run <pre class="prettyprint lang-yaml">juju resolved &lt;unit&gt;</pre> to have the next even processed. You may need to run the <code>resolved</code> command run several times against a unit.</p>
 
118
              <p>If the unit isn't in an error state, there may be an error elsewhere in the environment. Since removing a unit or destroying a service also breaks the relation, if there's an error in the relation-removal event on one or more of the connected services that may also halt the event loop for that unit. Check to make sure no other units are in an error state and clear those using the <code>juju resolved</code> command.</p>
112
119
          </article>
113
120
<!--Postamble-->
114
121
        </div>