summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-08-25 19:10:18 +0000
committerChristian Grothoff <christian@grothoff.org>2010-08-25 19:10:18 +0000
commit9aa22137e2427e1f44c7fca2f30005ba8b22195d (patch)
tree29ce98471d30a686c101ffff10b3461f7044491c /doc
parent073be523fd1121b2bb4cd2f77f3098b0c98c1738 (diff)
postgres hackery
Diffstat (limited to 'doc')
-rw-r--r--doc/README.mysql95
-rw-r--r--doc/README.postgres49
2 files changed, 144 insertions, 0 deletions
diff --git a/doc/README.mysql b/doc/README.mysql
new file mode 100644
index 000000000..e123c43ac
--- /dev/null
+++ b/doc/README.mysql
@@ -0,0 +1,95 @@
+How to setup the MySQL database for GNUnet.
+
+NOTE: This db module does NOT work with mysql before 4.1 since we need
+prepared statements. We are generally testing the code against MySQL
+5.0 at this point.
+
+HIGHLIGHTS
+
+Pros
+ + On up-to-date hardware where mysql can be used comfortably, this
+ module will have better performance than the other db choices
+ (according to our tests).
+ + Its often possible to recover the mysql database from internal
+ inconsistencies. The other db choices do not support repair
+ (gnunet-check cannot fix problems internal to the dbmgr!).
+ For example, we have seen several cases where power failure
+ has ruined a gdbm database beyond repair.
+ + much faster (for one of the key benchmarks -- content migration
+ -- we have measure mysql taking 2s for an operation where
+ sqlite takes 150s).
+Cons
+ - Memory usage (Comment: "I have 1G and it never caused me trouble")
+ - Manual setup
+
+MANUAL SETUP INSTRUCTIONS
+
+ 1) in /etc/gnunet.conf, set
+ sqstore = "sqstore_mysql"
+
+ 2) Then access mysql as root,
+ $ mysql -u root -p
+ and do the following. [You should replace $USER with the username
+ that will be running the gnunetd process].
+
+ CREATE DATABASE gnunet;
+ GRANT select,insert,update,delete,create,alter,drop,create temporary tables
+ ON gnunet.* TO $USER@localhost;
+ SET PASSWORD FOR $USER@localhost=PASSWORD('$the_password_you_like');
+ FLUSH PRIVILEGES;
+
+ 3) In the $HOME directory of $USER, create a ".my.cnf" file
+ with the following lines
+
+ [client]
+ user=$USER
+ password=$the_password_you_like
+
+ Thats it. Note that .my.cnf file is a security risk unless its on
+ a safe partition etc. The $HOME/.my.cnf can of course be a symbolic
+ link. Even greater security risk can be achieved by setting no
+ password for $USER. Luckily $USER has only priviledges to mess
+ up GNUnet's tables, nothing else (unless you give him more,
+ of course).
+
+ 4) Still, perhaps you should briefly try if the DB connection
+ works. First, login as $USER. Then use,
+
+ $ mysql -u $USER
+ mysql> use gnunet;
+
+ If you get the message &quot;Database changed&quot; it probably works.
+
+ [If you get &quot;ERROR 2002: Can't connect to local MySQL server
+ through socket '/tmp/mysql.sock' (2)&quot; it may be resolvable by
+ &quot;ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock&quot;
+ so there may be some additional trouble depending on your mysql setup.]
+
+ 5) If you want to run the testcases, you must create a second
+ database "gnunetcheck" with the same username and password.
+ This database will then be used for testing ("make check").
+
+
+REPAIRING TABLES
+
+- Its probably healthy to check your tables for inconsistencies
+ every now and then, especially after system crashes.
+- If you get odd SEGVs on gnunetd startup, it might be that the mysql
+ databases have been corrupted.
+- The tables can be verified/fixed in two ways;
+ 1) by shutting down mysqld (mandatory!) and running
+ # myisamchk -r *.MYI
+ in /var/lib/mysql/gnunet/ (or wherever the tables are stored).
+ Another repair command is "mysqlcheck". The usable command
+ may depend on your mysql build/version. Or,
+ 2) by executing
+ mysql> REPAIR TABLE gn090;
+
+
+PROBLEMS?
+
+If you have problems related to the mysql module, your best friend is
+probably the mysql manual. The first thing to check is that mysql is
+basically operational, that you can connect to it, create tables,
+issue queries etc.
+
diff --git a/doc/README.postgres b/doc/README.postgres
new file mode 100644
index 000000000..0213c72fb
--- /dev/null
+++ b/doc/README.postgres
@@ -0,0 +1,49 @@
+How to setup the Postgres database for GNUnet.
+
+NOTE: This db module was developed for Postgres 8.3. I have no
+idea what the minimum version that we require is exactly.
+
+HIGHLIGHTS
+
+Pros
+ + Easier to setup than MySQL
+ + Real database
+Cons
+ - Quite slow
+ - Still some setup
+
+MANUAL SETUP INSTRUCTIONS
+
+ 1) in /etc/gnunet.conf, set
+ sqstore = "sqstore_postgres"
+
+ 2) Then access postgres to create a user; I had to do this to get
+ access and create a user:
+ # su - postgres
+ $ createuser
+ At this point, use the name of the user running gnunet
+ for the role, do not set it to superuser, allow the creation
+ of databases.
+
+ 3) As that user, create a database (or two):
+ $ createdb gnunet
+ $ createdb gnunetcheck # this way you can run "make check"
+
+ Thats it.
+
+ 4) Still, perhaps you should briefly try if the DB connection
+ works. First, login as the user who will run gnunetd. Then use,
+
+ $ psql gnunet # or gnunetcheck
+ gnunet=> \dt
+
+ If, after you have started gnunetd at least once, you get a
+ gn090 table here, it probably works.
+
+PROBLEMS?
+
+If you have problems related to the postgres module, your best friend
+is probably the postgres manual. The first thing to check is that
+postgres is basically operational, that you can connect to it, create
+tables, issue queries etc. (see step 4 above for details).
+