How to compile MySQL with the Falcon Storage Engine from the BitKeeper source tree
Now that the source tree for the new Falcon Storage Engine is finally public, here's a quick HOWTO on how to compile the server from source. This procedure is described in more detail in the MySQL Manual. I assume you use Linux and have the required development toolchain installed.
You first should get the free BK client from http://www.bitmover.com/bk-client2.0.shar, unpack and install it:
$ wget http://www.bitmover.com/bk-client2.0.shar --17:34:34-- http://www.bitmover.com/bk-client2.0.shar => `bk-client2.0.shar'Now that the BK client is installed, we can create a local clone of the Falcon development tree:
Resolving www.bitmover.com... 192.132.92.2 Connecting to www.bitmover.com|192.132.92.2|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 17,676 (17K) [application/x-shar] 100%[========================================================>] 17,676 33.56K/s 17:34:35 (33.50 KB/s) - `bk-client2.0.shar' saved [17676/17676] $ sh ./bk-client2.0.shar x - creating lock directory x - creating directory bk-client2.0 x - extracting bk-client2.0/Makefile (text) x - extracting bk-client2.0/bkf.c (text) x - extracting bk-client2.0/demo.sh (text) $ cd bk-client2.0 $ make cc -O2 -Wall -Wno-parentheses bkf.c -o bkf $ sudo install -m755 bkf /usr/local/bin
$ bkf clone bk://mysql.bkbits.net/mysql-5.2-falcon mysql-5.2-falconThis will now perform a check out the most recent source tree from the mysql-5.2-falcon repository (~83 MB of source code). You can now enter the newly created directory and start the build:
$ cd mysql-5.2-falconIf you have a x86_64 Linux system, use compile-amd64-debug-falcon instead. Depending on the performance of your system, this step will take a while, as it performs a full compile of the MySQL server and all related tools. Once the build completed with no errors, you can create a binary tarball distribution:
$ ./BUILD/compile-pentium-debug-falcon
./scripts/make_binary_distributionThis should leave you with a tarball mysql-5.2.0-falcon-alpha-linux-i686.tar.gz that you can now install to, say, /usr/local:
$ tar zxvf mysql-5.2.0-falcon-alpha-linux-i686.tar.gz -C /usr/localThe last command will install the privilege tables and start up the mysql server. You can now fire up the mysql client:
$ cd /usr/local
$ ln -s mysql-5.2.0-falcon-alpha-linux-i686 mysql
$ cd mysql
$ ./configure
$ ./bin/mysqlNow make sure that falcon has indeed been included:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 5.2.0-falcon-alpha-debug
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> SHOW VARIABLES LIKE 'have_falcon';Looks good! Now it's time to actually create a table that uses the Falcon engine:
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_falcon | YES |
+---------------+-------+
1 row in set (0.01 sec)
mysql> use test;Congratulations, you are ready to further test and explore this new storage engine! Have fun with testing it - we would appreciate your feedback and experiences! Please share your impressions via the Falcon Forum or report bugs via our Bug Database. Make sure to read the bug reporting guidelines on the MySQL Forge Wiki first!
Database changed
mysql> CREATE TABLE names (id INT, fname VARCHAR (20), lname VARCHAR (20)) ENGINE=Falcon;
Query OK, 0 rows affected (2.84 sec)
mysql> describe names;
+-------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+-------------+------+-----+---------+-------+
| id | int(11) | YES | | NULL | |
| fname | varchar(20) | YES | | NULL | |
| lname | varchar(20) | YES | | NULL | |
+-------+-------------+------+-----+---------+-------+
3 rows in set (0.01 sec)
mysql> INSERT INTO names VALUES (0, 'Lenz', 'Grimmer');
Query OK, 1 row affected (0.03 sec)
mysql> INSERT INTO names VALUES (1, 'Monty', 'Widenius');
Query OK, 1 row affected (0.06 sec)
mysql> SELECT * FROM names WHERE lname='Widenius';
+------+-------+----------+
| id | fname | lname |
+------+-------+----------+
| 1 | Monty | Widenius |
+------+-------+----------+
1 row in set (0.00 sec)
UPDATE: The people at Bitkeeper updated the free BK client to version 2.0 after I wrote this. I updated the described procedure above accordingly. Currently, the repository seems to have a locking problem that only appears when using the free BK client. We are working with the BitKeeper team on resolving this issue.
Comments
Display comments as Linear | Threaded
paul on :