My Drizzle Notes‎ > ‎

Drizzle

Compiling from tarball release

1. Unpack the tarball
2. ./configure //for production optimization i prefer : CXXFLAGS='-s -O2'
3. make

while configure.sh, need to specify the base directroy for drizzles. (remember this directory)

start drizzle

./drizzled/drizzled -h /home/jobin/data/    (this should be sufficient just after the build)
./drizzled/drizzled -h /home/jobin/data/ --default-replicator-enable --transaction-log-enable --transaction-log-enable-checksum


if you already installed (like "make install") it into proper base directories
./sbin/drizzled --basedir=/home/jobin/builds/drizzle/ --datadir=/home/jobin/builds/drizzle/
to start using address bindings use:
--drizzle-protocol-bind-address
--mysql-protocol-bind-address
./sbin/drizzled --user=drizzle --datadir=/home/drizzle/data --basedir=/home/drizzle/ --logging-syslog-enable --skip-oldlibdrizzle --skip-filtered-replicator --drizzle-protocol-bind-address=127.0.0.1
(if data file and log files are not existing drizzle will create them on the first run)

You can keep all your configuration into a file and request drizzle to read it form there.
suppose you added following lines to /etc/drizzle/drizzled.cnf (contents of my drizzled.cnf)
datadir = /home/jobin/data
drizzle-protocol.bind-address = 0.0.0.0
mysql-protocol.bind-address = 0.0.0.0

you can start the drizzled explicitly specifying the configuration file like
./drizzled --defaults-file /etc/drizzle/drizzled.cnf


you can query and see whether the variables are taken into effect.
drizzle>show variables like 'data%';

shutdown the drizzle from default port
./bin/drizzle --shutdown --port=4427

for connecting and working, please refer here
for more on information schema refer the blog of ronald here

once you connected to drizzled, you can get lot of information from information_schema
There are lots of tables where you can query to findout database related information.
drizzle> select version();
drizzle> select * from data_dictionary.plugins;
drizzle> SELECT * FROM DATA_DICTIONARY.SCHEMAS;
drizzle> select table_name from information_schema.tables where table_name like '%MEMCACHED%'; --currently not there in information_schema
drizzle> select plugin_name from information_schema.plugins; --currently not there in information_schema
recovering the INNODB from a crash : using innodb_force_recovery
http://dev.mysql.com/doc/refman/5.0/en/forcing-recovery.html

table defenition of drizzle is stored in proto and this meta data is stored inside storage engine.

drizzle> CREATE TABLE A (a int) ENGINE=Archive;
Query OK, 0 rows affected (0 sec)

drizzle> create table B like A ENGINE=innodb;
Query OK, 0 rows affected (0 sec)

drizzle> show create table B;

this replaces the FRM files more info here

Note:- SHOW TABLE STATUS only shows tables after SHOW CREATE TABLE

Replication info:

SELECT * FROM INFORMATION_SCHEMA.TRANSACTION_LOG;
SELECT * FROM INFORMATION_SCHEMA.TRANSACTION_LOG_ENTRIES;
SELECT * FROM INFORMATION_SCHEMA.TRANSACTION_LOG_TRANSACTIONS;
SELECT PRINT_TRANSACTION_MESSAGE("transaction.log", ENTRY_OFFSET) as trx FROM INFORMATION_SCHEMA.TRANSACTION_LOG_ENTRIES;

Backup and Restore:
./client/drizzledump dbname > dumpfile.sql
read more about drizzledump here

Using Eclipse

Configuring Eclipse enviroment for Drizzle development need to take into account of following needs.
1. Eclipse workspace got an assumption that all project related files should be present inside workspace.

Suppose my workspace is a mounted disk : /media/Drizzle

2. Better to pull the bzr branch to a location where you are not modifying files.
I used to pull bzr branch from lauchpad to a directory in my home

~/repos/drizzle/trunk
cd ~/repos/drizzle
bzr branch trunk/ /media/Drizzle/drizzle

(you can branch the source files to another location for modification. Your own branch)

above 2 considerations pushes the development environment to be bit hygienic.
So I prefer to have the my personal branch location as the workspace.



Using bzr

.ssh and .bazaar directories in your home contains information requied for launchpad authentification
getting the drizzle development tree
bzr branch lp:drizzle
this creates a local branch in directory "drizzle"
getting the local branch
cd ~/drizzle
bzr pull

Create another branch for fixing bugs and edit files there
cd ~
bzr branch drizzle bug_654164
...
vi conn.c
After editing commit the changes to local version.
bzr commit libdrizzle/conn.c
push the changes to launchpad. cd ~/bug_654164
bzr push --no-strict lp:~jobinau/drizzle/bug_654164

Clearing Status

Clearing Session Status : FLUSH STATUS
Clearing Global Status : FLUSH GLOBAL STATUS

Installing Eclipse.

1. Install the JRE
It is a mouse click away for most of the linux distributions. for example,
Ubuntu repository contains OpenJDK which is sufficient for the Eclipse to run.
(i am using OpenJDK instead of SunJDK)
installing JRE in each enviroment is beyond the scope of this tutorial. its open please figure it out!.

2. Download and Install Eclipse CDT (C/C++ Development Tooling)
As you may already know it is aware of GNU tools.


Now How to setup the enviroment.


make sure that workspace in your home directory is deleted (let us have a clean start)
Create a empty project with Workspace as the trunk directory. Import trunk (/src/drizzle/trunk) to workspace: File -> Import -> General -> Existing project into Workspace


Convert to C/C++ project: New -> Convert to a C/C++ project

Drizzle on Windows

Regarding libdrizzle on windows i have a blog post here

Additionally i installed following things in cywin hopping that one day i will be able to compile drizzle server also.
downloaded and install protobuf from google.
downloaded libdrizzle and installed from : https://launchpad.net/libdrizzle
downloaded readline from ftp://ftp.gnu.org/gnu/readline/ and compiled

Drizzle on lauchpad

$> ssh-keygen -t dsa
copy the content of /home/jobin/.ssh/id_dsa.pub to "SSH keys" section in personal profile (https://launchpad.net/~jobinau)
now bzr can identify you.

$> mkdir ~/repos
$> cd repos
$> bzr init-repo drizzle
$> cd drizzle
$>bzr launchpad-login jobinau
$>bzr whoami
$> bzr branch lp:drizzle trunk

to synch up the branch with main branch
$> cd ~/repos/drizzle/trunk
$> bzr pull

make a branch again to work on some specific issue.
$> bzr branch trunk bug32124
$> cd bug32124
Make code changes
$> bzr commit filename.cc # Repeat as needed
Enter descriptive comments about the change in your editor and save
$> bzr push lp:~jobinau/libdrizzle/mingwport

finally commit the changes
$> bzr commit --fixes=lp:XXXXXX

Interesting Drizzle Related Articles

Loging Bad SQLs in to Syslog
Drizzle Statistics (CUMULATIVE_USER_STATS,CUMULATIVE_SQL_COMMANDS,GLOBAL_STATUS,SESSION_STATUS,SESSION_STATEMENTS,GLOBAL_STATEMENTS)
DATA_DICTIONARY and INFORMATION_SCHEMA
Blob Streaming using PBMS
Query Cache Plugin using Memcached
Drizzle Transaction Message Limit
Drizzle for Drupal (Production Setup)
InnoDB Tablespace Fragmentation
Backups using XtraBackup
Numbers everyone should know

End of Drizzle Generic documentation

Č
ċ
ď
Jobin Augustine,
Oct 4, 2010 5:40 AM