<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MySQL Preacher &#187; monitoring</title>
	<atom:link href="http://mysqlpreacher.com/wordpress/tag/monitoring/feed/" rel="self" type="application/rss+xml" />
	<link>http://mysqlpreacher.com/wordpress</link>
	<description>Because Sharing is Caring</description>
	<lastBuildDate>Mon, 26 Sep 2011 23:34:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>CRIB &#8211; CentRal Information Base for MySQL</title>
		<link>http://mysqlpreacher.com/wordpress/2010/12/crib-central-information-base-for-mysql/</link>
		<comments>http://mysqlpreacher.com/wordpress/2010/12/crib-central-information-base-for-mysql/#comments</comments>
		<pubDate>Fri, 10 Dec 2010 11:19:50 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[big deployments]]></category>
		<category><![CDATA[crib]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[monitoring]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=562</guid>
		<description><![CDATA[CRIB is a CentRal Information Base for MySQL, a long time coming project since I worked on it on and off for a few weeks and now I decided it&#8217;s time to hand it over to the global MySQL community. So, what is CRIB? CRIB is a central database which collects information about all your [...]]]></description>
			<content:encoded><![CDATA[<p>CRIB is a CentRal Information Base for MySQL, a long time coming project since I worked on it on and off for a few weeks and now I decided it&#8217;s time to hand it over to the global MySQL community.</p>
<p>So, what is CRIB?</p>
<p>CRIB is a central database which collects information about all your MySQL instances which you set as clients. It is monitoring in a way, but not the typical number of connections, memory, index usage, table scans, cpu usage and such, but rather consists of a repository where, if you have tens, hundreds or even thousands of clients, you can see where a particular user was created, where a certain database name features or which tables does a database consists of. It also features a script which logs table sizes periodically (customizable) so you can graph disk usage over time and be able to forecast future disk space requirements easily.</p>
<p>Download the latest code with: <b>bzr branch lp:crib</b></p>
<p>First of all lets create the user used to write to the server (mother instance)</p>
<p><code><br />
[dcassar@ubt]$ use5151<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 56<br />
Server version: 5.1.51 MySQL Community Server (GPL)<br />
</code><br />
<code><br />
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.<br />
This software comes with ABSOLUTELY NO WARRANTY. This is free software,<br />
and you are welcome to modify and redistribute it under the GPL v2 license<br />
</code><br />
<code><br />
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.<br />
</code><br />
<code><br />
mysql &gt; grant create, insert, alter, update, delete, select, drop, execute, create temporary tables, create routine, alter routine, lock tables on crib.* to "mother"@"%" identified by "teacher";<br />
Query OK, 0 rows affected (0.02 sec)<br />
</code><br />
<code><br />
mysql &gt; exit<br />
Bye<br />
[dcassar@ubt]$<br />
</code></p>
<p>Lets go ahead and install CRIB on both server and client</p>
<p><code><br />
[dcassar@ubt]$ cd INSTALL<br />
[dcassar@ubt]$ ./crib_install.sh<br />
</code><br />
<code>brought to you by Darren Cassar<br />
</code><code><br />
Anytime you need to cancel installation just press ( Ctrl + C )<br />
</code><code><br />
Would you like to setup source and destination or just source?<br />
1. Client and Server<br />
2. New Client<br />
Enter choice (default 2): 1<br />
Installation starting<br />
</code><br />
<code>This section you'll supply the destination (CentRal Information Base) details<br />
</code><br />
<code>Enter CRIB user name (default root): mother<br />
Enter CRIB password (default 'toor'):<br />
Enter CRIB hostname (default localhost): 127.0.0.1<br />
Enter CRIB port (default 3306): 5151<br />
</code><br />
<code>This section you'll supply the client details<br />
</code><br />
<code>Enter client user name (default root): dcassar<br />
Enter client password (default 'toor'):<br />
Enter client hostname (default localhost): dolphin<br />
Enter client port (default 3306): 3331<br />
Installation complete<br />
[dcassar@ubt]$<br />
</code><br />
Now is the time to gather the data from the clients and log it onto the server.</p>
<p><code><br />
[dcassar@ubt]$ ./populate.sh CONFIG/crib_3331.cnf<br />
[dcassar@ubt]$ ./tablesize.sh CONFIG/crib_3331.cnf<br />
</code></p>
<p>Lets log into the CRIB database on the mother server and see what details we have at our disposal.</p>
<p><code><br />
[dcassar@ubt]$ use5151<br />
Welcome to the MySQL monitor.  Commands end with ; or \g.<br />
Your MySQL connection id is 56<br />
Server version: 5.1.51 MySQL Community Server (GPL)<br />
</code><br />
<code><br />
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.<br />
This software comes with ABSOLUTELY NO WARRANTY. This is free software,<br />
and you are welcome to modify and redistribute it under the GPL v2 license<br />
</code><br />
<code><br />
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.<br />
</code><code><br />
mysql &gt; use crib<br />
Reading table information for completion of table and column names<br />
You can turn off this feature to get a quicker startup with -A<br />
</code><code><br />
Database changed<br />
mysql &gt; show tables;<br />
+------------------+<br />
| Tables_in_crib   |<br />
+------------------+<br />
| info_instances   |<br />
| info_object_size |<br />
| info_objects     |<br />
| info_privileges  |<br />
| info_users       |<br />
| version          |<br />
+------------------+<br />
6 rows in set (0.00 sec)<br />
</code><code><br />
mysql &gt; select * from version;<br />
+----+---------+---------------------+<br />
| ID | VERSION | UPDATED_TIMESTAMP   |<br />
+----+---------+---------------------+<br />
|  1 | 0.1     | 2010-12-09 16:24:05 |<br />
+----+---------+---------------------+<br />
1 row in set (0.00 sec)<br />
</code><code><br />
mysql &gt; select * from info_instances;<br />
+----+-------------------------------------+------+-----------+---------------+-----------------+------------+--------------+------+-------+<br />
| id | hostname                            | port | server_id | mysql_version | os              | os_version | architecture | bits | notes |<br />
+----+-------------------------------------+------+-----------+---------------+-----------------+------------+--------------+------+-------+<br />
|  1 | dolphin                             | 3331 |  14123561 | 5.1.50        | sun-solaris2.10 | 10         | sparc        |   64 | NULL  |<br />
+----+-------------------------------------+------+-----------+---------------+-----------------+------------+--------------+------+-------+<br />
1 row in set (0.00 sec)<br />
</code></p>
<p>From the above you realize you can identify all versions used in your setup, what hardware you are using, port numbers used and much more!</p>
<p>Lets see what users we have so far.<br />
<code><br />
mysql &gt; select * from info_users;<br />
+----+-------------+------------+---------------------------+-------------------------------------------+<br />
| id | instance_id | username   | hostname                  | password                                  |<br />
+----+-------------+------------+---------------------------+-------------------------------------------+<br />
|  1 |           1 | root       | localhost                 | *BA44AFCA02B64C198FAEB3043F47CA3797638975 |<br />
|  2 |           1 | root       | %.dev.domain.com          | *BA44AFCA02B64C198FAEB3043F47CA3797638975 |<br />
|  3 |           1 | root       | 127.0.0.1                 | *BA44AFCA02B64C198FAEB3043F47CA3797638975 |<br />
|  4 |           1 | abc        | %                         | *A4456E2A03EC0EE4E164BFA533443E82691DA163 |<br />
|  5 |           1 | def        | localhost                 | *5162BA4456B42A01FD8DDBB4CDBE46AFAD06C5AB |<br />
|  6 |           1 | ghi        | %                         | *95E6C48AFC85167C37A24130DD4F5FE0F48AB658 |<br />
|  7 |           1 | jkl        | %                         | *7A2D095E620E354F216EE00635E163406AD47392 |<br />
|  8 |           1 | mno        | %                         |                                           |<br />
|  9 |           1 | qpr        | localhost                 | *5162BA4456B42A01FD8DDBB4CDBE46AFAD06C5AB |<br />
+----+-------------+------------+---------------------------+-------------------------------------------+<br />
9 rows in set (0.00 sec)<br />
</code></p>
<p>If we had multiple machines set up as clients then we would have another group with instance_id 2, so on and so forth.</p>
<p>Remember this is an alpha tool and whatever you do with it is your responsibility. You are advised NOT TO set this up on production for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2010/12/crib-central-information-base-for-mysql/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>MySQL related bookmark collection</title>
		<link>http://mysqlpreacher.com/wordpress/2009/09/mysql-related-bookmark-collection/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/09/mysql-related-bookmark-collection/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 10:40:27 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[bookmarks]]></category>
		<category><![CDATA[cluster]]></category>
		<category><![CDATA[collection]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[general knowledge]]></category>
		<category><![CDATA[ha]]></category>
		<category><![CDATA[Information]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[performance analysis]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[slow queries]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=293</guid>
		<description><![CDATA[I am publishing my MySQL related bookmark collection http://www.mysqlpreacher.com/bookmarks/. Feel free to send me links you think might be good to add in order to help others. Remember, SHARING IS CARING!!! …. we get so much for free, why shouldn’t we give some back? Cheers, Darren]]></description>
			<content:encoded><![CDATA[<p>I am publishing my MySQL related bookmark collection <strong><a href="http://www.mysqlpreacher.com/bookmarks/" target="_blank">http://www.mysqlpreacher.com/bookmarks/</a></strong>.</p>
<p>Feel free to send me links you think might be good to add in order to help others.</p>
<p>Remember, SHARING IS CARING!!! …. we get so much for free, why shouldn’t we give some back?</p>
<p>Cheers,<br />
Darren</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/09/mysql-related-bookmark-collection/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Slap&#8217;em</title>
		<link>http://mysqlpreacher.com/wordpress/2009/02/slapem/</link>
		<comments>http://mysqlpreacher.com/wordpress/2009/02/slapem/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 13:37:49 +0000</pubDate>
		<dc:creator>Darren Cassar</dc:creator>
				<category><![CDATA[Beginner]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[benchmarking]]></category>
		<category><![CDATA[monitoring]]></category>
		<category><![CDATA[mysqlslap]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://mysqlpreacher.com/wordpress/?p=80</guid>
		<description><![CDATA[Giving a bunch of mysql instances something you do everyday and you might think &#8230;.. how should I do it? Write a bunch of selects and inserts manually? nahh that takes s**tload of time, should I run binlogs collected from a live system on my test server? nahh thats not practical nor is it real [...]]]></description>
			<content:encoded><![CDATA[<p>Giving a bunch of mysql instances something you do everyday and you might think &#8230;.. how should I do it? Write a bunch of selects and inserts manually? nahh that takes s**tload of time, should I run binlogs collected from a live system on my test server? nahh thats not practical nor is it real since it doesn&#8217;t contain selects, should I gather the general query log and try that out? nahhh  &#8230;..</p>
<p>MySQL has been kind enough to supply us with their mysql_slap which does the job for us and given I needed to do a proof of concept on monitoring a group of 4 circular replicated servers I wrote a small script which does the job of slapping them with a varying level of concurrancy, iterations, number of queries and connections for as long as you like.</p>
<p>Here it is and I hope some of you might find it useful for slapping their own test servers :).</p>
<blockquote><p><code>#!/bin/bash</code></p>
<p><code>NumberOfConcurrentLoads=4</code><br />
<code>LOGFILE=randomslap-4n-circularreplication</code></p>
<p><code>load () {</code></p>
<p><code> run=0</code><br />
<code> #Obtaining pid of the current process</code><br />
<code> PID=$$</code></p>
<p><code> echo "MySQL Slap random loading MySQL instances" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Loading child $a out of $NumberOfConcurrentLoads"  &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Starting at: `date`" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo ""</code></p>
<p><code> while [ 1 ]</code><br />
<code> do</code></p>
<p><code> #Generate a few values for the actual command to run through</code><br />
<code> prt=$((RANDOM%4+17001))  #ports being 17001,17002,17003,17004</code><br />
<code> cnc=$((RANDOM%50+1))     #number of concurrent sessions</code><br />
<code> itr=$((RANDOM%9+1))      #number of iterations</code><br />
<code> noq=$((RANDOM%100+50))   #number of queries</code><br />
<code> sec=$((RANDOM%30+10))    #seconds idle after finishing the process</code></p>
<p><code> echo "Run number $run" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo `date +%Y/%m/%d---%H:%M | sed 's/---/  /'` &gt;&gt; $LOGFILE-$PID.log</code></p>
<p><code> echo "Port=$prt" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Concurrency=$cnc" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Iterations=$itr" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Number-Of-Queries=$noq" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> echo "Breaktime=$sec" &gt;&gt; $LOGFILE-$PID.log</code></p>
<p><code> echo "Output:" &gt;&gt; $LOGFILE-$PID.log</code><br />
<code> mysqlslap --user=root --password='msandbox' --auto-generate-sql -vv -h hostname -P $prt --concurrency=$cnc --iterations=$itr --number-of-queries=$noq &gt;&gt; $LOGFILE-$PID.log</code></p>
<p><code> run=`expr $run + 1`</code><br />
<code> sleep $sec</code></p>
<p><code> done</code></p>
<p><code>}</code><br />
<code>#Fork a number of concurrent scripts to emulate more of a realistic load rather than one process connecting to just one server at a time</code><br />
<code>for ((a=1;a&lt;=NumberOfConcurrentLoads;a++))</code><br />
<code>do</code><br />
<code> load &amp;</code><br />
<code>done</code></p></blockquote>
<p>If you are wondering &#8230; yes I totally indendate my code :) but the html version came out this way and I didn&#8217;t bother with indenting it using html really.</p>
]]></content:encoded>
			<wfw:commentRss>http://mysqlpreacher.com/wordpress/2009/02/slapem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

