Merge lp:~marcoceppi/juju-core/prettyprint-code-formatting-fixes into lp:juju-core/docs
- prettyprint-code-formatting-fixes
- Merge into docs
Proposed by
Marco Ceppi
Status: | Merged |
---|---|
Approved by: | Nick Veitch |
Approved revision: | no longer in the source branch. |
Merged at revision: | 88 |
Proposed branch: | lp:~marcoceppi/juju-core/prettyprint-code-formatting-fixes |
Merge into: | lp:juju-core/docs |
Prerequisite: | lp:~marcoceppi/juju-core/lang-yaml-pretty-print-fixes-for-nick-lessthan-3 |
Diff against target: |
1643 lines (+458/-516) 18 files modified
htmldocs/charms-constraints.html (+39/-44) htmldocs/charms-deploying.html (+1/-1) htmldocs/charms-destroy.html (+29/-30) htmldocs/charms-exposing.html (+37/-26) htmldocs/charms-relations.html (+62/-66) htmldocs/charms-scaling.html (+12/-10) htmldocs/charms-service-groups.html (+11/-32) htmldocs/charms-upgrading.html (+12/-5) htmldocs/charms.html (+1/-8) htmldocs/commands.html (+43/-41) htmldocs/config-hpcloud.html (+32/-37) htmldocs/config-maas.html (+17/-13) htmldocs/config-openstack.html (+29/-28) htmldocs/css/main.css (+5/-0) htmldocs/getting-started.html (+66/-69) htmldocs/glossary.html (+12/-13) htmldocs/howto-node.html (+49/-91) htmldocs/reference-constraints.html (+1/-2) |
To merge this branch: | bzr merge lp:~marcoceppi/juju-core/prettyprint-code-formatting-fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
charmers | Pending | ||
Review via email:
|
This proposal supersedes a proposal from 2013-08-31.
Commit message
Description of the change
Formatting fixes for code blocks on a few pages
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'htmldocs/charms-constraints.html' |
2 | --- htmldocs/charms-constraints.html 2013-08-30 17:22:50 +0000 |
3 | +++ htmldocs/charms-constraints.html 2013-08-31 16:07:56 +0000 |
4 | @@ -53,101 +53,95 @@ |
5 | |
6 | <section id="content" class="container-12"> |
7 | <div class="grid-12 doc-container"> |
8 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
9 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
10 | <div class="grid-9 doc-content"> |
11 | <article> |
12 | <section id ="charms-constraints"> |
13 | <h1>Machine Constraints</h1> |
14 | <p>Machine constraints allow you to pick the hardware to which your services will be deployed.</p> |
15 | <p>Constraints can be set for environments and services, with lookups for each key falling back from more specific to more general settings, and with default values set by juju when otherwise unspecified. Changes to constraints do not affect any unit that has already been assigned to a machine.</p> |
16 | - <p>Constraints will be controlled with a new command, <span class="pre">juju set-constraints</span>, taking an optional <span class="pre">--service</span> arg, and any number of <span class="pre">key=value</span> pairs. When the service name is specified, the constraints are set on that service; otherwise they are set on the environment.</p> |
17 | - <p>Valid choices for the <span class="pre">value</span> are generally dependent on the particular constraint, with two exceptions:</p> |
18 | + <p>Constraints will be controlled with a new command, <code>juju set-constraints</code>, taking an optional <code>--service</code> arg, and any number of <code>key=value</code> pairs. When the service name is specified, the constraints are set on that service; otherwise they are set on the environment.</p> |
19 | + <p>Valid choices for the <code>value</code> are generally dependent on the particular constraint, with two exceptions:</p> |
20 | |
21 | <ul> |
22 | - <li>An empty value always means "use the juju default setting". This allows you to ignore environment settings at the service level without having to explicitly remember and re-set the juju default values. Note that there is no way to change the juju default values.</li> |
23 | - <li>A value of <span class="pre">any</span> explicitly unsets a constraint, and will cause it to be chosen completely arbitrarily.</li> |
24 | + <li>An empty value always means "use the juju default setting". This allows you to ignore environment settings at the service level without having to explicitly remember and re-set the juju default values. Note that there is no way to change the juju default values.</li> |
25 | + <li>A value of <code>any</code> explicitly unsets a constraint, and will cause it to be chosen completely arbitrarily.</li> |
26 | </ul> |
27 | |
28 | - <p>We also extend the syntax for <span class="pre">juju deploy</span>, and <span class="pre">juju bootstrap</span>, such that <span class="pre">--constraints</span> expects a single string of space-separated constraints, understood as above; deployment constraints will be set on the service before the first unit is deployed, and bootstrap constraints will be set on the environment and used to provision the initial master machine.</p> |
29 | - <p>Please note that there are no changes to the <span class="pre">juju add-unit</span> command; juju is explicitly focused on <strong>service</strong> orchestration, and it is counterproductive to encourage users to consider individual units. This can be worked around by setting new service constraints before adding new units, but is not encouraged.</p> |
30 | - <p>The new <span class="pre">juju get-constraints</span> command is used to see the currently applicable constraints. When called without arguments, it outputs the environment constraints as a single yaml-formatted dict; alternatively, it can be called with any number of arguments referencing any mix of services, service units, or machines, and will output a yaml-formatted dict of dicts with the outer dict keyed on the requested entities.</p> |
31 | - |
32 | - <h1>Examples</h1> |
33 | - |
34 | + <p>We also extend the syntax for <code>juju deploy</code>, and <code>juju bootstrap</code>, such that <code>--constraints</code> expects a single string of space-separated constraints, understood as above; deployment constraints will be set on the service before the first unit is deployed, and bootstrap constraints will be set on the environment and used to provision the initial master machine.</p> |
35 | + <p>Please note that there are no changes to the <code>juju add-unit</code> command; juju is explicitly focused on <strong>service</strong> orchestration, and it is counterproductive to encourage users to consider individual units. This can be worked around by setting new service constraints before adding new units, but is not encouraged.</p> |
36 | + <p>The new <code>juju get-constraints</code> command is used to see the currently applicable constraints. When called without arguments, it outputs the environment constraints as a single yaml-formatted dict; alternatively, it can be called with any number of arguments referencing any mix of services, service units, or machines, and will output a yaml-formatted dict of dicts with the outer dict keyed on the requested entities.</p> |
37 | + <h2>Examples</h2> |
38 | <p>Deploy MySQL on a machine with at least 32GiB of RAM, and at least 8 ECU of CPU power (architecture will be inherited from the environment, or default to amd64):</p> |
39 | - <pre><code>juju deploy --constraints "cpu-cores=8 mem=32G" mysql</code></pre> |
40 | + <pre class="prettyprint">juju deploy --constraints "cpu-cores=8 mem=32G" mysql</pre> |
41 | |
42 | <p>Deploy to t1.micros on AWS:</p> |
43 | - <pre><code>juju bootstrap --constraints "cpu-power=0 cpu-power=0 mem=512M"</code></pre> |
44 | + <pre class="prettyprint">juju bootstrap --constraints "cpu-power=0 cpu-power=0 mem=512M"</pre> |
45 | |
46 | <p>Launch all future "mysql" machines with at least 8GiB of RAM and 4 ECU:</p> |
47 | - <pre><code>juju set-constraints --service mysql mem=8G cpu-cores=4</code></pre> |
48 | + <pre class="prettyprint">juju set-constraints --service mysql mem=8G cpu-cores=4</pre> |
49 | |
50 | <p>Output current environment constraints:</p> |
51 | - <pre><code>juju get-constraints</code></pre> |
52 | + <pre class="prettyprint">juju get-constraints</pre> |
53 | |
54 | <p>Output constraints for machine 3, service "mysql", and service unit "wordpress/7":</p> |
55 | - <pre><code>juju get-constraints 3 mysql wordpress/7</code></pre> |
56 | - |
57 | + <pre class="prettyprint">juju get-constraints 3 mysql wordpress/7</pre> |
58 | + </section> |
59 | + <section id="provider-constraints"> |
60 | <h1>Provider Constraints</h1> |
61 | - |
62 | - <p>See a <a href="reference-constraints.html">complete listing of constraints</a> for details on what each constraint means. Two of the most commonly used are:</p> |
63 | - |
64 | + <p>See a <a href="reference-constraints.html">complete listing of constraints</a> for details on what each constraint means. Two of the most commonly used are:</p> |
65 | <ul> |
66 | - <li><span class="pre">cpu-cores</span>: The minimum processing power of the machine, roughly indicated by how many cores are available.</li> |
67 | - <li><span class="pre">mem</span>: The minimum memory for the machine, defaulting to 512MB.</li> |
68 | - |
69 | - <p class="note"><strong> Note: </strong> The <span class="pre">instance-type</span> constraint is not currently supported by juju-core, but support will be added soon. Some of the following examples make use of this setting merely to illustrate a point. </p> |
70 | - |
71 | - |
72 | + <li><code>cpu-cores</code>: The minimum processing power of the machine, roughly indicated by how many cores are available.</li> |
73 | + <li><code>mem</code>: The minimum memory for the machine, defaulting to 512MB.</li> |
74 | + </ul> |
75 | + <p class="note"><strong> Note: </strong> The <code>instance-type</code> constraint is not currently supported by juju-core, but support will be added soon. Some of the following examples make use of this setting merely to illustrate a point. </p> |
76 | + </section> |
77 | + <section id="examples-constraints"> |
78 | <h1>Working with constraints</h1> |
79 | <p>Here are some examples of working with constraints.</p> |
80 | <p>When bootstrapping an environment, you can set the constraints directly:</p> |
81 | - <pre><code>juju bootstrap --constraints arch=i386</code></pre> |
82 | + <pre class="prettyprint">juju bootstrap --constraints arch=i386</pre> |
83 | |
84 | <p>The above command did two things:</p> |
85 | |
86 | <ul> |
87 | <li><p class="first">Set the environment constraints to require machines with an i386 architecture, leaving the other defaults untouched; this is precisely equivalent to:</p> |
88 | - |
89 | - <pre><code>juju bootstrap --constraints "arch=i386 cpu-cores= mem= "</code></pre> |
90 | - |
91 | + <pre class="prettyprint">juju bootstrap --constraints "arch=i386 cpu-cores= mem= "</pre> |
92 | <p>...but rather more convenient to type.</p> |
93 | </li> |
94 | <li><p class="first">Started the bootstrap/master machine with the above constraints.</p> |
95 | </li> |
96 | </ul> |
97 | - |
98 | <p>Because the environment constraints were set, subsequent deployments will use the same values:</p> |
99 | - <pre><code>juju deploy mysql</code></pre> |
100 | + <pre class="prettyprint">juju deploy mysql</pre> |
101 | |
102 | <p>...but other services can be started with their own constraints:</p> |
103 | - <pre><code>juju deploy wordpress --constraints mem=1024</code></pre> |
104 | + <pre class="prettyprint">juju deploy wordpress --constraints mem=1024</pre> |
105 | |
106 | - <p>Note that the <span class="pre">arch=i386</span> constraint is still inherited from the environment, and that this presents a potential problem:</p> |
107 | - <pre><code>juju deploy minecraft --constraints instance-type=cc2.8xlarge</code></pre> |
108 | + <p>Note that the <code>arch=i386</code> constraint is still inherited from the environment, and that this presents a potential problem:</p> |
109 | + <pre class="prettyprint lang-yaml">juju deploy minecraft --constraints instance-type=cc2.8xlarge</pre> |
110 | |
111 | <p>The above command will still inherit the environment constraints, and will lead to an undeployable service (because cc2.8xlarge cannot run on i386). Running juju debug-log will expose the problem; you can fix it as follows:</p> |
112 | |
113 | - <pre><code> |
114 | - juju remove-unit minecraft/0 |
115 | - juju terminate-machine 1 |
116 | - juju set-constraints --service minecraft arch=amd64 instance-type=cc2.8xlarge |
117 | - juju add-unit minecraft |
118 | - </code></pre> |
119 | +<pre class="prettyprint lang-yaml"> |
120 | +juju remove-unit minecraft/0 |
121 | +juju terminate-machine 1 |
122 | +juju set-constraints --service minecraft arch=amd64 instance-type=cc2.8xlarge |
123 | +juju add-unit minecraft |
124 | +</pre> |
125 | |
126 | <p>(You need to remove machine 1's assigned unit before you can terminate it; you need to explicitly terminate the machine to stop the provisioning agent from continuing to attempt to launch it; and you need to set the new service constraints before adding a new unit that will use those constraints.)</p> |
127 | |
128 | - <p>Work on the constraints feature is ongoing, and it will shortly become impossible to specify knowably inconsistent constraints; but it is in general impossible to detect undeployable constraints with absolute certainty (for example, you could deploy with <span class="pre">ec2-zone=a</span> and be running perfectly happily, but see us-east-1a suddenly go down just as you add a unit).</p> |
129 | + <p>Work on the constraints feature is ongoing, and it will shortly become impossible to specify knowably inconsistent constraints; but it is in general impossible to detect undeployable constraints with absolute certainty (for example, you could deploy with <code>ec2-zone=a</code> and be running perfectly happily, but see us-east-1a suddenly go down just as you add a unit).</p> |
130 | |
131 | <h1>Distinctions Between Entities</h1> |
132 | - <p>As noted, it is impossible to directly set constraints on machines or service units; however, it is still possible to call <span class="pre">juju get-constraints</span> on those entities. In either case, the constraints are a snapshot of the applicable constraints at entity creation time; so the unit constraints are the combined environment/service constraints from the time at which the unit was created, and the machine constraints are a copy of the unit constraints at that same point in time.</p> |
133 | + <p>As noted, it is impossible to directly set constraints on machines or service units; however, it is still possible to call <code>juju get-constraints</code> on those entities. In either case, the constraints are a snapshot of the applicable constraints at entity creation time; so the unit constraints are the combined environment/service constraints from the time at which the unit was created, and the machine constraints are a copy of the unit constraints at that same point in time.</p> |
134 | |
135 | <p>Storing this data allows us to automatically reprovision unexpectedly dead machines (for example, if you terminate machine 7 via the AWS management console, the provisioning agent will spin up a new instance with the same constraints and redeploy the assigned units); and making the data available via the CLI gives you visibility into the state of your deployment, and allows you to answer questions like "why is this unit running on that machine?".</p> |
136 | |
137 | <h1>Legacy Deployments</h1> |
138 | <p>Attempting to use constraints against a deployment that predates their inclusion in juju will not work, because the running legacy code (specifically, the provisioning agent) will not be able to interpret them. Therefore, attempts to specify constraints against legacy deployments will generate errors to inform users of their invalidity; at the agent level they are simply ignored.</p> |
139 | - <p>All commands valid before the client upgrade should continue to work as before, as will the EC2 <span class="pre">default-image-id</span> and <span class="pre">default-instance-type</span> environment settings.</p> |
140 | + <p>All commands valid before the client upgrade should continue to work as before, as will the EC2 <code>default-image-id</code> and <code>default-instance-type</code> environment settings.</p> |
141 | </article> |
142 | </div> |
143 | </div> |
144 | @@ -205,6 +199,7 @@ |
145 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
146 | </div> |
147 | </div> |
148 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
149 | </footer> |
150 | |
151 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
152 | |
153 | === modified file 'htmldocs/charms-deploying.html' |
154 | --- htmldocs/charms-deploying.html 2013-08-30 19:00:47 +0000 |
155 | +++ htmldocs/charms-deploying.html 2013-08-31 16:07:56 +0000 |
156 | @@ -262,7 +262,7 @@ |
157 | rabbitmq-server service:</p> |
158 | <pre class="prettyprint">juju status</pre> |
159 | <p>Which results in the following</p> |
160 | - <pre class="prettyprint"> |
161 | + <pre class="prettyprint lang-yaml"> |
162 | machines: |
163 | "0": |
164 | agent-state: started |
165 | |
166 | === modified file 'htmldocs/charms-destroy.html' |
167 | --- htmldocs/charms-destroy.html 2013-08-22 13:55:23 +0000 |
168 | +++ htmldocs/charms-destroy.html 2013-08-31 16:07:56 +0000 |
169 | @@ -56,47 +56,45 @@ |
170 | <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
171 | <div class="grid-9 doc-content"> |
172 | <article> |
173 | - <section id ="charms-destroy"> |
174 | - |
175 | + <section id ="destroy-services"> |
176 | <h1>Destroy Stuff</h1> |
177 | - <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> |
178 | - |
179 | + <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> |
180 | <h1>Destroying/Removing Services</h1> |
181 | <p>Once a service is no longer required it can be removed with a simple command.</p> |
182 | - <pre><code>juju destroy-service <service-name></code></pre> |
183 | - <p>Before you take this step though, it is important to remove any relationships so that it can be removed cleanly, otherwise an error state may exist elsewhere.</p> |
184 | + <pre class="prettyprint">juju destroy-service <service-name></pre> |
185 | + <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> |
186 | <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="troubleshooting.html#die">"Why won't it just die?" in the troubleshooting section.</a> |
187 | - |
188 | - <p class="warning"><strong>Warning!:</strong>Destroying a service which has active relations with another running service can cause errors in both services. You should destroy any relationships first if possible. </p> |
189 | - |
190 | - <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.</p> |
191 | - |
192 | - <h1>Destroying/Removing Units</h1> |
193 | + <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> |
194 | + </section> |
195 | + <section id="destroy-units"> |
196 | + <h1>Destroying Units</h1> |
197 | <p>It is also possible to spin down individual units, or a sequence of units running a service:</p> |
198 | - <pre><code>juju remove-unit mediawiki/1</code></pre> |
199 | - <p>The 'remove-unit' command is an alias for 'destroy-unit', and can be used interchangeably, so the above is identical to:</p> |
200 | - <pre><code>juju destroy-unit mediawiki/1</code></pre> |
201 | + <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1</pre> |
202 | + <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> |
203 | + <pre class="prettyprint lang-yaml">juju destroy-unit mediawiki/1</pre> |
204 | <p>If you wish to remove more than one unit, you may list them all following the command:</p> |
205 | - <pre><code>juju remove-unit mediawiki/1 mediawiki/2 mediawiki/3 mysql/2 ...</code></pre> |
206 | - <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 unitsm.</p> |
207 | - |
208 | - <h1>Destroying/Removing machines</h1> |
209 | + <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1 mediawiki/2 mediawiki/3 mysql/2 ...</pre> |
210 | + <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> |
211 | + </section> |
212 | + <section id="destroy-machines"> |
213 | + <h1>Destroying machines</h1> |
214 | <p>Instances or machines which have no currently assigned workload can be removed from your cloud using the following command: |
215 | - <pre><code>juju destory-machine <number></code></pre> |
216 | + <pre class="prettyprint">juju destory-machine <number></pre> |
217 | <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> |
218 | - <pre><code>error: no machines were destroyed: machine 3 has unit "mysql/0" assigned</code></pre> |
219 | - |
220 | + <pre class="prettyprint lang-yaml">error: no machines were destroyed: machine 3 has unit "mysql/0" assigned</pre> |
221 | + </section> |
222 | + <section id="destroy-enviornments"> |
223 | <h1>Destroying Environments</h1> |
224 | <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> |
225 | - <pre><code>juju destroy-environment </code></pre> |
226 | - <p> This will completely remove all instances running under the current environment profile. You can of course specify a different environment profile using the -e switch:</p> |
227 | - <pre><code>juju destroy-environment -e mycloud </code></pre> |
228 | + <pre class="prettyprint">juju destroy-environment</pre> |
229 | + <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> |
230 | + <pre class="prettyprint">juju destroy-environment -e mycloud</pre> |
231 | <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> |
232 | - |
233 | - <h1>Destroying Relations</h1> |
234 | - <p>To remove relations between deployed services, you should see <a href="charms-relations.html#removing"> the docs section on charm relationships</a></p>. |
235 | - </section> |
236 | - |
237 | + </section> |
238 | + <section id="destroy-relations"> |
239 | + <h1>Removing Relations</h1> |
240 | + <p>To remove relations between deployed services, you should see <a href="charms-relations.html#removing"> the docs section on charm relationships</a>.</p> |
241 | + </section> |
242 | </article> |
243 | </div> |
244 | </div> |
245 | @@ -154,6 +152,7 @@ |
246 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
247 | </div> |
248 | </div> |
249 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
250 | </footer> |
251 | |
252 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
253 | |
254 | === modified file 'htmldocs/charms-exposing.html' |
255 | --- htmldocs/charms-exposing.html 2013-08-22 13:55:23 +0000 |
256 | +++ htmldocs/charms-exposing.html 2013-08-31 16:07:56 +0000 |
257 | @@ -53,41 +53,51 @@ |
258 | |
259 | <section id="content" class="container-12"> |
260 | <div class="grid-12 doc-container"> |
261 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
262 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
263 | <div class="grid-9 doc-content"> |
264 | <article> |
265 | <section id ="exposing"> |
266 | <h1>Exposing Services</h1> |
267 | - <p>By design, Juju operates a very secure environment for deploying your services. Even if you have deployed services, they won't be publically available unless you explicitly make them so. To allow public access to services, the appropriate changes must be made to the cloud provider firewall settings. As the procedure or doing this varies depending on the provider, Juju helpfully abtracts this into a single command, <span class="pre">juju expose <servicename></p> |
268 | + <p>By design, Juju operates a very secure environment for deploying your services. Even if you have deployed services, they won't be publically available unless you explicitly make them so. To allow public access to services, the appropriate changes must be made to the cloud provider firewall settings. As the procedure or doing this varies depending on the provider, Juju helpfully abtracts this into a single command, <code>juju expose <servicename></code></p> |
269 | <p>For example, you may have deployed a WordPress service using the relevant charm. Once deployed, the service still cannot be accessed by the public, so you would run:<p> |
270 | - <pre><code>juju expose wordpress</code></pre> |
271 | + <pre class="prettyprint">juju expose wordpress</pre> |
272 | <p>Juju will then take the steps necessary to adjust firewall rules and any other settings to expose the service via it's given address. This process may take anything from a few moments to several minutes. You can check on the current status of your services by running:</p> |
273 | - <pre><code>juju status</code></pre> |
274 | + <pre class="prettyprint">juju status</pre> |
275 | <p>This will return a status report like this:</p> |
276 | - <pre><code>... |
277 | - services: |
278 | - wordpress: |
279 | - exposed: true |
280 | - charm: local:precise/wordpress-42 |
281 | - relations: {db: mysql} |
282 | - units: |
283 | - wordpress/0: |
284 | - machine: 2 |
285 | - open-ports: [80/tcp] |
286 | - relations: |
287 | - db: {state: up} |
288 | - state: started |
289 | - ... |
290 | - </code></pre> |
291 | - <p>As you can see here, the <strong>exposed:</strong> status is listed as true, and the service is running and available to users.</p> |
292 | +<pre class="prettyprint lang-yaml"> |
293 | +machines: |
294 | + "0": |
295 | + agent-state: started |
296 | + agent-version: 1.12.0 |
297 | + dns-name: 15.185.88.51 |
298 | + instance-id: "1736045" |
299 | + series: precise |
300 | + "1": |
301 | + agent-state: started |
302 | + agent-version: 1.12.0 |
303 | + dns-name: 15.185.89.204 |
304 | + instance-id: "1736065" |
305 | + series: precise |
306 | +services: |
307 | + wordpress: |
308 | + charm: cs:precise/wordpress-42 |
309 | + exposed: true |
310 | + units: |
311 | + wordpress/0: |
312 | + agent-state: started |
313 | + agent-version: 1.12.0 |
314 | + machine: "1" |
315 | + open-ports: |
316 | + - 80/tcp |
317 | + public-address: 15.185.89.236</pre> |
318 | + <p>As you can see here, the <code>exposed:</code> status is listed as true, and the service is running and available to users.</p> |
319 | <p class="note"><strong>Note:</strong> Exposing the service does not change any DNS or other settings which may be neccessary to get your service running as you expect.</p> |
320 | + </section> |
321 | + <section id="unexposing"> |
322 | <h1>Unexposing a service</h1> |
323 | - <p>To return the firewall settings and make a service non-public again, you simly need to run the <span class="pre">juju unexpose</span> command. For example:</p> |
324 | - <pre><code>juju unexpose wordpress</code></pre> |
325 | - |
326 | - |
327 | - |
328 | - </section> |
329 | + <p>To return the firewall settings and make a service non-public again, you simly need to run the <code>unexpose</code> command. For example:</p> |
330 | + <pre class="prettyprint">juju unexpose wordpress</pre> |
331 | + </section> |
332 | </article> |
333 | </div> |
334 | </div> |
335 | @@ -145,6 +155,7 @@ |
336 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
337 | </div> |
338 | </div> |
339 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
340 | </footer> |
341 | |
342 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
343 | |
344 | === modified file 'htmldocs/charms-relations.html' |
345 | --- htmldocs/charms-relations.html 2013-08-22 13:55:23 +0000 |
346 | +++ htmldocs/charms-relations.html 2013-08-31 16:07:56 +0000 |
347 | @@ -53,82 +53,77 @@ |
348 | |
349 | <section id="content" class="container-12"> |
350 | <div class="grid-12 doc-container"> |
351 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
352 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
353 | <div class="grid-9 doc-content"> |
354 | <article> |
355 | - <section id ="charms-relations"> |
356 | + <section id ="managing-relations"> |
357 | <h1>Managing Relationships</h1> |
358 | <p>Few services you might want to run can do so completely independently - most of them rely on some other software components to be present and running too (e.g. a database). There would be little point in Juju making it supremely easy to deploy services if it didn't also make it easy to connect them up to services they need to get running! The Juju magic in this case involves the <strong>hooks</strong> built in to each charm which allow them to communicate. Unless you are writing charms, there is no need to go into detail on hooks, but these are the parts that make creating relationships between services so easy.</p> |
359 | - <p>The charm for WordPress, for example, knows that it requires a database. It therefore has some code to deal with creating that connection and configuring the WordPress instance appropriately when it is told which database to connect to. Similarly, the MySQL charm knows that it is a database, and has code to create different types of database depending on what is required. The act of joining these services together causes this code to run, the WordPress charm saying what tables, users and data it requires, and the MySQL charm fulfilling that and acknowledging the task. As you will see though, adding a relationship is much easier than even this brief explanation.</p> |
360 | - <h1>Creating Relations</h1> |
361 | + <p>The charm for WordPress, for example, knows that it requires a database. It therefore has some code to deal with creating that connection and configuring the WordPress instance appropriately when it is told which database to connect to. Similarly, the MySQL charm knows that it is a database, and has code to create different types of database depending on what is required. The act of joining these services together causes this code to run, the WordPress charm saying what tables, users and data it requires, and the MySQL charm fulfilling that and acknowledging the task. As you will see though, adding a relationship is much easier than even this brief explanation.</p> |
362 | + <h2 id="creating-relations">Creating Relations</h1> |
363 | <p>Creating relationships is usually very straightforward. Simply deploy the two services:</p> |
364 | - <pre><code>juju deploy wordpress |
365 | - juju deploy mysql |
366 | - </code></pre> |
367 | - <p>Then you create the relationship by specifying these two services with the <strong>add-relation</strong> command:</p> |
368 | - <code><pre>juju add-relation mysql wordpress</code></pre> |
369 | +<pre class="prettyprint">juju deploy wordpress |
370 | +juju deploy mysql</pre> |
371 | + <p>Then you create the relationship by specifying these two services with the <code>add-relation</code> command:</p> |
372 | + <pre class="prettyprint">juju add-relation mysql wordpress</pre> |
373 | <p>These services will then communicate and establish an appropriate connection, in this case WordPress using the available MySQL service for its database requirement, and MySQL generating and providing the necessary tables required for WordPress.</p> |
374 | <p>In some cases, there may be ambiguity about how the services should connect. For example, in the case of specifying a database for the Mediawiki charm.</p> |
375 | - <pre><code>juju add-relation mediawiki mysql -e hpc |
376 | - error: ambiguous relation: "mediawiki mysql" could refer to "mediawiki:db mysql:db"; "mediawiki:slave mysql:db" |
377 | - </code></pre> |
378 | +<pre class="prettyprint">juju add-relation mediawiki mysql |
379 | +error: ambiguous relation: "mediawiki mysql" could refer to "mediawiki:db mysql:db"; "mediawiki:slave mysql:db"</pre> |
380 | <p> the soloution in these cases is to specify the nature of the relation using the hook identifier. In this case, we want MySQL to provide the backend database for mediawiki, so this is what we need to enter:</p> |
381 | - <pre><code>juju add-relation mediawiki:db mysql</code></pre> |
382 | - <p>we can check the output from 'juju status' to make sure the correct relationship has been established:</p> |
383 | - <pre><code>juju status -e hpc |
384 | + <pre class="prettyprint">juju add-relation mediawiki:db mysql</pre> |
385 | + <p>we can check the output from <code>juju status</code> to make sure the correct relationship has been established:</p> |
386 | + <pre class="prettyprint lang-yaml"> |
387 | machines: |
388 | - "0": |
389 | - agent-state: started |
390 | - agent-version: 1.10.0 |
391 | - dns-name: 15.185.88.51 |
392 | - instance-id: "1736045" |
393 | - series: precise |
394 | - "1": |
395 | - agent-state: started |
396 | - agent-version: 1.10.0 |
397 | - dns-name: 15.185.89.204 |
398 | - instance-id: "1736065" |
399 | - series: precise |
400 | - "3": |
401 | - agent-state: started |
402 | - agent-version: 1.10.0 |
403 | - dns-name: 15.185.89.236 |
404 | - instance-id: "1736119" |
405 | - series: precise |
406 | + "0": |
407 | + agent-state: started |
408 | + agent-version: 1.10.0 |
409 | + dns-name: 15.185.88.51 |
410 | + instance-id: "1736045" |
411 | + series: precise |
412 | + "1": |
413 | + agent-state: started |
414 | + agent-version: 1.10.0 |
415 | + dns-name: 15.185.89.204 |
416 | + instance-id: "1736065" |
417 | + series: precise |
418 | + "3": |
419 | + agent-state: started |
420 | + agent-version: 1.10.0 |
421 | + dns-name: 15.185.89.236 |
422 | + instance-id: "1736119" |
423 | + series: precise |
424 | services: |
425 | - mediawiki: |
426 | - charm: cs:precise/mediawiki-8 |
427 | - exposed: false |
428 | - relations: |
429 | - db: |
430 | - - mysql |
431 | - units: |
432 | - mediawiki/0: |
433 | - agent-state: pending |
434 | - agent-version: 1.10.0 |
435 | - machine: "3" |
436 | - public-address: 15.185.89.236 |
437 | - mysql: |
438 | - charm: cs:precise/mysql-24 |
439 | - exposed: false |
440 | - relations: |
441 | - cluster: |
442 | - - mysql |
443 | - db: |
444 | - - mediawiki |
445 | - units: |
446 | - mysql/0: |
447 | - agent-state: started |
448 | - agent-version: 1.10.0 |
449 | - machine: "1" |
450 | - public-address: 15.185.89.204 |
451 | -</code></pre> |
452 | -<h1>Removing Relations</h1> |
453 | -<p>There are times when a relationship just isn't working and it is time to move on. Fortunately, it is a simple single-line command to break off these relationships:</p> |
454 | -<pre><code>juju destroy-relation mediawiki mysql</code></pre> |
455 | - |
456 | - |
457 | - |
458 | + mediawiki: |
459 | + charm: cs:precise/mediawiki-8 |
460 | + exposed: false |
461 | + relations: |
462 | + db: |
463 | + - mysql |
464 | + units: |
465 | + mediawiki/0: |
466 | + agent-state: pending |
467 | + agent-version: 1.10.0 |
468 | + machine: "3" |
469 | + public-address: 15.185.89.236 |
470 | + mysql: |
471 | + charm: cs:precise/mysql-24 |
472 | + exposed: false |
473 | + relations: |
474 | + cluster: |
475 | + - mysql |
476 | + db: |
477 | + - mediawiki |
478 | + units: |
479 | + mysql/0: |
480 | + agent-state: started |
481 | + agent-version: 1.10.0 |
482 | + machine: "1" |
483 | + public-address: 15.185.89.204 |
484 | +</pre> |
485 | + <h2 id="removing-relations">Removing Relations</h1> |
486 | + <p>There are times when a relationship just isn't working and it is time to move on. Fortunately, it is a simple single-line command to break off these relationships:</p> |
487 | + <pre class="prettyprint">juju destroy-relation mediawiki mysql</pre> |
488 | </section> |
489 | </article> |
490 | </div> |
491 | @@ -187,6 +182,7 @@ |
492 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
493 | </div> |
494 | </div> |
495 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
496 | </footer> |
497 | |
498 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
499 | |
500 | === modified file 'htmldocs/charms-scaling.html' |
501 | --- htmldocs/charms-scaling.html 2013-08-30 22:37:17 +0000 |
502 | +++ htmldocs/charms-scaling.html 2013-08-31 16:07:56 +0000 |
503 | @@ -86,33 +86,35 @@ |
504 | <p>or you can use <code>--num-unit</code> which has the same result, but is more readable:</p> |
505 | <pre class="prettyprint">juju add-unit --num-unit 100 mysql</pre> |
506 | <p>If you would like to add a unit to a specific machine just append the <code>--to</code> <machine> option.</p> |
507 | -<pre class="prettyprint">#add unit to machine 23 |
508 | + |
509 | +<pre class="prettyprint"># add unit to machine 23 |
510 | juju add-unit mysql --to 23 |
511 | |
512 | -#add unit to lxc container 3 on host machine 24 |
513 | +# add unit to lxc container 3 on host machine 24 |
514 | juju add-unit mysql --to 24/lxc/3 |
515 | |
516 | -#add unit to a new lxc container on host machine 25 |
517 | +# add unit to a new lxc container on host machine 25 |
518 | juju add-unit mysql --to lxc:25</pre> |
519 | + |
520 | <p>The <code>add-unit</code> command deploys a machine matching the constraints of the initially deployed service. For example, if mysql was deployed with the defaults (i.e. no <code>--constraints</code> option) you would have mysql on an instance that matches the closest to 1Gig of memory and 1CPU. If you would like to add a unit with more resources to the mysql service you will first need to issue a <code>add-machine</code> with the desired constraint followed by a <code>add-unit</code>. For example, the following command adds a 16Gig unit to the mysql service (note in this example <code>juju status</code> returns machine 3 for the <code>add-machine</code> command):</p> |
521 | <pre class="prettyprint">juju add-machine --constraints="mem=16G" |
522 | juju add-unit mysql --to 3 |
523 | </pre> |
524 | |
525 | <p class="note"><strong>Note:</strong> Keep in mind you can always use the <code>-e</code> or <code>--environment</code> options to specify which environment/cloud you would like the command ran against. In the following example the <code>-e hpcloud</code> adds 100 units to the mysql service in HP's cloud:</p> |
526 | -<pre class="prettyprint">juju add-unit -n 100 mysql -e hpcloud</pre> |
527 | + <pre class="prettyprint">juju add-unit -n 100 mysql -e hpcloud</pre> |
528 | <p><a href="charms-deploying.html#deploying-to-machines">More on deploying to specific machines.</a></p> |
529 | <h1>Scaling Back</h1> |
530 | <p>Sometimes you also want to scale back some of your services, and this too is easy with Juju.</p> |
531 | <p>The general usage to scale down a service is with the <code>remove-unit</code> command:</p> |
532 | -<pre class="prettyprint">juju remove-unit [options] <unit> [...]</pre> |
533 | + <pre class="prettyprint">juju remove-unit [options] <unit> [...]</pre> |
534 | <p>For example, the following scales down the mediawiki service by one unit:</p> |
535 | -<pre class="prettyprint">juju remove-unit mediawiki/1</pre> |
536 | - <p>If you have scaled-up the mediawiki service by more than one unit you can remove multiple units in the same command as long as you know the unit name (ie <service>/#).</p> |
537 | -<pre class="prettyprint">juju remove-unit mediawiki/1 mediawiki/2 mediawiki/3 mediawiki/4 mediawiki/5</pre> |
538 | + <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1</pre> |
539 | + <p>If you have scaled-up the mediawiki service by more than one unit you can remove multiple units in the same command as long as you know the unit name (ie <code><service>/#</code>).</p> |
540 | + <pre class="prettyprint lang-yaml">juju remove-unit mediawiki/1 mediawiki/2 mediawiki/3 mediawiki/4 mediawiki/5</pre> |
541 | <p>The <code>remove-unit</code> command can be run to remove running units safely. The running services should automatically adjust to the change.</p> |
542 | - <p class="note"><strong>Note:</strong> After removing a service the machine will still be running. In order to completely remove the machine that once housed the service you need to issue a <code>destroy-machine</code>. For example, to remove machine 1 that the unit mediawiki/1 was housed on use the command: |
543 | -<pre class="prettyprint">juju destroy-machine 1</pre> |
544 | + <p class="note"><strong>Note:</strong> After removing a service the machine will still be running. In order to completely remove the machine that once housed the service you need to issue a <code>destroy-machine</code>. For example, to remove machine 1 that the unit <code>mediawiki/1</code> was housed on use the command: |
545 | + <pre class="prettyprint lang-yaml">juju destroy-machine 1</pre> |
546 | <p>For more information on removing services, please see the section on <a href="charms-destroy.html">destroying services</a>.</p> |
547 | </section> |
548 | |
549 | |
550 | === modified file 'htmldocs/charms-service-groups.html' |
551 | --- htmldocs/charms-service-groups.html 2013-08-31 13:10:24 +0000 |
552 | +++ htmldocs/charms-service-groups.html 2013-08-31 16:07:56 +0000 |
553 | @@ -53,44 +53,36 @@ |
554 | |
555 | <section id="content" class="container-12"> |
556 | <div class="grid-12 doc-container"> |
557 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
558 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
559 | <div class="grid-9 doc-content"> |
560 | <article> |
561 | - |
562 | - |
563 | -<!--Actual docs start here--> |
564 | - |
565 | + <!--Actual docs start here--> |
566 | <section id="service-groups"> |
567 | <h1>Groups of Services</h1> |
568 | <p></p> |
569 | - |
570 | <p> |
571 | Juju deploys units of a service from a charm. |
572 | The simplest way to do this is |
573 | </p> |
574 | - |
575 | -<pre class="prettyprint"> |
576 | -juju deploy mysql |
577 | -</pre> |
578 | + |
579 | + <pre class="prettyprint">juju deploy mysql</pre> |
580 | |
581 | <p> |
582 | which will take the latest version of the mysql charm straight from the store and create a single service unit. |
583 | </p> |
584 | |
585 | <p> |
586 | - By default, juju creates a unit of a service named after the charm; "mysql" in the above example. |
587 | + By default, juju creates a unit of a service named after the charm; <code>mysql</code> in the above example. |
588 | </p> |
589 | |
590 | <p> |
591 | You can specify the name for the service when deploying |
592 | </p> |
593 | |
594 | -<pre class="prettyprint"> |
595 | -juju deploy mysql wikidb |
596 | -</pre> |
597 | + <pre class="prettyprint">juju deploy mysql wikidb</pre> |
598 | |
599 | <p> |
600 | - which will create a unit of the "wikidb" service. It creates the unit exactly as before, except instead of 'mysql', the service is called'wikidb'. |
601 | + which will create a unit of the <code>wikidb</code> service. It creates the unit exactly as before, except instead of <code>mysql</code>, the service is called <code>wikidb</code>. |
602 | </p> |
603 | |
604 | <p> |
605 | @@ -152,9 +144,7 @@ |
606 | where the different services are related to each other |
607 | </p> |
608 | |
609 | -<pre class="prettyprint"> |
610 | -juju add-relation masterdb:master slavedb:slave |
611 | -</pre> |
612 | + <pre class="prettyprint">juju add-relation masterdb:master slavedb:slave</pre> |
613 | |
614 | <p> |
615 | and to other services via |
616 | @@ -182,28 +172,17 @@ |
617 | juju add-relation hadoop-master:namenode hadoop-slave-B:datanode |
618 | ... |
619 | </pre> |
620 | - |
621 | <p> |
622 | These service groups can be managed independently by Juju for upgrades and configuration |
623 | </p> |
624 | - |
625 | -<pre class="prettyprint"> |
626 | -juju set hadoop-slave-B some_param=new_value |
627 | -</pre> |
628 | - |
629 | + <pre class="prettyprint">juju set hadoop-slave-B some_param=new_value</pre> |
630 | <p> |
631 | This technique can potentially be a way for Juju to manage rolling upgrades for a service. |
632 | Of course, this depends heavily on the services in question and how well they support |
633 | version management, schema changes, etc. |
634 | </p> |
635 | - |
636 | - |
637 | </section> |
638 | - |
639 | - <!--Actual docs end here--> |
640 | - |
641 | - |
642 | - |
643 | + <!--Actual docs end here--> |
644 | </article> |
645 | </div> |
646 | </div> |
647 | @@ -261,7 +240,7 @@ |
648 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
649 | </div> |
650 | </div> |
651 | - <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
652 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
653 | </footer> |
654 | |
655 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
656 | |
657 | === modified file 'htmldocs/charms-upgrading.html' |
658 | --- htmldocs/charms-upgrading.html 2013-08-22 13:55:23 +0000 |
659 | +++ htmldocs/charms-upgrading.html 2013-08-31 16:07:56 +0000 |
660 | @@ -53,14 +53,20 @@ |
661 | |
662 | <section id="content" class="container-12"> |
663 | <div class="grid-12 doc-container"> |
664 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
665 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
666 | <div class="grid-9 doc-content"> |
667 | <article> |
668 | <section id ="upgrading"> |
669 | - <h1>Upgrades</h1> |
670 | - <h1>Charm upgrades</h1> |
671 | - <h1>Service upgrades</h1> |
672 | - <h1>Juju</h1> |
673 | + <h1>Upgrades</h1> |
674 | + </section> |
675 | + <section id="charm-upgrades"> |
676 | + <h1>Charm upgrades</h1> |
677 | + </section> |
678 | + <section id="service-upgrades"> |
679 | + <h1>Service upgrades</h1> |
680 | + </section> |
681 | + <section id="juju-upgrades"> |
682 | + <h1>Juju</h1> |
683 | </section> |
684 | </article> |
685 | </div> |
686 | @@ -119,6 +125,7 @@ |
687 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
688 | </div> |
689 | </div> |
690 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
691 | </footer> |
692 | |
693 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
694 | |
695 | === modified file 'htmldocs/charms.html' |
696 | --- htmldocs/charms.html 2013-08-30 14:04:27 +0000 |
697 | +++ htmldocs/charms.html 2013-08-31 16:07:56 +0000 |
698 | @@ -53,7 +53,7 @@ |
699 | |
700 | <section id="content" class="container-12"> |
701 | <div class="grid-12 doc-container"> |
702 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
703 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
704 | <div class="grid-9 doc-content"> |
705 | <article> |
706 | <section id="charms"> |
707 | @@ -62,25 +62,18 @@ |
708 | <iframe class="youtube-player" type="text/html" width="400" height="300" src="//www.youtube.com/embed/0AT6qKyam9I" frameborder="0"> |
709 | </iframe> |
710 | </aside> |
711 | - |
712 | <p>The magic behind Juju is a collection of software components called charms. These are the encapsulated knowledge of how to properly deploy and configure the services you will want to deploy on your cloud. The charms available online in the <a href="">Charm Store</a> represent the distilled DevOps knowledge of experts, and they are freely available for you to use (or you can write your own).</p> |
713 | <p>Charms make it quick and easy to reliably and repeatedly deploy services in your cloud. If you haven't already tried the <a href=""> Juju walkthrough,</a> you should give it a go and see how ridiculously easy it is to deploy services in minutes. </p> |
714 | <p>In many cases, you will simply deploy, configure and expose services in your cloud. The following sections explore in more detail the everyday Juju and Charm operations you are likely to perform </p> |
715 | <ul> |
716 | - |
717 | <li><a href="charms-deploying.html">Deploying services</a></li> |
718 | - |
719 | - |
720 | <li><a href="charms-config.html">Configuring Services</a></li> |
721 | <li><a href="charms-relations.html">Managing Relationships</a></li> |
722 | <li><a href="charms-constraints.html">Using Constraints</a></li> |
723 | <li><a href="charms-scaling.html">Scaling</a></li> |
724 | <li><a href="charms-exposing.html">Exposing services</a></li> |
725 | - |
726 | </ul> |
727 | </section> |
728 | - |
729 | - |
730 | </article> |
731 | </div> |
732 | </div> |
733 | |
734 | === modified file 'htmldocs/commands.html' |
735 | --- htmldocs/commands.html 2013-08-22 13:55:23 +0000 |
736 | +++ htmldocs/commands.html 2013-08-31 16:07:56 +0000 |
737 | @@ -53,50 +53,51 @@ |
738 | |
739 | <section id="content" class="container-12"> |
740 | <div class="grid-12 doc-container"> |
741 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
742 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
743 | <div class="grid-9 doc-content"> |
744 | <article> |
745 | - <section id ="charms-destroy"> |
746 | + <section id ="commands"> |
747 | <h1>Juju Command reference</h1> |
748 | - <p>You can get a list of the currently used commands by entering <span class="pre">juju help commands</span> from the commandline. The currently understood commands are listed here, with some examples.</p> |
749 | - <ul> |
750 | - <li><strong>add-relation</strong> add a relation between two services</li> |
751 | - <li><strong>add-unit</strong> add a service unit</li> |
752 | - <li><strong>bootstrap</strong> start up an environment from scratch</li> |
753 | - <li><strong>debug-log</strong> display the consolidated log file</li> |
754 | - <li><strong>deploy</strong> deploy a new service</li> |
755 | - <li><strong>destroy-environment</strong> terminate all machines and other associated resources for an environment</li> |
756 | - <li><strong>destroy-machine</strong> destroy machines</li> |
757 | - <li><strong>destroy-relation</strong> destroy a relation between two services</li> |
758 | - <li><strong>destroy-service</strong> destroy a service</li> |
759 | - <li><strong>destroy-unit</strong> destroy service units</li> |
760 | - <li><strong>expose</strong> expose a service</li> |
761 | - <li><strong>generate-config</strong> alias for init</li> |
762 | - <li><strong>get</strong> get service config options</li> |
763 | - <li><strong>get-constraints</strong> view constraints</li> |
764 | - <li><strong>get-env</strong> alias for get-environment</li> |
765 | - <li><strong>get-environment</strong> view environment values</li> |
766 | - <li><strong>help</strong> show help on a command or other topic</li> |
767 | - <li><strong>init</strong> generate boilerplate configuration for juju environments</li> |
768 | - <li><strong>publish</strong> publish charm to the store</li> |
769 | - <li><strong>remove-relation</strong> alias for destroy-relation</li> |
770 | - <li><strong>remove-unit</strong> alias for destroy-unit</li> |
771 | - <li><strong>resolved</strong> marks unit errors resolved</li> |
772 | - <li><strong>scp</strong> launch a scp command to copy files to/from remote machine(s)</li> |
773 | - <li><strong>set</strong> set service config options</li> |
774 | - <li><strong>set-constraints</strong> replace constraints</li> |
775 | - <li><strong>set-env</strong> alias for set-environment</li> |
776 | - <li><strong>set-environment</strong> replace environment values</li> |
777 | - <li><strong>ssh</strong> launch an ssh shell on a given unit or machine</li> |
778 | - <li><strong>stat</strong> alias for status</li> |
779 | - <li><strong>status</strong> output status information about an environment</li> |
780 | - <li><strong>sync-tools</strong> copy tools from the official bucket into a local environment</li> |
781 | - <li><strong>terminate-machine</strong> alias for destroy-machine</li> |
782 | - <li><strong>unexpose</strong> unexpose a service</li> |
783 | - <li><strong>upgrade-charm</strong> upgrade a service's charm</li> |
784 | - <li><strong>upgrade-juju</strong> upgrade the tools in a juju environment</li> |
785 | - <li><strong>version</strong> print the current version</li> |
786 | - </ul> |
787 | + <p>You can get a list of the currently used commands by entering <code>juju help commands</code> from the commandline. The currently understood commands are listed here, with some examples.</p> |
788 | + <ul> |
789 | + <li><strong>add-relation</strong> add a relation between two services</li> |
790 | + <li><strong>add-unit</strong> add a service unit</li> |
791 | + <li><strong>bootstrap</strong> start up an environment from scratch</li> |
792 | + <li><strong>debug-log</strong> display the consolidated log file</li> |
793 | + <li><strong>deploy</strong> deploy a new service</li> |
794 | + <li><strong>destroy-environment</strong> terminate all machines and other associated resources for an environment</li> |
795 | + <li><strong>destroy-machine</strong> destroy machines</li> |
796 | + <li><strong>destroy-relation</strong> destroy a relation between two services</li> |
797 | + <li><strong>destroy-service</strong> destroy a service</li> |
798 | + <li><strong>destroy-unit</strong> destroy service units</li> |
799 | + <li><strong>expose</strong> expose a service</li> |
800 | + <li><strong>generate-config</strong> alias for init</li> |
801 | + <li><strong>get</strong> get service config options</li> |
802 | + <li><strong>get-constraints</strong> view constraints</li> |
803 | + <li><strong>get-env</strong> alias for get-environment</li> |
804 | + <li><strong>get-environment</strong> view environment values</li> |
805 | + <li><strong>help</strong> show help on a command or other topic</li> |
806 | + <li><strong>init</strong> generate boilerplate configuration for juju environments</li> |
807 | + <li><strong>publish</strong> publish charm to the store</li> |
808 | + <li><strong>remove-relation</strong> alias for destroy-relation</li> |
809 | + <li><strong>remove-unit</strong> alias for destroy-unit</li> |
810 | + <li><strong>resolved</strong> marks unit errors resolved</li> |
811 | + <li><strong>scp</strong> launch a scp command to copy files to/from remote machine(s)</li> |
812 | + <li><strong>set</strong> set service config options</li> |
813 | + <li><strong>set-constraints</strong> replace constraints</li> |
814 | + <li><strong>set-env</strong> alias for set-environment</li> |
815 | + <li><strong>set-environment</strong> replace environment values</li> |
816 | + <li><strong>ssh</strong> launch an ssh shell on a given unit or machine</li> |
817 | + <li><strong>stat</strong> alias for status</li> |
818 | + <li><strong>status</strong> output status information about an environment</li> |
819 | + <li><strong>sync-tools</strong> copy tools from the official bucket into a local environment</li> |
820 | + <li><strong>terminate-machine</strong> alias for destroy-machine</li> |
821 | + <li><strong>unexpose</strong> unexpose a service</li> |
822 | + <li><strong>upgrade-charm</strong> upgrade a service's charm</li> |
823 | + <li><strong>upgrade-juju</strong> upgrade the tools in a juju environment</li> |
824 | + <li><strong>version</strong> print the current version</li> |
825 | + </ul> |
826 | + </section> |
827 | </article> |
828 | </div> |
829 | </div> |
830 | @@ -154,6 +155,7 @@ |
831 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
832 | </div> |
833 | </div> |
834 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
835 | </footer> |
836 | |
837 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
838 | |
839 | === modified file 'htmldocs/config-hpcloud.html' |
840 | --- htmldocs/config-hpcloud.html 2013-08-23 14:55:02 +0000 |
841 | +++ htmldocs/config-hpcloud.html 2013-08-31 16:07:56 +0000 |
842 | @@ -50,56 +50,50 @@ |
843 | </div> |
844 | </div> |
845 | </header> |
846 | - |
847 | <section id="content" class="container-12"> |
848 | <div class="grid-12 doc-container"> |
849 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
850 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
851 | <div class="grid-9 doc-content"> |
852 | <article> |
853 | <section id="config_hpcloud"> |
854 | <h1>Configuring for HPCloud</h1> |
855 | - <p>You should start by generating a generic configuration file for Juju, using the command: |
856 | - <pre><code>juju generate-config -w</code></pre> |
857 | - <p>This will generate a file, <strong>environments.yaml</strong>, which will live in your <strong>~/.juju/</strong> directory (and will create the directory if it doesn't already exist). |
858 | + <p>You should start by generating a generic configuration file for Juju, using the command:</pre> |
859 | + <pre class="prettyprint">juju init</pre> |
860 | + <p>This will generate a file, <code>environments.yaml</code>, which will live in your <code>~/.juju/</code> directory (and will create the directory if it doesn't already exist).</p> |
861 | <p>The essential configuration sections for HPCloud look like this:</p> |
862 | - <pre><code> |
863 | - hpcloud: |
864 | - type: openstack |
865 | - admin-secret: 6638bebf0c54de791007e0247d4dae98 |
866 | - control-bucket: juju-bc66a4a4adbee50b2cea6570436528e5 |
867 | - tenant-name: <strong class="code">"juju-project1"</strong> |
868 | - auth-url: <strong class="code">https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0</strong> |
869 | - default-image-id: <strong class="code">"81078"</strong> |
870 | - default-instance-type: "standard.xsmall" |
871 | - auth-mode: userpass |
872 | - username: <strong class="code">"xxxyour-hpcloud-usernamexxx"</strong> |
873 | - password: <strong class="code">"xxxpasswordxxx"</strong> |
874 | - region: <strong class="code">az-1.region-a.geo-1</strong> |
875 | - public-bucket-url: <strong class="code">https://region-a.geo-1.objects.hpcloudsvc.com/v1/60502529753910</strong> |
876 | - </code></pre> |
877 | + <pre class="prettyprint lang-yaml"> |
878 | + hpcloud: |
879 | + type: openstack |
880 | + use-floating-ip: false |
881 | + admin-secret: 139e8bee94d15bff96d91ab9c27e5efc |
882 | + # Globally unique swift bucket name |
883 | + control-bucket: juju-9b53d6f5f45968d7c392a221f85fc8ae |
884 | + auth-url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0 |
885 | + public-bucket-url: https://region-a.geo-1.objects.hpcloudsvc.com/v1/60502529753910 |
886 | + auth-mode: userpass |
887 | + username: [your username] |
888 | + password: [password] |
889 | + tenant-name: [HP Cloud Project Name] |
890 | + region: [az-1.region-a.geo-1, az-2.region-a.geo-1, or az-3.region-a.geo-1]</pre> |
891 | <p>The items highlighted are values you will need to enter, and are explained below. You will find most of the relevant information on the <a href="https://account.hpcloud.com/account/api_keys"> HP Cloud API Keys page</a></p> |
892 | <ul> |
893 | - <li><strong>tenant-name:</strong> For HPCloud, this is listed as the project name on the<a href="https://account.hpcloud.com/projects"> "Manage Projects" page</a>.</li> |
894 | + <li> |
895 | + <code>tenant-name:</code> For HPCloud, this is listed as the project name on the<a href="https://account.hpcloud.com/projects"> "Manage Projects" page</a>. |
896 | + <img src="media/getting_started-hpc-tenant.png" alt="image showing project name"> |
897 | + </li> |
898 | </ul> |
899 | - <img src="./media/getting_started-hpc-tenant.png" alt="image showing project name"> |
900 | + <hr> |
901 | <p>You will find the following information on the <a href="https://account.hpcloud.com/account/api_keys"> HP Cloud API Keys page for your account.</a></p> |
902 | <ul> |
903 | - <li><strong>auth-url:</strong>This is the keystone url for authentication. It is given (on a region by region basis) under the heading "Service Endpoints - identity" |
904 | + <li> |
905 | + <code>auth-url:</code>This is the keystone url for authentication. It is given (on a region by region basis) under the heading "Service Endpoints - identity" |
906 | + <img src="media/getting_started-hpc-config1.png" alt="image showing service endpoints"> |
907 | </li> |
908 | - </ul> |
909 | - <img src="./media/getting_started-hpc-config1.png" alt="image showing service endpoints"> |
910 | - <ul> |
911 | - <li><strong>region:</strong> This is the longer format region name, given under the headings for Block Storage and Compute sections.</li> |
912 | - </ul> |
913 | - <img src="./media/getting_started-hpc-region.png" alt="image showing project name"> |
914 | - <ul> |
915 | - <li><strong>default-image-id:</strong> This is the number assigned to the images available to the HP Cloud. Currently, these may vary from region to region. The best way to ensure that you have the correct image id is to go to the <a href="https://console.hpcloud.com/compute/az-1_region-a_geo-1/servers"> HP Cloud Console > Servers </a> page and Click on the link to "Create a new server from an image". This will display a list of available images. In the "partner provided images" section you should find a relevant version of Ubuntu. The number in brackets after the image description is the id number you require. </li> |
916 | - </ul> |
917 | - <img src="./media/getting_started-hpc-image.png" alt="determining the image id number"> |
918 | - <ul> |
919 | - <li><strong>username:</strong> Enter your HP Cloud login username. </li> |
920 | - <li><strong>password:</strong> Enter your HP Cloud login password. </li> |
921 | - <li><strong>public-bucket-url:</strong> Currently up to date tools are provided to HP Cloud by a public bucket. You should enter the url "https://region-a.geo-1.objects.hpcloudsvc.com/v1/60502529753910" here. </li> |
922 | + <li><code>region:</code> This is the longer format region name, given under the headings for Block Storage and Compute sections.<img src="media/getting_started-hpc-region.png" alt="image showing project name"></li> |
923 | + <li><code>username:</code> Enter your HP Cloud login username. </li> |
924 | + <li><code>password:</code> Enter your HP Cloud login password. </li> |
925 | + <li><code>public-bucket-url:</code> Currently up to date tools are provided to HP Cloud by a public bucket. If you're using your own imagemetadata you'd change this URL to the bucket you've created.</li> |
926 | + </ul> |
927 | </section> |
928 | </article> |
929 | </div> |
930 | @@ -158,6 +152,7 @@ |
931 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
932 | </div> |
933 | </div> |
934 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
935 | </footer> |
936 | |
937 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
938 | |
939 | === modified file 'htmldocs/config-maas.html' |
940 | --- htmldocs/config-maas.html 2013-08-22 13:55:23 +0000 |
941 | +++ htmldocs/config-maas.html 2013-08-31 16:07:56 +0000 |
942 | @@ -53,12 +53,16 @@ |
943 | |
944 | <section id="content" class="container-12"> |
945 | <div class="grid-12 doc-container"> |
946 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
947 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
948 | <div class="grid-9 doc-content"> |
949 | <article> |
950 | <section id="config_maas"> |
951 | <h1>Configuring for MAAS</h1> |
952 | <p>Metal As A Service is software which allows you to deal with physical hardware just as easily as virtual nodes. For more information about MAAS, see <a href="http://maas.ubuntu.com"> maas.ubuntu.com </a> </p> |
953 | + <p>You should start by generating a generic configuration file for Juju, using the command:</p> |
954 | + <pre class="prettyprint">juju init</pre> |
955 | + <p>This will generate a file, <code>environments.yaml</code>, which will live in your <code>~/.juju/</code> directory (and will create the directory if it doesn't already exist).</p> |
956 | + |
957 | <h1> Get your API key</h1> |
958 | <p>You'll need an API key from MAAS so that the Juju client can access it. Each user account in MAAS can have as many API keys as desired. One hard and fast rule is that you'll need to use a different API key for each Juju environment you set up within a single MAAS cluster.</p> |
959 | <p>To get the API key:</p> |
960 | @@ -70,18 +74,17 @@ |
961 | </ol> |
962 | |
963 | <h1> Edit or create the configuration</h1> |
964 | - <p>Create or modify <strong>~/.juju/environments.yaml</strong> with the following content: |
965 | - |
966 | - <pre><code> |
967 | - maas: |
968 | - type: maas |
969 | - maas-server: 'http://xxyourMAASServernamexx:80/MAAS' |
970 | - maas-oauth: '$MAAS_API_KEY' |
971 | - admin-secret: 'nothing' |
972 | - default-series: 'precise' |
973 | - </code></pre> |
974 | - |
975 | - <p>Substitute the API key from earlier into the <span class="pre">$MAAS_API_KEY</span> slot. You may need to modify the maas-server setting too; if you're running from the maas package it should be something like "http://hostname.xxxx.yyy/MAAS".</p> |
976 | + <p>Create or modify <code>~/.juju/environments.yaml</code> with the following content: |
977 | + |
978 | + <pre class="prettyprint lang-yaml"> |
979 | + maas: |
980 | + type: maas |
981 | + maas-server: 'http://xxyourMAASServernamexx:80/MAAS' |
982 | + maas-oauth: '$MAAS_API_KEY' |
983 | + admin-secret: 'nothing' |
984 | + default-series: 'precise'</pre> |
985 | + |
986 | + <p>Substitute the API key from earlier into the <code>$MAAS_API_KEY</code> slot. You may need to modify the <code>maas-server</code> setting too; if you're running from the maas package it should be something like "http://hostname.xxxx.yyy/MAAS".</p> |
987 | </section> |
988 | </article> |
989 | </div> |
990 | @@ -140,6 +143,7 @@ |
991 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
992 | </div> |
993 | </div> |
994 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
995 | </footer> |
996 | |
997 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
998 | |
999 | === modified file 'htmldocs/config-openstack.html' |
1000 | --- htmldocs/config-openstack.html 2013-08-22 13:55:23 +0000 |
1001 | +++ htmldocs/config-openstack.html 2013-08-31 16:07:56 +0000 |
1002 | @@ -58,36 +58,36 @@ |
1003 | <article> |
1004 | <section id="config_hpcloud"> |
1005 | <h1>Configuring for OpenStack</h1> |
1006 | - <p>You should start by generating a generic configuration file for Juju, using the command: |
1007 | - <pre><code>juju generate-config -w</code></pre> |
1008 | - <p>This will generate a file, <strong>environments.yaml</strong>, which will live in your <strong>~/.juju/</strong> directory (and will create the directory if it doesn't already exist). |
1009 | + <p>You should start by generating a generic configuration file for Juju, using the command:</p> |
1010 | + <pre class="prettyprint">juju init</pre> |
1011 | + <p>This will generate a file, <code>environments.yaml</code>, which will live in your <code>~/.juju/</code> directory (and will create the directory if it doesn't already exist).</p> |
1012 | <p>The essential configuration sections for OpenStack look like this:</p> |
1013 | - <pre><code> |
1014 | - openstack: |
1015 | - type: openstack |
1016 | - # Specifies whether the use of a floating IP address is required to give the nodes |
1017 | - # a public IP address. Some installations assign public IP addresses by default without |
1018 | - # requiring a floating IP address. |
1019 | - # use-floating-ip: false |
1020 | - admin-secret: 13850d1b9786065cadd0f477e8c97cd3 |
1021 | - # Globally unique swift bucket name |
1022 | - control-bucket: juju-fd6ab8d02393af742bfbe8b9629707ee |
1023 | - # Usually set via the env variable OS_AUTH_URL, but can be specified here |
1024 | - # auth-url: https://yourkeystoneurl:443/v2.0/ |
1025 | - # override if your workstation is running a different series to which you are deploying |
1026 | - # default-series: precise |
1027 | - # The following are used for userpass authentication (the default) |
1028 | - auth-mode: userpass |
1029 | - # Usually set via the env variable OS_USERNAME, but can be specified here |
1030 | - # username: <your username> |
1031 | - # Usually set via the env variable OS_PASSWORD, but can be specified here |
1032 | - # password: <secret> |
1033 | - # Usually set via the env variable OS_TENANT_NAME, but can be specified here |
1034 | - # tenant-name: <your tenant name> |
1035 | - # Usually set via the env variable OS_REGION_NAME, but can be specified here |
1036 | - # region: <your region> |
1037 | - </code></pre> |
1038 | + <pre class="prettyprint lang-yaml"> |
1039 | +openstack: |
1040 | + type: openstack |
1041 | + # Specifies whether the use of a floating IP address is required to give the nodes |
1042 | + # a public IP address. Some installations assign public IP addresses by default without |
1043 | + # requiring a floating IP address. |
1044 | + # use-floating-ip: false |
1045 | + admin-secret: 13850d1b9786065cadd0f477e8c97cd3 |
1046 | + # Globally unique swift bucket name |
1047 | + control-bucket: juju-fd6ab8d02393af742bfbe8b9629707ee |
1048 | + # Usually set via the env variable OS_AUTH_URL, but can be specified here |
1049 | + # auth-url: https://yourkeystoneurl:443/v2.0/ |
1050 | + # override if your workstation is running a different series to which you are deploying |
1051 | + # default-series: precise |
1052 | + # The following are used for userpass authentication (the default) |
1053 | + auth-mode: userpass |
1054 | + # Usually set via the env variable OS_USERNAME, but can be specified here |
1055 | + # username: <your username> |
1056 | + # Usually set via the env variable OS_PASSWORD, but can be specified here |
1057 | + # password: <secret> |
1058 | + # Usually set via the env variable OS_TENANT_NAME, but can be specified here |
1059 | + # tenant-name: <your tenant name> |
1060 | + # Usually set via the env variable OS_REGION_NAME, but can be specified here |
1061 | + # region: <your region></pre> |
1062 | |
1063 | + <p class="note"><strong>Note:</strong> At any time you can run <code>juju init --show</code> to display the most revent version of the environments.yaml template file, instead of having it write to file.</p> |
1064 | <p>Remember to substitute in the parts of the snippet that are important to you. If you are deploying on OpenStack the following documentation might also be useful:</p> |
1065 | |
1066 | <p><a href="https://help.ubuntu.com/community/UbuntuCloudInfrastructure">Ubuntu Cloud Infrastructure</a></p> |
1067 | @@ -151,6 +151,7 @@ |
1068 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
1069 | </div> |
1070 | </div> |
1071 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
1072 | </footer> |
1073 | |
1074 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
1075 | |
1076 | === modified file 'htmldocs/css/main.css' |
1077 | --- htmldocs/css/main.css 2013-08-31 16:07:55 +0000 |
1078 | +++ htmldocs/css/main.css 2013-08-31 16:07:56 +0000 |
1079 | @@ -489,3 +489,8 @@ |
1080 | dd { |
1081 | padding-left: 10px; |
1082 | } |
1083 | + |
1084 | +li img { |
1085 | + margin-top: 10px; |
1086 | + display:block; |
1087 | +} |
1088 | |
1089 | === modified file 'htmldocs/getting-started.html' |
1090 | --- htmldocs/getting-started.html 2013-08-22 13:55:23 +0000 |
1091 | +++ htmldocs/getting-started.html 2013-08-31 16:07:56 +0000 |
1092 | @@ -53,7 +53,7 @@ |
1093 | |
1094 | <section id="content" class="container-12"> |
1095 | <div class="grid-12 doc-container"> |
1096 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
1097 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
1098 | <div class="grid-9 doc-content"> |
1099 | <article> |
1100 | <section id="intro"> |
1101 | @@ -61,10 +61,9 @@ |
1102 | <p>This tutorial will show you how to get started with Juju, including installing, configuring and bootstrapping a new Juju environment. |
1103 | Before you start you will need:</p> |
1104 | <ul> |
1105 | - <li> An Ubuntu or OSX machine to install the client on.</li> |
1106 | - <li> An environment which can provide a new server with an Ubuntu cloud operating system image on-demand. This includes services such as Amazon EC2, HP Cloud, an OpenStack installation, or your local machine</li> |
1107 | - <li> An SSH key-pair. If you have not already set one up, you can generate an appropriate keypair with:</li> |
1108 | - <pre>ssh-keygen -t rsa -b 2048</pre> |
1109 | + <li>An Ubuntu or OSX machine to install the client on.</li> |
1110 | + <li>An environment which can provide a new server with an Ubuntu cloud operating system image on-demand. This includes services such as Amazon EC2, HP Cloud, an OpenStack installation, or your local machine</li> |
1111 | + <li>An SSH key-pair. If you have not already set one up, you can generate an appropriate keypair with: <code>ssh-keygen -t rsa -b 2048</code></li> |
1112 | </ul> |
1113 | </section> |
1114 | <section id="install"> |
1115 | @@ -77,12 +76,12 @@ |
1116 | <div class="terminal-wrap"> |
1117 | <div data-section="ubuntu"> |
1118 | <p>To install Juju, you simply need to grab the latest juju-core package from the PPA:</p> |
1119 | - <pre>sudo add-apt-repository ppa:juju/stable |
1120 | - sudo apt-get update && sudo apt-get install juju-core</pre> |
1121 | + <pre class="prettyprint lang-bash">sudo add-apt-repository ppa:juju/stable |
1122 | +sudo apt-get update && sudo apt-get install juju-core</pre> |
1123 | </div> |
1124 | <div data-section="macosx"> |
1125 | <p>Juju is in <a href="http://brew.sh/">Homebrew</a>, to install do:</p> |
1126 | - <pre>brew install juju</pre> |
1127 | + <pre class="prettyprint lang-bash">brew install juju</pre> |
1128 | |
1129 | <p>You can grab the latest pre-relase OSX client from our <a href="https://github.com/juju/juju-core/releases">Github Page</a>. Uncompress the tarball, then you can run the <code>juju</code> command from the terminal. We're in the process of testing these builds to be production ready, so if you have a problem please <a href="https://bugs.launchpad.net/juju-core/+filebug">file a bug</a>.</p> |
1130 | |
1131 | @@ -106,9 +105,9 @@ |
1132 | |
1133 | <p>Now the Juju software is installed, it needs to be configured to use your particular cloud provider. This is done by generating and editing a file, "environments.yaml", which will live in your ~/.juju/ directory. You can generate the environments file manually, but Juju also includes a boilerplate configuration option that will flesh out most of the file for you and minimise the amount of work (and potential errors).</p> |
1134 | <p>To generate an initial config file, you simply need to run:</p> |
1135 | - <pre><code>juju generate-config -w</code></pre> |
1136 | + <pre class="prettyprint lang-bash">juju init</pre> |
1137 | |
1138 | - <p>The -w switch causes the file to be written to your ~/.juju directory if an environments.yaml file does not already exist. It will also create the ~./juju directory if that does not exist.</p> |
1139 | + <p>This command will cause a file to be written to your ~/.juju directory if an environments.yaml file does not already exist. It will also create the ~./juju directory if that does not exist.</p> |
1140 | <p>This file will contain sample profiles for different types of cloud services, but you will need to edit the files to provide specific information for your cloud provider. Sections are created for Amazon (AWS) services, HPCloud and a generic OpenStack instance. For more specifics on what needs to be changed, see the relevant sections below.</p> |
1141 | <ul> |
1142 | <li><a href="config-aws.html">Configuring for Amazon AWS</a></li> |
1143 | @@ -123,84 +122,81 @@ |
1144 | <p>Once you have installed and configured Juju, it is probably a good idea to take it for a bit of a test drive and check that everything is working as expected. Because Juju makes it really easy to deploy services, this is actually quick and straightforward.</p> |
1145 | |
1146 | <aside> |
1147 | - <iframe class="youtube-player" type="text/html" width="400" height="300" src="//www.youtube.com/embed/0AT6qKyam9I" frameborder="0"> |
1148 | - </iframe> |
1149 | + <iframe class="youtube-player" type="text/html" width="400" height="300" src="//www.youtube.com/embed/0AT6qKyam9I" frameborder="0"></iframe> |
1150 | </aside> |
1151 | |
1152 | <p> The first thing to do is set up a bootstrap environment. This is an instance in the cloud that Juju will use to deploy and control other services with. It will be created according to the configuration you have provided, and your SSH key will automatically be uploaded so that Juju can communicate securely with the bootstrap instance. </p> |
1153 | |
1154 | - <pre>juju bootstrap </pre> |
1155 | + <pre class="prettyprint">juju bootstrap</pre> |
1156 | |
1157 | - <p class="note"><strong>Note:</strong> If you have multiple environments configured, you can choose which one to address with a particular command by adding the -e switch followed by the environment name, E.g. "-e hpcloud".</p> |
1158 | + <p class="note"><strong>Note:</strong> If you have multiple environments configured, you can choose which one to address with a particular command by adding the <code>-e</code> switch followed by the environment name, E.g. <code>-e hpcloud</code>. Read more about <a href="config-environments.html">environment switching</a></p> |
1159 | |
1160 | <p>You may have to wait a few moments for this command to return, as it needs to perform various tasks and contact your cloud provider. </p> |
1161 | <p>Assuming it returns successfully (otherwise see <a href="#errors">common error messages and what to do about them</a>), we can now deploy some services and explore the basic operations of Juju.</p> |
1162 | <p>To start with, we will deploy Wordpress, by running this command:</p> |
1163 | - <pre>juju deploy wordpress</pre> |
1164 | + <pre class="prettyprint lang-bash">juju deploy wordpress</pre> |
1165 | <p>Now juju will fetch the Wordpress charm and use it, through the bootstrap instance to request and deploy whatever resources it needs to set up this service.</p> |
1166 | <p>Wordpress needs a database though, so we will also deploy one of those:</p> |
1167 | - <pre>juju deploy mysql</pre> |
1168 | + <pre class="prettyprint">juju deploy mysql</pre> |
1169 | <p>Once again, juju will do whatever is necessary to deploy this service for you, and it may take some time for the command to return.</p> |
1170 | <p class="note"><strong>Note:</strong> If you want to get more information on what is actually happening, or to help resolve problems, you can add the -v switch to the juju command to get verbose output.</p> |
1171 | <p>Although we have deployed Wordpress and a MySQL database, they are not linked together in any way yet. To do this we should run:</p> |
1172 | |
1173 | - <pre>juju add-relation wordpress mysql</pre> |
1174 | + <pre class="prettyprint">juju add-relation wordpress mysql</pre> |
1175 | |
1176 | <p>This command uses information provided by the relevant charms to associate these services with each other in whatever way makes sense. There is much more to be said about linking services together which <a href="#add-relation">is covered in the juju command documentation</a>, but for the moment, we just need to know that it will link these services together.</p> |
1177 | <p>In order to make our Wordpress public, we now need to expose this service:<p> |
1178 | - <pre>juju expose wordpress</pre> |
1179 | + <pre class="prettyprint">juju expose wordpress</pre> |
1180 | <p>This service will now be configured to respond to web requests, so visitors can see it. But where exactly is it? If we run the juju status command, we will be able to see what services are running, and where they are located.<p> |
1181 | - <pre>juju status</pre> |
1182 | + <pre class="prettyprint">juju status</pre> |
1183 | <p>The output from this command should look something like this:</p> |
1184 | - <pre><code> |
1185 | - $juju status |
1186 | - machines: |
1187 | - "0": |
1188 | - agent-state: started |
1189 | - agent-version: 1.10.0 |
1190 | - dns-name: ec2-50-16-167-135.compute-1.amazonaws.com |
1191 | - instance-id: i-781bf614 |
1192 | - series: precise |
1193 | - "1": |
1194 | - agent-state: started |
1195 | - agent-version: 1.10.0 |
1196 | - dns-name: ec2-23-22-225-54.compute-1.amazonaws.com |
1197 | - instance-id: i-9e8927f6 |
1198 | - series: precise |
1199 | - "2": |
1200 | - agent-state: started |
1201 | - agent-version: 1.10.0 |
1202 | - dns-name: ec2-54-224-220-210.compute-1.amazonaws.com |
1203 | - instance-id: i-5c440436 |
1204 | - series: precise |
1205 | - services: |
1206 | - mysql: |
1207 | - charm: cs:precise/mysql-18 |
1208 | - exposed: false |
1209 | - relations: |
1210 | - db: |
1211 | - - wordpress |
1212 | - units: |
1213 | - mysql/0: |
1214 | - agent-state: started |
1215 | - agent-version: 1.10.0 |
1216 | - machine: "1" |
1217 | - public-address: ec2-23-22-225-54.compute-1.amazonaws.com |
1218 | - wordpress: |
1219 | - charm: cs:precise/wordpress-12 |
1220 | - exposed: true |
1221 | - relations: |
1222 | - db: |
1223 | - - mysql |
1224 | - loadbalancer: |
1225 | - - wordpress |
1226 | - units: |
1227 | - wordpress/0: |
1228 | - agent-state: started |
1229 | - agent-version: 1.10.0 |
1230 | - machine: "2" |
1231 | - public-address: ec2-54-224-220-210.compute-1.amazonaws.com |
1232 | - </code></pre> |
1233 | + <pre class="prettyprint lang-yaml"> |
1234 | +machines: |
1235 | + "0": |
1236 | + agent-state: started |
1237 | + agent-version: 1.10.0 |
1238 | + dns-name: ec2-50-16-167-135.compute-1.amazonaws.com |
1239 | + instance-id: i-781bf614 |
1240 | + series: precise |
1241 | + "1": |
1242 | + agent-state: started |
1243 | + agent-version: 1.10.0 |
1244 | + dns-name: ec2-23-22-225-54.compute-1.amazonaws.com |
1245 | + instance-id: i-9e8927f6 |
1246 | + series: precise |
1247 | + "2": |
1248 | + agent-state: started |
1249 | + agent-version: 1.10.0 |
1250 | + dns-name: ec2-54-224-220-210.compute-1.amazonaws.com |
1251 | + instance-id: i-5c440436 |
1252 | + series: precise |
1253 | +services: |
1254 | + mysql: |
1255 | + charm: cs:precise/mysql-18 |
1256 | + exposed: false |
1257 | + relations: |
1258 | + db: |
1259 | + - wordpress |
1260 | + units: |
1261 | + mysql/0: |
1262 | + agent-state: started |
1263 | + agent-version: 1.10.0 |
1264 | + machine: "1" |
1265 | + public-address: ec2-23-22-225-54.compute-1.amazonaws.com |
1266 | + wordpress: |
1267 | + charm: cs:precise/wordpress-12 |
1268 | + exposed: true |
1269 | + relations: |
1270 | + db: |
1271 | + - mysql |
1272 | + loadbalancer: |
1273 | + - wordpress |
1274 | + units: |
1275 | + wordpress/0: |
1276 | + agent-state: started |
1277 | + agent-version: 1.10.0 |
1278 | + machine: "2" |
1279 | + public-address: ec2-54-224-220-210.compute-1.amazonaws.com</pre> |
1280 | <p>There is quite a lot of information here. the first section, titled <strong>machines:</strong>, details all the instances which are currently running. For each you will see the version of Juju they are running, their hostname, instance id and the series or version of Ubuntu they are running.</p> |
1281 | <p>After that, the sections list the services which are currently deployed. The information here differs slightly according to the service and how it is configured. It will however, always list the charm that was used to deploy the service, whether it is exposed or not, its address and whatever relationships exist.</p> |
1282 | <p>From this status readout, we can see that wordpress is exposed and ready. If we simply copy the address into a web browser, we should be able to see it running</p> |
1283 | @@ -208,7 +204,7 @@ |
1284 | <p>Congratulations, you have just deployed a service with Juju!</p> |
1285 | <p>Now you are ready to deploy whatever service you really want from the 100s available at the <a href="http://jujucharms.com">Juju Charm Store.</a></p> |
1286 | <p>To remove all current deployments and clear up everything in your cloud, you can run the command:</p> |
1287 | - <pre><code>juju destroy-environment </code></pre> |
1288 | + <pre class="prettyprint">juju destroy-environment</pre> |
1289 | <p>This will remove everything, including the bootstrap node.</p> |
1290 | <p>To learn more about charms, including configuring options and managing running systems, you should continue to <a href="./charms.html">read the charm documentation.</a></p> |
1291 | </section> |
1292 | @@ -269,6 +265,7 @@ |
1293 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
1294 | </div> |
1295 | </div> |
1296 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
1297 | </footer> |
1298 | |
1299 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
1300 | |
1301 | === modified file 'htmldocs/glossary.html' |
1302 | --- htmldocs/glossary.html 2013-08-22 13:55:23 +0000 |
1303 | +++ htmldocs/glossary.html 2013-08-31 16:07:56 +0000 |
1304 | @@ -68,19 +68,17 @@ |
1305 | |
1306 | <p><strong>Charm URL</strong> - A Charm URL is a resource locator for a charm, with the following format and restrictions:</p> |
1307 | |
1308 | - <pre><code> |
1309 | - <schema>:[~<user>/]<collection>/<name>[-<revision>] |
1310 | - </code></pre> |
1311 | - |
1312 | - <p><span class="pre">schema</span> must be either "cs", for a charm from the Juju charm store, or "local", for a charm from a local repository.</p> |
1313 | - |
1314 | - <p><span class="pre">user</span> is only valid in charm store URLs, and allows you to source charms from individual users (rather than from the main charm store); it must be a valid Launchpad user name.</p> |
1315 | - |
1316 | - <p><span class="pre">collection</span> denotes a charm's purpose and status, and is derived from the Ubuntu series targeted by its contained charms: examples include "precise", "quantal", "oneiric-universe".</p> |
1317 | - |
1318 | - <p><span class="pre">name</span> is just the name of the charm; it must start and end with lowercase (ascii) letters, and can otherwise contain any combination of lowercase letters, digits, and "-"s.</p> |
1319 | - |
1320 | - <p><span class="pre">revision</span>, if specified, points to a specific revision of the charm pointed to by the rest of the URL. It must be a non-negative integer.</p> |
1321 | + <pre class="prettyprint"><schema>:[~<user>/]<collection>/<name>[-<revision>]</pre> |
1322 | + |
1323 | + <p><code>schema</code> must be either "cs", for a charm from the Juju charm store, or "local", for a charm from a local repository.</p> |
1324 | + |
1325 | + <p><code>user</code> is only valid in charm store URLs, and allows you to source charms from individual users (rather than from the main charm store); it must be a valid Launchpad user name.</p> |
1326 | + |
1327 | + <p><code>collection</code> denotes a charm's purpose and status, and is derived from the Ubuntu series targeted by its contained charms: examples include "precise", "quantal", "oneiric-universe".</p> |
1328 | + |
1329 | + <p><code>name</code> is just the name of the charm; it must start and end with lowercase (ascii) letters, and can otherwise contain any combination of lowercase letters, digits, and "-"s.</p> |
1330 | + |
1331 | + <p><code>revision</code>, if specified, points to a specific revision of the charm pointed to by the rest of the URL. It must be a non-negative integer.</p> |
1332 | |
1333 | <p><strong>Repository </strong> - A location where multiple charms are stored. Repositories may be as simple as a directory structure on a local disk, or as complex as a rich smart server supporting remote searching and so on. </p> |
1334 | |
1335 | @@ -165,6 +163,7 @@ |
1336 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
1337 | </div> |
1338 | </div> |
1339 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
1340 | </footer> |
1341 | |
1342 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
1343 | |
1344 | === modified file 'htmldocs/howto-node.html' |
1345 | --- htmldocs/howto-node.html 2013-08-30 21:17:34 +0000 |
1346 | +++ htmldocs/howto-node.html 2013-08-31 16:07:56 +0000 |
1347 | @@ -84,58 +84,43 @@ |
1348 | <p> |
1349 | First, create a <code>config.yaml</code> to add info about your app pointing to your github repo: |
1350 | </p> |
1351 | - <pre> |
1352 | -<code>sample-node: |
1353 | - repo: https://github.com/yourapplication</code> |
1354 | -</pre> |
1355 | + <pre class="prettyprint lang-yaml"> |
1356 | +sample-node: |
1357 | + repo: https://github.com/yourapplication</pre> |
1358 | <p> |
1359 | If you have not already bootstrapped an environment, do so: |
1360 | </p> |
1361 | - <pre> |
1362 | -<code>juju bootstrap</code> |
1363 | -</pre> |
1364 | + <pre class="prettyprint">juju bootstrap</pre> |
1365 | <p> |
1366 | Then wait a few minutes while your cloud spins up. Then deploy some basic services: |
1367 | </p> |
1368 | - <pre> |
1369 | -<code>juju deploy node-app myapp |
1370 | + <pre class="prettyprint">juju deploy node-app myapp |
1371 | juju deploy mongodb |
1372 | -juju deploy haproxy</code> |
1373 | -</pre> |
1374 | +juju deploy haproxy</pre> |
1375 | <p> |
1376 | relate them |
1377 | </p> |
1378 | - <pre> |
1379 | -<code>juju add-relation mongodb myapp |
1380 | -juju add-relation myapp haproxy</code> |
1381 | -</pre> |
1382 | + <pre class="prettyprint">juju add-relation mongodb myapp |
1383 | +juju add-relation myapp haproxy</pre> |
1384 | <p> |
1385 | open it up to the outside world |
1386 | </p> |
1387 | - <pre> |
1388 | -<code>juju expose haproxy</code> |
1389 | -</pre> |
1390 | + <pre class="prettyprint">juju expose haproxy</pre> |
1391 | <p> |
1392 | Find the haproxy instance's public URL from |
1393 | </p> |
1394 | - <pre> |
1395 | -<code>juju status</code> |
1396 | -</pre> |
1397 | + <pre class="prettyprint">juju status</pre> |
1398 | <p> |
1399 | (or attach it to an elastic IP via the AWS console) and open it up in a browser. |
1400 | </p> |
1401 | <p> |
1402 | scale up your app (to 10 nodes for example) |
1403 | </p> |
1404 | - <pre> |
1405 | -<code>juju add-unit -n 10 myapp</code> |
1406 | -</pre> |
1407 | + <pre class="prettyprint">juju add-unit -n 10 myapp</pre> |
1408 | <p> |
1409 | and scale it back down |
1410 | </p> |
1411 | - <pre> |
1412 | -<code>juju remove-unit -n9 myapp</code> |
1413 | -</pre> |
1414 | + <pre class="prettyprint">juju remove-unit myapp/9 myapp/8 myapp/7 myapp/6 myapp/5 myapp/4 myapp/3 myapp/2 myapp/1</pre> |
1415 | <h2 id="local-to-cloud-workflow"> |
1416 | Local to Cloud Workflow |
1417 | </h2> |
1418 | @@ -165,30 +150,24 @@ |
1419 | <p> |
1420 | In this example the local environment is named <code>local</code> and we'll deploy to an AWS environment called <code>amazon</code>. First let's <code>switch</code> to the local environment and bootstrap. |
1421 | </p> |
1422 | - <pre> |
1423 | -<code>juju switch local |
1424 | -juju bootstrap</code> |
1425 | -</pre> |
1426 | + <pre class="prettyprint">juju switch local |
1427 | +juju bootstrap</pre> |
1428 | <p> |
1429 | Create a <code>config.yaml</code> to add info about your app pointing to your github repo: |
1430 | </p> |
1431 | - <pre> |
1432 | -<code>sample-node: |
1433 | - app_url: https://github.com/yourapplication</code> |
1434 | -</pre> |
1435 | + <pre class="prettyprint lang-yaml"> |
1436 | +sample-node: |
1437 | + app_url: https://github.com/yourapplication</pre> |
1438 | <p> |
1439 | Then deploy some basic services: |
1440 | </p> |
1441 | - <pre> |
1442 | -<code>juju deploy --config ~/myapp.yaml node-app myapp |
1443 | -juju deploy mongodb</code> |
1444 | -</pre> |
1445 | + <pre class="prettyprint"> |
1446 | +juju deploy --config ~/myapp.yaml node-app myapp |
1447 | +juju deploy mongodb</pre> |
1448 | <p> |
1449 | relate them |
1450 | </p> |
1451 | - <pre> |
1452 | -<code>juju add-relation mongodb myapp</code> |
1453 | -</pre> |
1454 | + <pre class="prettyprint">juju add-relation mongodb myapp</pre> |
1455 | <p> |
1456 | Now open up your browser and go to <code>http://localhost</code> to get your application loaded in your browser. |
1457 | </p> |
1458 | @@ -198,9 +177,7 @@ |
1459 | <p> |
1460 | Continue to write your code, push to git as you land features and fixes. When you're ready to test it you can tell Juju to check the git repository again: |
1461 | </p> |
1462 | - <pre> |
1463 | -<code>juju set myapp app_branch=https://github.com/yourapplication</code> |
1464 | -</pre> |
1465 | + <pre class="prettyprint">juju set myapp app_branch=https://github.com/yourapplication</pre> |
1466 | <p> |
1467 | The charm will then fetch the latest code and you can refresh your browser at <code>http://localhost</code>. |
1468 | </p> |
1469 | @@ -213,35 +190,29 @@ |
1470 | <p> |
1471 | After you've repeatedly upgraded your application locally it's time to push it out to a place where your coworkers can see your app in all it's glory, let's push this to AWS. Same exact commands as before, just to a different environment: |
1472 | </p> |
1473 | - <pre> |
1474 | -<code>juju switch amazon |
1475 | + <pre class="prettyprint"> |
1476 | +juju switch amazon |
1477 | juju bootstrap |
1478 | juju deploy --config ~/myapp.yaml node-app myapp |
1479 | juju deploy mongodb |
1480 | -juju add-relation mongodb myapp</code> |
1481 | -</pre> |
1482 | +juju add-relation mongodb myapp</pre> |
1483 | <p> |
1484 | Since we're on a public cloud and not on a local provider we need to explicitly expose the service and get its public IP: |
1485 | </p> |
1486 | - <pre> |
1487 | -<code>juju expose myapp |
1488 | -juju status myapp</code> |
1489 | -</pre> |
1490 | + <pre class="prettyprint">juju expose myapp |
1491 | +juju status myapp</pre> |
1492 | <p> |
1493 | And put the ec2 URL in your browser. If you want to enable some horizontal scalability to your application you can do so, even after you've deployed! |
1494 | </p> |
1495 | - <pre> |
1496 | -<code>juju deploy haproxy |
1497 | + <pre class="prettyprint"> |
1498 | +juju deploy haproxy |
1499 | juju add-relation haproxy myapp |
1500 | juju expose haproxy |
1501 | -juju unexpose myapp</code> |
1502 | -</pre> |
1503 | +juju unexpose myapp</pre> |
1504 | <p> |
1505 | And then get the public IP from the haproxy instead (notice how we've unexposed your application so that only haproxy is serving the public internet): |
1506 | </p> |
1507 | - <pre> |
1508 | -<code>juju status haproxy</code> |
1509 | -</pre> |
1510 | + <pre class="prettyprint">juju status haproxy</pre> |
1511 | <p> |
1512 | Now you can <code>juju add-unit myapp</code> and <code>juju remove-unit myapp</code> based on load. |
1513 | </p> |
1514 | @@ -251,10 +222,9 @@ |
1515 | <p> |
1516 | The local containers survive reboots and do not go away until you explicitly tear the environment down. Now that your coworkers have seen your great application let's also stop spending money: |
1517 | </p> |
1518 | - <pre> |
1519 | -<code>juju destroy-environment -eamazon |
1520 | -juju destroy-environment -local</code> |
1521 | -</pre> |
1522 | + <pre class="prettyprint"> |
1523 | +juju destroy-environment -e amazon |
1524 | +juju destroy-environment -e local</pre> |
1525 | <h2 id="charm-details"> |
1526 | Charm Details |
1527 | </h2> |
1528 | @@ -294,9 +264,7 @@ |
1529 | <p> |
1530 | Configurable aspects of the charm are listed in <code>config.yaml</code> and can be set by either editing the default values directly in the yaml file or passing a <code>myapp.yaml</code> configuration file during deployment |
1531 | </p> |
1532 | - <pre> |
1533 | -<code>juju deploy --config ~/myapp.yaml node-app myapp</code> |
1534 | -</pre> |
1535 | + <pre class="prettyprint">juju deploy --config ~/myapp.yaml node-app myapp</pre> |
1536 | <p> |
1537 | Some of these parameters are used directly by the charm, and some are passed through to the node app using <code>config/config.js</code>. |
1538 | </p> |
1539 | @@ -306,52 +274,45 @@ |
1540 | <p> |
1541 | The formula looks for <code>config/config.js</code> in your app which starts off looking something like this |
1542 | </p> |
1543 | - <pre> |
1544 | -<code>module.exports = config = { |
1545 | + <pre class="prettyprint"> |
1546 | +module.exports = config = { |
1547 | "name" : "mynodeapp" |
1548 | ,"listen_port" : 8000 |
1549 | ,"mongo_host" : "localhost" |
1550 | ,"mongo_port" : 27017 |
1551 | -}</code> |
1552 | -</pre> |
1553 | +}</pre> |
1554 | <p> |
1555 | and gets modified with contextually correct configuration information during either deployment (via the <code>install</code> hook) or relation to another service (<code>relation-changed</code> hook). |
1556 | </p> |
1557 | <p> |
1558 | This config can be used from within your application using snippets like |
1559 | </p> |
1560 | - <pre> |
1561 | -<code>... |
1562 | + <pre class="prettyprint lang-js"> |
1563 | +... |
1564 | var config = require('./config/config') |
1565 | ... |
1566 | new mongo.Server(config.mongo_host, config.mongo_port, {}), |
1567 | ... |
1568 | server.listen(config.listen_port); |
1569 | -...</code> |
1570 | -</pre> |
1571 | +...</pre> |
1572 | <p> |
1573 | Alternatively you could use a “Procfile†in root directory like this: |
1574 | </p> |
1575 | - <pre> |
1576 | -<code>web: node app.js</code> |
1577 | -</pre> |
1578 | + <pre class="prettyprint lang-js">web: node app.js</pre> |
1579 | <p> |
1580 | and then get the environment variables from the running environment like this: |
1581 | </p> |
1582 | - <pre> |
1583 | -<code>app.set('port', process.env.PORT);</code> |
1584 | -</pre> |
1585 | + <pre class="prettyprint lang-js">app.set('port', process.env.PORT);</pre> |
1586 | <p> |
1587 | The defined environment variables are: |
1588 | </p> |
1589 | - <pre> |
1590 | -<code>NAME |
1591 | + <pre class="prettyprint"> |
1592 | +NAME |
1593 | PORT |
1594 | NODE_ENV |
1595 | MONGO_HOST |
1596 | MONGO_PORT |
1597 | -MONGO_REPLSET</code> |
1598 | -</pre> |
1599 | +MONGO_REPLSET</pre> |
1600 | <h3 id="network-access"> |
1601 | Network access |
1602 | </h3> |
1603 | @@ -361,15 +322,11 @@ |
1604 | <p> |
1605 | If your node app is itself a proxy and you want it directly exposed, this can easily be done by adding |
1606 | </p> |
1607 | - <pre> |
1608 | -<code>open-port $app_port</code> |
1609 | -</pre> |
1610 | + <pre class="prettyprint">open-port $app_port</pre> |
1611 | <p> |
1612 | to the bottom of the <code>install</code> hook, and then once your stack is started, you expose |
1613 | </p> |
1614 | - <pre> |
1615 | -<code>juju expose myapp</code> |
1616 | -</pre> |
1617 | + <pre class="prettyprint">juju expose myapp</pre> |
1618 | <p> |
1619 | it to the outside world. |
1620 | </p> |
1621 | @@ -442,6 +399,7 @@ |
1622 | <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p> |
1623 | </div> |
1624 | </div> |
1625 | + <script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?skin=sunburst"></script> |
1626 | </footer> |
1627 | |
1628 | <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> |
1629 | |
1630 | === modified file 'htmldocs/reference-constraints.html' |
1631 | --- htmldocs/reference-constraints.html 2013-08-30 17:35:59 +0000 |
1632 | +++ htmldocs/reference-constraints.html 2013-08-31 16:07:56 +0000 |
1633 | @@ -53,10 +53,9 @@ |
1634 | |
1635 | <section id="content" class="container-12"> |
1636 | <div class="grid-12 doc-container"> |
1637 | - <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
1638 | + <div id="navlinks" class="grid-3 doc-navigation">LINKS</div> |
1639 | <div class="grid-9 doc-content"> |
1640 | <article> |
1641 | - |
1642 | <section id="constraints"> |
1643 | <h1>Constraints</h1> |
1644 |