Merge lp:~mark-mims/juju-core/docs-service-groups into lp:juju-core/docs

Proposed by Mark Mims
Status: Merged
Approved by: Nick Veitch
Approved revision: no longer in the source branch.
Merged at revision: 87
Proposed branch: lp:~mark-mims/juju-core/docs-service-groups
Merge into: lp:juju-core/docs
Diff against target: 303 lines (+276/-1)
3 files modified
htmldocs/charms-service-groups.html (+273/-0)
htmldocs/navigation.html (+1/-0)
htmldocs/navigation.json (+2/-1)
To merge this branch: bzr merge lp:~mark-mims/juju-core/docs-service-groups
Reviewer Review Type Date Requested Status
Jorge Castro (community) Approve
Review via email: mp+183264@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jorge Castro (jorge) wrote :

LGTM, +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'htmldocs/charms-service-groups.html'
--- htmldocs/charms-service-groups.html 1970-01-01 00:00:00 +0000
+++ htmldocs/charms-service-groups.html 2013-08-30 19:55:54 +0000
@@ -0,0 +1,273 @@
1<!DOCTYPE html>
2<html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>Juju Documentation - Groups of Services</title>
6 <link href='https://fonts.googleapis.com/css?family=Ubuntu:400,300,300italic,400italic,700,700italic|Ubuntu+Mono' rel='stylesheet' type='text/css' />
7 <link rel="stylesheet" type="text/css" media="screen" href="//juju.ubuntu.com/wp-content/themes/juju-website/css/reset.css" />
8 <link rel="stylesheet" type="text/css" media="screen" href="//juju.ubuntu.com/wp-content/themes/juju-website/css/960.css" />
9 <link rel="stylesheet" type="text/css" media="screen" href="//juju.ubuntu.com/wp-content/themes/juju-website/css/base.css" />
10 <link rel="stylesheet" type="text/css" media="screen" href="//juju.ubuntu.com/wp-content/themes/juju-website/css/home-new.css" />
11 <link rel='stylesheet' id='stacktack-css' href='//juju.ubuntu.com/wp-content/plugins/stacktack/css/stacktack.min.css?ver=3.4.2' type='text/css' media='all' />
12 <link href="css/main.css?1375975745" rel="stylesheet" type="text/css"/>
13
14 <!--[if lt IE 9]>
15 <script type="text/javascript" src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
16 <![endif]-->
17</head>
18 <body class="resources">
19 <header class="global clearfix" role="banner">
20 <div class="header-navigation">
21 <div>
22 <nav role="navigation">
23 <ul>
24 <li class="page_item page-item-6"><a href="https://juju.ubuntu.com/">Home</a></li>
25 <li class="page_item page-item-7"><a href="https://juju.ubuntu.com/get-started/">Get started</a></li>
26 <li class="page_item page-item-9 current_page_item"><a href="https://juju.ubuntu.com/resources/">Resources</a></li>
27 <li class="page_item page-item-13"><a href="https://juju.ubuntu.com/community/">Community</a></li>
28 <li class="page_item page-item-3688"><a href="https://juju.ubuntu.com/charm-store/">Charm Store</a></li>
29 <li class="page_item page-item-3691"><a href="https://juju.ubuntu.com/events/">Events</a></li>
30 <li class="page_item page-item-4474"><a href="https://juju.ubuntu.com/charm-championship/">Charm Championship</a></li>
31 <li class="page_item page-item-4249"><a href="https://juju.ubuntu.com/survey/">Survey</a></li>
32 <li>
33 <form id="form-search" method="get" action="https://juju.ubuntu.com/">
34 <fieldset>
35 <input id="input-search" type="text" name="s" value="Search" />
36 </fieldset>
37 </form>
38 </li>
39 </ul>
40 </nav>
41 </div>
42 </div>
43 <div class="header-content">
44 <div class="clearfix">
45 <img src="https://juju.ubuntu.com/wp-content/themes/juju-website/img/arrow-nav.png" width="9" height="5" style="left:455px; display: block;" class="arrow-nav">
46 <div class="header-navigation-secondary"></div>
47 <div class="header-image"></div>
48 <h1>Resources</h1>
49 <h2>A collection of some of the most important online references for Juju users and developers.</h2>
50 </div>
51 </div>
52</header>
53
54 <section id="content" class="container-12">
55 <div class="grid-12 doc-container">
56 <div id="navlinks" class="grid-3 doc-navigation">LINKS</div>
57 <div class="grid-9 doc-content">
58 <article>
59
60
61<!--Actual docs start here-->
62
63 <section id="service-groups">
64 <h1>Groups of Services</h1>
65 <p></p>
66
67 <p>
68 Juju deploys units of a service from a charm.
69 The simplest way to do this is
70 </p>
71
72<pre class="prettyprint">
73juju deploy mysql
74</pre>
75
76 <p>
77 which will take the latest version of the mysql charm straight from the store and create a single service unit.
78 </p>
79
80 <p>
81 By default, juju creates a unit of a service named after the charm... "mysql" in the above example.
82 </p>
83
84 <p>
85 You can specify the name for the service when deploying
86 </p>
87
88<pre class="prettyprint">
89juju deploy mysql wikidb
90</pre>
91
92 <p>
93 which will create a unit of the "wikidb" service.
94 </p>
95
96 <p>
97 Why specify names for services? The simplest reason is organizational... it let's you stay organized as your infrastructure gets more complex:
98 </p>
99
100<pre class="prettyprint">
101juju deploy mysql website-db
102juju deploy mysql app-master-db
103juju deploy mysql app-slave-db -n2
104</pre>
105
106 <p>
107 But there're other reasons to do this... namely service groups. Really service groups are nothing other than named services.
108 They're called out as a separate feature because they're quite useful in a few different ways.
109 </p>
110
111 <h2>Roles</h2>
112
113 <p>
114 Some services acquire a role at runtime based on the relations that are joined.
115 </p>
116
117 <p>
118 A great example of this is the hadoop charm. It can instantiate services
119 </p>
120
121<pre class="prettyprint">
122juju deploy hadoop namenode
123juju deploy hadoop datacluster -n40
124</pre>
125
126 <p>
127 which are identical at this point except for the service name that juju's using for the various units.
128 </p>
129
130 <p>
131 The services these acquire roles at relation-time via
132 </p>
133
134<pre class="prettyprint">
135juju add-relation namenode:namenode datacluster:datanode
136juju add-relation namenode:jobtracker datacluster:tasktracker
137</pre>
138
139 <p>
140 The relations determine the service role.
141 </p>
142
143 <p>
144 Another example of this is mysql replication.
145 </p>
146
147<pre class="prettyprint">
148juju deploy mysql masterdb
149juju deploy mysql slavedb -n2
150</pre>
151
152 <p>
153 where the different services are related to each other
154 </p>
155
156<pre class="prettyprint">
157juju add-relation masterdb:master slavedb:slave
158</pre>
159
160 <p>
161 and to other services via
162 </p>
163
164<pre class="prettyprint">
165juju deploy mediawiki mywiki
166juju add-relation mywiki:db masterdb:db
167juju add-relation mywiki:slave slavedb:db
168</pre>
169
170 <h2>Upgrade Groups and/or Config Groups</h2>
171
172 <p>
173 There are also interesting use-cases for breaking large services down into separate groups of units.
174 Instead of a single 5000-node hadoop service named <em>hadoop-slave</em>, you might build that cluster
175 from multiple smaller service groups.
176 </p>
177
178<pre class="prettyprint">
179juju deploy hadoop hadoop-master
180juju deploy hadoop hadoop-slave-A -n2500
181juju deploy hadoop hadoop-slave-B -n2500
182juju add-relation hadoop-master:namenode hadoop-slave-A:datanode
183juju add-relation hadoop-master:namenode hadoop-slave-B:datanode
184...
185</pre>
186
187 <p>
188 These service groups can be managed independently by juju for upgrades and configuration
189 </p>
190
191<pre class="prettyprint">
192juju set hadoop-slave-B some_param=new_value
193</pre>
194
195 <p>
196 This technique can potentially be a way juju can manage rolling upgrades for a service.
197 Of course, this depends heavily on the services in question and how well they support
198 version management, schema changes, etc.
199 </p>
200
201
202 </section>
203
204 <!--Actual docs end here-->
205
206
207
208 </article>
209 </div>
210 </div>
211 </section>
212 <div class="shadow"></div>
213 <footer class="global clearfix" role="contentinfo">
214 <div class="row">
215 <div class="inner-wrapper">
216 <nav role="navigation" class="clearfix">
217 <ul class="footer-a">
218 <li class="grid-3 first-col">
219 <h4><a href="/get-started">Get started</a></h4>
220 <ul>
221 <li class="page_item page-item-20"><a href="https://juju.ubuntu.com/get-started/local/">Local</a></li>
222 <li class="page_item page-item-22"><a href="https://juju.ubuntu.com/get-started/amazon/">Amazon Web Services</a></li>
223 <li class="page_item page-item-18"><a href="https://juju.ubuntu.com/get-started/hp-cloud/">HP Cloud</a></li>
224 <li class="page_item page-item-16"><a href="https://juju.ubuntu.com/get-started/rackspace/">Rackspace</a></li>
225 <li class="page_item page-item-3596"><a href="https://juju.ubuntu.com/get-started/openstack/">Openstack</a></li>
226 <li class="page_item page-item-3600"><a href="https://juju.ubuntu.com/get-started/maas/">MAAS</a></li>
227 </ul>
228 </li>
229 <li class="grid-3">
230 <h4><a href="/resources">Resources</a></h4>
231 <ul>
232 <li><a href="http://juju.ubuntu.com/docs">Documentation</a></li>
233 <li><a href="/resources/videos/">Videos</a></li>
234 <li><a href="http://uistage.jujucharms.com:8080/">Juju GUI demo site</a></li>
235 </ul>
236 </li>
237 <li class="grid-3">
238 <h4><a href="/community">Community</a></h4>
239 <ul>
240 <li class="page_item page-item-28"><a href="https://juju.ubuntu.com/community/juju-blog/">Juju Blog</a></li>
241 <li class="page_item page-item-4262"><a href="https://juju.ubuntu.com/community/weekly-charm-meeting/">Weekly Charm Meeting</a></li>
242 <li class="page_item page-item-4036"><a href="https://juju.ubuntu.com/community/charmers/">Charmers</a></li>
243 <li><a href="https://lists.ubuntu.com/mailman/listinfo/juju">Mailing List</a></li>
244 <li><a href="http://webchat.freenode.net/?channels=juju">Chat</a></li>
245 <li><a href="http://askubuntu.com/questions/tagged/juju?sort=faq&pagesize=50">FAQ</a></li>
246 </ul>
247 </li>
248 <li class="grid-3 last-col">
249 <h4><a href="https://launchpad.net/juju">Code</a></h4>
250 <ul>
251 <li><a href="https://launchpad.net/juju-core">Juju Core</a></li>
252 <li><a href="https://launchpad.net/charms">Charms</a></li>
253 </ul>
254 </li>
255 </ul>
256 </nav>
257 </div>
258 </div>
259 <div class="row no-border">
260 <div class="legal inner-wrapper">
261 <p>&copy; 2013 Canonical Ltd. Ubuntu and Canonical are registered trademarks of Canonical Ltd.</p>
262 <p><a href="https://bugs.launchpad.net/juju-website/+filebug">Report a bug on this site</a></p>
263 </div>
264 </div>
265</footer>
266
267 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
268 <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js"></script>
269 <script src="//d38yea5fb4e2oh.cloudfront.net/jquery.stacktack.min.js"></script>
270 <script type="text/javascript" src="js/main.js"></script>
271 <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
272 </body>
273</html>
0274
=== modified file 'htmldocs/navigation.html'
--- htmldocs/navigation.html 2013-08-22 13:48:21 +0000
+++ htmldocs/navigation.html 2013-08-30 19:55:54 +0000
@@ -17,6 +17,7 @@
17 <li class=" sub"><a href="charms-exposing.html">Exposing Services</a></li>17 <li class=" sub"><a href="charms-exposing.html">Exposing Services</a></li>
18 <li class=" sub"><a href="charms-scaling.html">Scaling Services</a></li>18 <li class=" sub"><a href="charms-scaling.html">Scaling Services</a></li>
19 <li class=" sub"><a href="charms-destroy.html">Destroying Services</a></li>19 <li class=" sub"><a href="charms-destroy.html">Destroying Services</a></li>
20 <li class=" sub"><a href="charms-service-groups.html">Groups of Services</a></li>
20 </ul>21 </ul>
21 <h1>Charm Authors</h1>22 <h1>Charm Authors</h1>
22 <ul>23 <ul>
2324
=== modified file 'htmldocs/navigation.json'
--- htmldocs/navigation.json 2013-08-16 13:29:42 +0000
+++ htmldocs/navigation.json 2013-08-30 19:55:54 +0000
@@ -22,7 +22,8 @@
22 "Service Relationships": "charms-relationships.html",22 "Service Relationships": "charms-relationships.html",
23 "Exposing Services": "charms-exposing.html",23 "Exposing Services": "charms-exposing.html",
24 "Scaling Services": "charms-scaling.html",24 "Scaling Services": "charms-scaling.html",
25 "Destroying Services": "charms-destroy.html"25 "Destroying Services": "charms-destroy.html",
26 "Groups of Services": "charms-service-groups.html"
26 }27 }
27 }28 }
28 },29 },

Subscribers

People subscribed via source and target branches