* [Patch 2/7] tabled: add <Cell> element
@ 2010-01-15 4:11 Pete Zaitcev
2010-01-20 19:51 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Pete Zaitcev @ 2010-01-15 4:11 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Project Hail List
Make the cell configurable. Among other things we need this for is
that you cannot migrate a tabled over when DB format changes, short
of running 2 CLDs.
We also add a few thoughts to the documentation, prompted by re-reading
of the document while adding the clause for <Cell>.
Signed-Off-By: Pete Zaitcev <zaitcev@redhat.com>
---
doc/etc.tabled.conf | 7 +++++++
doc/setup.txt | 40 +++++++++++++++++++++++++++++++++++++---
server/cldu.c | 4 ++++
server/config.c | 11 +++++++++++
server/server.c | 2 +-
server/tabled.h | 1 +
6 files changed, 61 insertions(+), 4 deletions(-)
commit 8c883a9b453b85d1da026f3638f074fe6d46df3f
Author: Master <zaitcev@lembas.zaitcev.lan>
Date: Thu Jan 14 19:37:59 2010 -0700
Add Cell configuration.
diff --git a/doc/etc.tabled.conf b/doc/etc.tabled.conf
index b3e6d68..f6c0bee 100644
--- a/doc/etc.tabled.conf
+++ b/doc/etc.tabled.conf
@@ -11,6 +11,13 @@
<Port>80</Port>
</Listen>
+<!--
+ One cell per DB, don't skimp on cells. Also, make sure the replication
+ ports do not conflict when you make hosts to host several cells.
+ Unfortunately, the diagnostics are not very good if they do.
+ Most likely you'll see database corruption in such cases.
+ -->
+<Cell>ultracart2</Cell>
<TDB>/path/tabled/tdb</TDB>
<TDBRepPort>8083</TDBRepPort>
diff --git a/doc/setup.txt b/doc/setup.txt
index 4338db4..0fd32da 100644
--- a/doc/setup.txt
+++ b/doc/setup.txt
@@ -10,13 +10,30 @@ _cld._udp.phx2.ex.com has SRV record 10 50 8081 pacman.phx2.ex.com.
_cld._udp.phx2.ex.com has SRV record 10 50 8081 maika.phx2.ex.com.
[root@table1 ~]#
- If this does not work, set up CLD before proceeding.
+ If this does not work, STOP NOW. Then, talk to your DNS administrator.
Also, make sure that your hostname has a domain. We don't want to search
- for CLD in the DNS root, do we?
+ for CLD in the world-wide DNS root, do we?
+
+ Make sure CLD is up (run "cldcli" to verify).
+
+*) Another thing to set up in DNS is a wildcard host for the system where
+ tabled will run. Unlike the SRV records of CLD, this is optional, but
+ these days applications may presume that it exists. Here's the way it's
+ done in ISC BIND:
+
+emus3 IN A 192.168.128.9
+ IN TXT "Dell C8WQMC1"
+ IN AAAA fec0::1:219:b9ff:fe58:7ad6
+*.emus3 IN CNAME emus3
+
+ All examples on Google say FQDN is required, and most presume aliasing
+ of A and AAAA records, but BIND 9 eats the above fine.
*) Copy configuration file from doc/etc.tabled.conf to /etc/tabled.conf
- and edit to suit (see configurable items below).
+ and edit to suit (see configurable items below). Notice that the file
+ looks like XML, but is not really. In particular, names of elements are
+ case-sensitive.
*) The tabled writes its pid to /var/run/tabled.pid by default.
If you don't like the location, change it with <PID> tag.
@@ -24,6 +41,17 @@ _cld._udp.phx2.ex.com has SRV record 10 50 8081 maika.phx2.ex.com.
*) Create/choose TDB data directory, where Berkeley DB stores
data and metadata. Change this location with <TDB> tag.
+*) Assign the cell name:
+
+ <Cell>ultracart3</Cell>
+
+ Currently, a tabled process scans its cell, finds all other tabled
+ instances, and attempts to replicate its database to/from them.
+ In short, use one cell per business application.
+
+ Cell name defaults to "default", so you can leave this element unset,
+ but don't do it. Any name, even "qwerty", is better than the default.
+
*) Select the port to listen, if desired. This is done using the <Listen>
element:
@@ -31,6 +59,12 @@ _cld._udp.phx2.ex.com has SRV record 10 50 8081 maika.phx2.ex.com.
<Port>80</Port>
</Listen>
+ Default is port 80, which you should use unless the system in question
+ hosts an unrelated webserver too. This is because some libraries, such
+ as ancient Google Boto, may have bugs that prevent them from talking to
+ ports other than 80 (for unencrypted HTTP). If your target clients are
+ bug-free, use anything you like. The 8080 is a popular choice.
+
*) Initialize TDB, the metadata database. Load user/password pairs
into TDB, using tdbadm utility. The user/password pairs are
presented to tdbadm stdin in the following text format:
diff --git a/server/cldu.c b/server/cldu.c
index d02eafd..273f149 100644
--- a/server/cldu.c
+++ b/server/cldu.c
@@ -129,6 +129,10 @@ static int cldu_nextactive(struct cld_session *sp)
return sp->actx;
}
+/*
+ * Notice that for now we use the same cell name for both tabled and the
+ * chunkservers that it uses, so this function only takes one cell argument.
+ */
static int cldu_setcell(struct cld_session *sp,
const char *thiscell, const char *thishost)
{
diff --git a/server/config.c b/server/config.c
index 037176d..9d8ca87 100644
--- a/server/config.c
+++ b/server/config.c
@@ -317,6 +317,17 @@ static void cfg_elm_end (GMarkupParseContext *context,
}
#endif
+ else if (!strcmp(element_name, "Cell")) {
+ if (!cc->text) {
+ applog(LOG_WARNING, "Cell element empty");
+ return;
+ }
+
+ free(tabled_srv.cell);
+ tabled_srv.cell = cc->text;
+ cc->text = NULL;
+ }
+
else {
applog(LOG_WARNING, "Unknown element \"%s\"", element_name);
}
diff --git a/server/server.c b/server/server.c
index f16d2ab..6069534 100644
--- a/server/server.c
+++ b/server/server.c
@@ -1795,7 +1795,7 @@ int main (int argc, char *argv[])
if (rc)
goto err_out_net;
- if (cld_begin(tabled_srv.ourhost, NULL) != 0) {
+ if (cld_begin(tabled_srv.ourhost, tabled_srv.cell) != 0) {
rc = 1;
goto err_cld_session;
}
diff --git a/server/tabled.h b/server/tabled.h
index a0d3400..60b6c05 100644
--- a/server/tabled.h
+++ b/server/tabled.h
@@ -236,6 +236,7 @@ struct server {
char *chunk_user; /* username for stc_new */
char *chunk_key; /* key for stc_new */
unsigned short rep_port; /* db4 replication port */
+ char *cell; /* our cell (both T and Ch) */
char *ourhost; /* use this if DB master */
struct database *db; /* database handle */
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch 2/7] tabled: add <Cell> element
2010-01-15 4:11 [Patch 2/7] tabled: add <Cell> element Pete Zaitcev
@ 2010-01-20 19:51 ` Jeff Garzik
2010-01-20 20:13 ` Pete Zaitcev
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2010-01-20 19:51 UTC (permalink / raw)
To: Pete Zaitcev; +Cc: Project Hail List
On 01/14/2010 11:11 PM, Pete Zaitcev wrote:
> Make the cell configurable. Among other things we need this for is
> that you cannot migrate a tabled over when DB format changes, short
> of running 2 CLDs.
>
> We also add a few thoughts to the documentation, prompted by re-reading
> of the document while adding the clause for<Cell>.
>
> Signed-Off-By: Pete Zaitcev<zaitcev@redhat.com>
>
> ---
> doc/etc.tabled.conf | 7 +++++++
> doc/setup.txt | 40 +++++++++++++++++++++++++++++++++++++---
> server/cldu.c | 4 ++++
> server/config.c | 11 +++++++++++
> server/server.c | 2 +-
> server/tabled.h | 1 +
> 6 files changed, 61 insertions(+), 4 deletions(-)
Strictly speaking, this is wrong, but I applied so that we may make
forward progress.
The definition of a "cell" (or "cel") is everything within a single CLD
namespace.
It is a design requirement that any number of separate tabled instances
may be run within a single cell. The differentiating factor is
pathname. Thus, one tabled instance may store files in
cld://cld.mysite.com/table1/
and a totally separate, parallel instance of table may store its files in
cld://cld.mysite.com/table2/
Provisioning another tabled instance should be as simple as creating a
new directory in CLD, and running the tabled/chunkd nodes.
Thus, the user interface should be CLD hostname + pathname, not "cell name."
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch 2/7] tabled: add <Cell> element
2010-01-20 19:51 ` Jeff Garzik
@ 2010-01-20 20:13 ` Pete Zaitcev
0 siblings, 0 replies; 3+ messages in thread
From: Pete Zaitcev @ 2010-01-20 20:13 UTC (permalink / raw)
To: Jeff Garzik; +Cc: Project Hail List
On Wed, 20 Jan 2010 14:51:08 -0500
Jeff Garzik <jeff@garzik.org> wrote:
> Strictly speaking, this is wrong, but I applied so that we may make
> forward progress.
Well, good.
> The definition of a "cell" (or "cel") is everything within a single CLD
> namespace.
Bah, I can call it t-cell or "tabled instance" if that removes the
confusion with CLD "cell". After you called a Chunk partition a "table",
I thought you didn't care about reusing a word.
> Provisioning another tabled instance should be as simple as creating a
> new directory in CLD, and running the tabled/chunkd nodes.
It is true with the patch. There is no problem except terminology.
> Thus, the user interface should be CLD hostname + pathname, not "cell name."
Sure, I can fix it up. It was in todo for a while.
-- Pete
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-01-20 20:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-15 4:11 [Patch 2/7] tabled: add <Cell> element Pete Zaitcev
2010-01-20 19:51 ` Jeff Garzik
2010-01-20 20:13 ` Pete Zaitcev
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.