1 | Fri Jul 9 18:33:59 BST 2010 writefaruq@gmail.com |
---|
2 | * enable_client_with_multi_introducer.dpatch |
---|
3 | Using this patch client can read a config file basedir/intoducers that contains the furls of introducers one per line. Client uses these furls along with the furl from tahoe.cfg to connect to the introducers. Statuses of these connections are listed in client's welcome page. |
---|
4 | |
---|
5 | Fri Jul 16 18:56:59 BST 2010 writefaruq@gmail.com |
---|
6 | * multiple-introducers-changes-in-architecture-configuration-running.dpatch |
---|
7 | docs/architecture.txt-configuration.txt-running.html: necessary changes for configuring/running multiple introducers. |
---|
8 | |
---|
9 | ***END# OF DESCRIPTION*** |
---|
10 | |
---|
11 | Place the long patch description above the ***END OF DESCRIPTION*** marker. |
---|
12 | The first line of this file will be the patch name. |
---|
13 | |
---|
14 | |
---|
15 | This patch contains the following changes: |
---|
16 | |
---|
17 | M ./docs/architecture.txt -2 +6 |
---|
18 | M ./docs/configuration.txt +6 |
---|
19 | M ./docs/running.html -1 +2 |
---|
20 | |
---|
21 | New patches: |
---|
22 | |
---|
23 | [enable_client_with_multi_introducer.dpatch |
---|
24 | writefaruq@gmail.com**20100709173359 |
---|
25 | Ignore-this: 2b4c9553b2c150ee8ba3c5d86cf148fd |
---|
26 | Using this patch client can read a config file basedir/intoducers that contains the furls of introducers one per line. Client uses these furls along with the furl from tahoe.cfg to connect to the introducers. Statuses of these connections are listed in client's welcome page. |
---|
27 | ] { |
---|
28 | hunk ./src/allmydata/client.py 34 |
---|
29 | TiB=1024*GiB |
---|
30 | PiB=1024*TiB |
---|
31 | |
---|
32 | +MULTI_INTRODUCERS_CFG = "introducers" |
---|
33 | + |
---|
34 | class StubClient(Referenceable): |
---|
35 | implements(RIStubClient) |
---|
36 | |
---|
37 | hunk ./src/allmydata/client.py 128 |
---|
38 | self.started_timestamp = time.time() |
---|
39 | self.logSource="Client" |
---|
40 | self.DEFAULT_ENCODING_PARAMETERS = self.DEFAULT_ENCODING_PARAMETERS.copy() |
---|
41 | - self.init_introducer_client() |
---|
42 | + self.init_introducer_clients() |
---|
43 | self.init_stats_provider() |
---|
44 | self.init_secrets() |
---|
45 | self.init_storage() |
---|
46 | hunk ./src/allmydata/client.py 175 |
---|
47 | if os.path.exists(os.path.join(self.basedir, "run_helper")): |
---|
48 | self.set_config("helper", "enabled", "true") |
---|
49 | |
---|
50 | - def init_introducer_client(self): |
---|
51 | - self.introducer_furl = self.get_config("client", "introducer.furl") |
---|
52 | - ic = IntroducerClient(self.tub, self.introducer_furl, |
---|
53 | + def init_introducer_clients(self): |
---|
54 | + # read first furl from tahoe.cfg |
---|
55 | + introducer_furl1 = self.get_config("client", "introducer.furl", None) |
---|
56 | + self.introducer_furls = [] |
---|
57 | + if introducer_furl1: |
---|
58 | + self.introducer_furls.append(introducer_furl1) |
---|
59 | + # read from ""BASEDIR/introducers" cfg file |
---|
60 | + cfg = os.path.join(self.basedir, MULTI_INTRODUCERS_CFG) |
---|
61 | + if os.path.exists(cfg): |
---|
62 | + f = open(cfg, 'r') |
---|
63 | + for introducer_furl in f.read().split('\n'): |
---|
64 | + if not introducer_furl.strip(): |
---|
65 | + continue |
---|
66 | + self.introducer_furls.append(introducer_furl) |
---|
67 | + f.close() |
---|
68 | + # create a pool of introducer_clients |
---|
69 | + self.introducer_clients = [] |
---|
70 | + for introducer_furl in self.introducer_furls: |
---|
71 | + ic = IntroducerClient(self.tub, introducer_furl, |
---|
72 | self.nickname, |
---|
73 | str(allmydata.__full_version__), |
---|
74 | str(self.OLDEST_SUPPORTED_VERSION)) |
---|
75 | hunk ./src/allmydata/client.py 197 |
---|
76 | - self.introducer_client = ic |
---|
77 | + self.introducer_clients.append(ic) |
---|
78 | + # init introducer_clients as usual |
---|
79 | + for ic in self.introducer_clients: |
---|
80 | + self.init_introducer_client(ic) |
---|
81 | + |
---|
82 | + def init_introducer_client(self, ic): |
---|
83 | # hold off on starting the IntroducerClient until our tub has been |
---|
84 | # started, so we'll have a useful address on our RemoteReference, so |
---|
85 | # that the introducer's status page will show us. |
---|
86 | hunk ./src/allmydata/client.py 290 |
---|
87 | furl_file = os.path.join(self.basedir, "private", "storage.furl") |
---|
88 | furl = self.tub.registerReference(ss, furlFile=furl_file) |
---|
89 | ri_name = RIStorageServer.__remote_name__ |
---|
90 | - self.introducer_client.publish(furl, "storage", ri_name) |
---|
91 | + # Now, publish our multi-introducers |
---|
92 | + for ic in self.introducer_clients: |
---|
93 | + ic.publish(furl, "storage", ri_name) |
---|
94 | d.addCallback(_publish) |
---|
95 | d.addErrback(log.err, facility="tahoe.init", |
---|
96 | level=log.BAD, umid="aLGBKw") |
---|
97 | hunk ./src/allmydata/client.py 346 |
---|
98 | # check to see if we're supposed to use the introducer too |
---|
99 | if self.get_config("client-server-selection", "use_introducer", |
---|
100 | default=True, boolean=True): |
---|
101 | - sb.use_introducer(self.introducer_client) |
---|
102 | + |
---|
103 | + # Now, use our multi-introducers |
---|
104 | + for ic in self.introducer_clients: |
---|
105 | + sb.use_introducer(ic) |
---|
106 | |
---|
107 | def get_storage_broker(self): |
---|
108 | return self.storage_broker |
---|
109 | hunk ./src/allmydata/client.py 362 |
---|
110 | sc = StubClient() |
---|
111 | furl = self.tub.registerReference(sc) |
---|
112 | ri_name = RIStubClient.__remote_name__ |
---|
113 | - self.introducer_client.publish(furl, "stub_client", ri_name) |
---|
114 | + # Now publish our multiple introducers |
---|
115 | + for ic in self.introducer_clients: |
---|
116 | + ic.publish(furl, "stub_client", ri_name) |
---|
117 | d = self.when_tub_ready() |
---|
118 | d.addCallback(_publish) |
---|
119 | d.addErrback(log.err, facility="tahoe.init", |
---|
120 | hunk ./src/allmydata/client.py 476 |
---|
121 | |
---|
122 | def get_encoding_parameters(self): |
---|
123 | return self.DEFAULT_ENCODING_PARAMETERS |
---|
124 | - |
---|
125 | + |
---|
126 | + # In case we configure multiple introducers |
---|
127 | def connected_to_introducer(self): |
---|
128 | hunk ./src/allmydata/client.py 479 |
---|
129 | - if self.introducer_client: |
---|
130 | - return self.introducer_client.connected_to_introducer() |
---|
131 | - return False |
---|
132 | - |
---|
133 | + status = [] |
---|
134 | + if self.introducer_clients: |
---|
135 | + s = False |
---|
136 | + for ic in self.introducer_clients: |
---|
137 | + s = ic.connected_to_introducer() |
---|
138 | + status.append(s) |
---|
139 | + return status |
---|
140 | + |
---|
141 | def get_renewal_secret(self): # this will go away |
---|
142 | return self._secret_holder.get_renewal_secret() |
---|
143 | |
---|
144 | hunk ./src/allmydata/web/root.py 220 |
---|
145 | |
---|
146 | return ctx.tag[ul] |
---|
147 | |
---|
148 | - def data_introducer_furl(self, ctx, data): |
---|
149 | - return self.client.introducer_furl |
---|
150 | - def data_connected_to_introducer(self, ctx, data): |
---|
151 | - if self.client.connected_to_introducer(): |
---|
152 | - return "yes" |
---|
153 | - return "no" |
---|
154 | + # In case we configure multiple introducers |
---|
155 | + def data_introducers(self, ctx, data): |
---|
156 | + connection_status = self.client.connected_to_introducer() |
---|
157 | + s = [] |
---|
158 | + furls = self.client.introducer_furls |
---|
159 | + for furl in furls: |
---|
160 | + i = furls.index(furl) |
---|
161 | + if connection_status[i]: |
---|
162 | + s.append( (furl, "Yes") ) |
---|
163 | + else: |
---|
164 | + s.append( (furl, "No") ) |
---|
165 | + s.sort() |
---|
166 | + return s |
---|
167 | + |
---|
168 | + def render_introducers_row(self, ctx, s): |
---|
169 | + (furl, connected) = s |
---|
170 | + #connected = |
---|
171 | + ctx.fillSlots("introducer_furl", "%s" % (furl)) |
---|
172 | + ctx.fillSlots("connected", "%s" % (connected)) |
---|
173 | + return ctx.tag |
---|
174 | |
---|
175 | def data_helper_furl(self, ctx, data): |
---|
176 | try: |
---|
177 | hunk ./src/allmydata/web/welcome.xhtml 25 |
---|
178 | <tr><th>Tahoe-LAFS code imported from:</th> <td n:render="string" n:data="import_path" /></tr> |
---|
179 | <tr><th>Services running:</th> <td n:render="services" /></tr> |
---|
180 | </table> |
---|
181 | - |
---|
182 | + |
---|
183 | |
---|
184 | </div> |
---|
185 | |
---|
186 | hunk ./src/allmydata/web/welcome.xhtml 40 |
---|
187 | <div n:render="download_form" /> |
---|
188 | </div> |
---|
189 | |
---|
190 | +<h2>Connected Introducer(s)</h2> |
---|
191 | + |
---|
192 | +<div> |
---|
193 | +<table n:render="sequence" n:data="introducers"> |
---|
194 | + <tr n:pattern="header"> |
---|
195 | + <td>Introducer FURL</td> |
---|
196 | + <td>Connected?</td> |
---|
197 | + </tr> |
---|
198 | + <tr n:pattern="item" n:render="introducers_row"> |
---|
199 | + <td><tt><n:slot name="introducer_furl"/></tt></td> |
---|
200 | + <td><tt><n:slot name="connected"/></tt></td> |
---|
201 | + </tr> |
---|
202 | + <tr n:pattern="empty"><td>no introducers!</td></tr> |
---|
203 | +</table> |
---|
204 | +</div> |
---|
205 | + |
---|
206 | + |
---|
207 | + |
---|
208 | <div class="section" id="grid"> |
---|
209 | <h2>Status of the Storage Grid</h2> |
---|
210 | |
---|
211 | hunk ./src/allmydata/web/welcome.xhtml 61 |
---|
212 | - <div> |
---|
213 | - <n:attr name="class">connected-<n:invisible n:render="string" n:data="connected_to_introducer" /></n:attr> |
---|
214 | - <div>Introducer: <span class="data-chars" n:render="string" n:data="introducer_furl" /></div> |
---|
215 | - <div>Connected to introducer?: <span n:render="string" n:data="connected_to_introducer" /></div> |
---|
216 | - </div> |
---|
217 | - |
---|
218 | <div> |
---|
219 | <n:attr name="class">connected-<n:invisible n:render="string" n:data="connected_to_helper" /></n:attr> |
---|
220 | <div>Helper: <span n:render="string" n:data="helper_furl" /></div> |
---|
221 | hunk ./src/allmydata/web/welcome.xhtml 103 |
---|
222 | <div class="section" id="other-resources"> |
---|
223 | <h2>Other Resources</h2> |
---|
224 | |
---|
225 | - <div>Please visit the <a target="_blank" href="http://tahoe-lafs.org">Tahoe-LAFS home page</a> for |
---|
226 | + <div>Please visit the <a href="http://allmydata.org">Tahoe-LAFS home page</a> for |
---|
227 | code updates and bug reporting.</div> |
---|
228 | |
---|
229 | <div>The <a href="provisioning">provisioning tool</a> and <a |
---|
230 | } |
---|
231 | [multiple-introducers-changes-in-architecture-configuration-running.dpatch |
---|
232 | writefaruq@gmail.com**20100716175659 |
---|
233 | Ignore-this: b70c12ef8082cb54c1118cc05b638d53 |
---|
234 | docs/architecture.txt-configuration.txt-running.html: necessary changes for configuring/running multiple introducers. |
---|
235 | |
---|
236 | ***END# OF DESCRIPTION*** |
---|
237 | |
---|
238 | Place the long patch description above the ***END OF DESCRIPTION*** marker. |
---|
239 | The first line of this file will be the patch name. |
---|
240 | |
---|
241 | |
---|
242 | This patch contains the following changes: |
---|
243 | |
---|
244 | M ./docs/architecture.txt -2 +6 |
---|
245 | M ./docs/configuration.txt +6 |
---|
246 | M ./docs/running.html -1 +2 |
---|
247 | ] { |
---|
248 | hunk ./docs/architecture.txt 75 |
---|
249 | suffers an unrecoverable hardware problem. Second, even if the private key is |
---|
250 | lost, clients can be reconfigured to use a new introducer. |
---|
251 | |
---|
252 | -For future releases, we have plans to decentralize introduction, allowing any |
---|
253 | -server to tell a new client about all the others. |
---|
254 | +By deploying multiple introducers in a Tahoe-LAFS grid, the above SPoF challenge |
---|
255 | +can be overcome. In that case if one introducer fails clients are still be |
---|
256 | +able to get announcement about new servers from remaining introducers. This is |
---|
257 | +our first step towards implementing a fully distributed introduction. |
---|
258 | |
---|
259 | hunk ./docs/architecture.txt 80 |
---|
260 | +For future releases, we have plans to enhance our distributed introduction, |
---|
261 | +allowing any server to tell a new client about all the others. |
---|
262 | |
---|
263 | == File Encoding == |
---|
264 | |
---|
265 | hunk ./docs/configuration.txt 23 |
---|
266 | an initial tahoe.cfg file for you. After creation, the node will never modify |
---|
267 | the 'tahoe.cfg' file: all persistent state is put in other files. |
---|
268 | |
---|
269 | +A seond file "BASEDIR/introducers" configures introducers. It is necessary to |
---|
270 | +write all FURL entries into this file. Each line in this file contains exactly |
---|
271 | +one FURL entry. For backward compatibility reasons, any "introducer.furl" |
---|
272 | +entry found in tahoe.cfg file will automatically be copied into this file and |
---|
273 | +this is not recommended for new users. |
---|
274 | + |
---|
275 | The item descriptions below use the following types: |
---|
276 | |
---|
277 | boolean: one of (True, yes, on, 1, False, off, no, 0), case-insensitive |
---|
278 | hunk ./docs/running.html 40 |
---|
279 | <p>To construct a client node, run |
---|
280 | "<code>tahoe create-client</code>", which will create <code>~/.tahoe</code> to be the |
---|
281 | node's base directory. Acquire a copy of the <code>introducer.furl</code> |
---|
282 | - from the introducer and put it into this directory, then use |
---|
283 | + from the introducers and put it into "BASEDIR/introducers" file, one FURL entry per line, |
---|
284 | + then use |
---|
285 | "<code>tahoe run</code>". After that, the node should be off and running. The first |
---|
286 | thing it will do is connect to the introducer and get itself connected to |
---|
287 | all other nodes on the grid. By default, a node will serve as a storage |
---|
288 | } |
---|
289 | |
---|
290 | Context: |
---|
291 | |
---|
292 | [quickstart.html: python 2.5 -> 2.6 as recommended version |
---|
293 | david-sarah@jacaranda.org**20100705175858 |
---|
294 | Ignore-this: bc3a14645ea1d5435002966ae903199f |
---|
295 | ] |
---|
296 | [SFTP: don't call .stopProducing on the producer registered with OverwriteableFileConsumer (which breaks with warner's new downloader). |
---|
297 | david-sarah@jacaranda.org**20100628231926 |
---|
298 | Ignore-this: 131b7a5787bc85a9a356b5740d9d996f |
---|
299 | ] |
---|
300 | [docs/how_to_make_a_tahoe-lafs_release.txt: trivial correction, install.html should now be quickstart.html. |
---|
301 | david-sarah@jacaranda.org**20100625223929 |
---|
302 | Ignore-this: 99a5459cac51bd867cc11ad06927ff30 |
---|
303 | ] |
---|
304 | [setup: in the Makefile, refuse to upload tarballs unless someone has passed the environment variable "BB_BRANCH" with value "trunk" |
---|
305 | zooko@zooko.com**20100619034928 |
---|
306 | Ignore-this: 276ddf9b6ad7ec79e27474862e0f7d6 |
---|
307 | ] |
---|
308 | [trivial: tiny update to in-line comment |
---|
309 | zooko@zooko.com**20100614045715 |
---|
310 | Ignore-this: 10851b0ed2abfed542c97749e5d280bc |
---|
311 | (I'm actually committing this patch as a test of the new eager-annotation-computation of trac-darcs.) |
---|
312 | ] |
---|
313 | [docs: about.html link to home page early on, and be decentralized storage instead of cloud storage this time around |
---|
314 | zooko@zooko.com**20100619065318 |
---|
315 | Ignore-this: dc6db03f696e5b6d2848699e754d8053 |
---|
316 | ] |
---|
317 | [docs: update about.html, especially to have a non-broken link to quickstart.html, and also to comment out the broken links to "for Paranoids" and "for Corporates" |
---|
318 | zooko@zooko.com**20100619065124 |
---|
319 | Ignore-this: e292c7f51c337a84ebfeb366fbd24d6c |
---|
320 | ] |
---|
321 | [TAG allmydata-tahoe-1.7.0 |
---|
322 | zooko@zooko.com**20100619052631 |
---|
323 | Ignore-this: d21e27afe6d85e2e3ba6a3292ba2be1 |
---|
324 | ] |
---|
325 | Patch bundle hash: |
---|
326 | 5a3610d1c27dcf6a53302b52f0f34172f9d73e5a |
---|