<?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>KarkomaOnline &#187; MySQL</title>
	<atom:link href="http://www.karkomaonline.com/index.php/category/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.karkomaonline.com</link>
	<description>a Blog for SysAdmins and Unix stuff in general</description>
	<lastBuildDate>Thu, 25 Nov 2010 07:49:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>MySQL quick backup</title>
		<link>http://www.karkomaonline.com/index.php/2008/01/mysql-quick-backup/</link>
		<comments>http://www.karkomaonline.com/index.php/2008/01/mysql-quick-backup/#comments</comments>
		<pubDate>Sun, 27 Jan 2008 06:34:11 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.karkomaonline.com/index.php/2008/01/27/mysql-quick-backup/</guid>
		<description><![CDATA[This trick will show you how to quickly perform a MySQL backup. So let&#8217;s dump all the contents of your databases and compress them to be more portable. mysqldump -u root -p &#8211;all-databases &#124; gzip &#62; myDatabases.sql.gz If you now want to dump this data to another server, simply type: gunzip &#60; myDatabases.sql.gz &#124; mysql [...]]]></description>
			<content:encoded><![CDATA[<p>This trick will show you how to quickly perform a MySQL backup. So let&#8217;s dump all the contents of your databases and compress them to be more portable.</p>
<blockquote><p>mysqldump -u root -p &#8211;all-databases | gzip &gt; myDatabases.sql.gz</p></blockquote>
<p>If you now want to dump this data to another server, simply type:</p>
<blockquote><p>gunzip &lt; myDatabases.sql.gz | mysql -u root -p</p></blockquote>
<p>Reference:</p>
<p>Mysqldump <a href="http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/dev.mysql.com/doc/refman/5.0/en/mysqldump.html?referer=');">manual</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2008/01/mysql-quick-backup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sun Microsystems acquires MySQL AB</title>
		<link>http://www.karkomaonline.com/index.php/2008/01/sun-microsystems-acquires-mysql-ab/</link>
		<comments>http://www.karkomaonline.com/index.php/2008/01/sun-microsystems-acquires-mysql-ab/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 08:30:31 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.karkomaonline.com/index.php/2008/01/16/sun-microsystems-acquires-mysql-ab/</guid>
		<description><![CDATA[From Sun Microsystems web site: Sun announced an agreement to acquire MySQL AB, an open source icon and developer of one of the world&#8217;s fastest growing open source databases. This acquisition accelerates Sun&#8217;s position in enterprise IT to now include the $15 billion database market and reaffirms Sun&#8217;s position as the leading provider of platforms [...]]]></description>
			<content:encoded><![CDATA[<p>From Sun Microsystems web site:</p>
<blockquote><p>Sun announced an agreement to acquire MySQL AB, an open source icon and developer of one of the world&#8217;s fastest growing open source databases. This acquisition accelerates Sun&#8217;s position in enterprise IT to now include the $15 billion database market and reaffirms Sun&#8217;s position as the leading provider of platforms for the Web economy and its role as the largest commercial open source contributor.</p></blockquote>
<p>More information from <a href="http://www.sun.com/aboutsun/pr/2008-01/sunflash.20080116.1.xml" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.sun.com/aboutsun/pr/2008-01/sunflash.20080116.1.xml?referer=');">Sun Microsystems</a>, <a href="http://blogs.cnet.com/8301-13505_1-9851662-16.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/blogs.cnet.com/8301-13505_1-9851662-16.html?referer=');">Cnet</a> and <a href="http://blogs.mysql.com/kaj/2008/01/16/sun-acquires-mysql/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/blogs.mysql.com/kaj/2008/01/16/sun-acquires-mysql/?referer=');">MySQL</a> web site.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2008/01/sun-microsystems-acquires-mysql-ab/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>MySQL: quick replacement</title>
		<link>http://www.karkomaonline.com/index.php/2007/12/mysql-quick-replacement/</link>
		<comments>http://www.karkomaonline.com/index.php/2007/12/mysql-quick-replacement/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 04:45:44 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.karkomaonline.com/index.php/2007/12/06/mysql-quick-replacement/</guid>
		<description><![CDATA[Say that you have a table called myTable with several rows and a column called URL that contains the IP address of a log server. Now imagine that you want to change the value of URL so IP address is substituted by the server name. One way to do that is as follows: use dbname [...]]]></description>
			<content:encoded><![CDATA[<p>Say that you have a table called myTable with several rows and a column called URL that contains the IP address of a log server. Now imagine that you want to change the value of URL so IP address is substituted by the server name. One way to do that is as follows:</p>
<blockquote><p>use dbname</p>
<p>update myTbl set URL=replace(URL,&#8217;172.16.1.10&#8242;,&#8217;logserver&#8217;);</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2007/12/mysql-quick-replacement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MySQL, Apache and PHP in Solaris 10</title>
		<link>http://www.karkomaonline.com/index.php/2006/12/installing-mysql-apache-and-php-in-solaris-10/</link>
		<comments>http://www.karkomaonline.com/index.php/2006/12/installing-mysql-apache-and-php-in-solaris-10/#comments</comments>
		<pubDate>Mon, 11 Dec 2006 00:43:40 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2006/12/11/installing-mysql-apache-and-php-in-solaris-10/</guid>
		<description><![CDATA[This is a quick guide to install PHP4, MySQL4 and Apache2 in Solaris 10. In order to facilitate the management and installation of packages we will use the pkg-get tool. pkg-get is a tool to automate download and installation of binary packages, for example from Blastwave an Open Source software repository for Solaris. Our first [...]]]></description>
			<content:encoded><![CDATA[<p>This is a quick guide to install PHP4, MySQL4 and Apache2 in Solaris 10. In order to facilitate the management and installation of packages we will use the <em>pkg-get</em> tool. pkg-get is a tool to automate download and installation of binary packages, for example from <a href="http://www.blastwave.org/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/?referer=');">Blastwave</a> an Open Source software repository for Solaris.</p>
<p>Our first task will be the installation of pkg-get. At <a href="http://www.blastwave.org/howto.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/howto.html?referer=');">Blastwave</a> you&#8217;ll find a complete guide on how to undertake this task. Briefly:</p>
<blockquote><p>cd /tmp<br />
/usr/sfw/bin/wget http://www.blastwave.org/pkg_get.pkg<br />
pkgadd -d pkg_get.pkg all<br />
/usr/sfw/bin/wget http://www.blastwave.org/wget-i386.bin<br />
chmod 755 wget-i386.bin</p>
<p>PATH=/tmp:/opt/csw/bin:/usr/sbin:/usr/bin:</p>
<p> /usr/dt/bin:/usr/openwin/bin:/usr/ccs/bin<br />
export PATH</p>
<p>vi /opt/csw/etc/pkg-get.conf</p></blockquote>
<p>Pick a <a href="http://www.blastwave.org/mirrors.php" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/mirrors.php?referer=');">mirror</a> next to you. Then:</p>
<blockquote><p>pkg-get -i wget</p>
<p>PATH=/opt/csw/bin:/usr/sbin:/usr/bin:/usr/dt/bin:</p>
<p> /usr/openwin/bin:/usr/ccs/bin<br />
export PATH</p></blockquote>
<p>And now you may install other packages. But let&#8217;s focus in our target.</p>
<p>As Solaris 10 comes with MySQL and Apache installed by default, first we are going to uninstall them. Take a look at your system:</p>
<blockquote><p>pkginfo | grep -i apache</p>
<p>system      SUNWaclg                         Apache Common Logging<br />
system      SUNWapch2d                       Apache Web Server V2 Documentation<br />
system      SUNWapch2r                       Apache Web Server V2 (root)<br />
system      SUNWapch2u                       Apache Web Server V2 (usr)<br />
system      SUNWapchd                        Apache Web Server Documentation<br />
system      SUNWapchr                        Apache Web Server (root)<br />
system      SUNWapchu                        Apache Web Server (usr)</p>
<p>pkginfo | grep -i mysql</p>
<p>system      SUNWmysqlr                       mysql &#8211; MySQL Database Management System (root component)<br />
system      SUNWmysqlt                       mysql &#8211; MySQL Database Management System (test component)<br />
system      SUNWmysqlu                       mysql &#8211; MySQL Database Management System (usr component)</p></blockquote>
<p>Next task would be to uninstall these packages. Proceed as follows:</p>
<blockquote><p>pkgrm SUNWaclg SUNWapch2d SUNWapch2r SUNWapch2u SUNWapchd SUNWapchr SUNWapchu<br />
pkgrm SUNWmysqlr SUNWmysqlt SUNWmysqlu</p></blockquote>
<p>Finally, install Apache, MySQL and PHP from pkg-get:</p>
<blockquote><p>pkg-get -i apache2 mysql4 php4 mod_php</p></blockquote>
<p>That&#8217;s all. Now configure the software as usual. Note that packages installed with pkg-get reside in /opt/csw, so I recommed adding something like this to your /etc/profile:</p>
<blockquote><p>PATH=/opt/csw/bin:/opt/csw/mysql4/bin:$PATH<br />
export PATH</p></blockquote>
<p>More info:</p>
<p><a href="http://www.blastwave.org/howto.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/howto.html?referer=');">pkg-get installation howto</a><br />
<a href="http://www.blastwave.org/userguide/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.blastwave.org/userguide/?referer=');"> pkg-get users guide</a><br />
<a href="http://docs.sun.com/app/docs/doc/806-7612/6jgfmsvrq?a=view" target="_blank" onclick="pageTracker._trackPageview('/outgoing/docs.sun.com/app/docs/doc/806-7612/6jgfmsvrq?a=view&amp;referer=');"> Customizing Your Working Environment</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2006/12/installing-mysql-apache-and-php-in-solaris-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Implementing High Availability in MySQL</title>
		<link>http://www.karkomaonline.com/index.php/2004/01/implementing-high-availability-in-mysql/</link>
		<comments>http://www.karkomaonline.com/index.php/2004/01/implementing-high-availability-in-mysql/#comments</comments>
		<pubDate>Sat, 24 Jan 2004 23:18:41 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2004/01/24/implementing-high-availability-in-mysql/</guid>
		<description><![CDATA[MySQL provides a built-in data replication functionality for maintaining identical copies of its data to one or more backend servers, thus providing a simple High Availability mechanism. On the other hand, the Open Source community has several projects to implement failover techniques, being one of them Heartbeat. This article will show you how to implement [...]]]></description>
			<content:encoded><![CDATA[<p>MySQL provides a built-in data replication functionality for maintaining identical copies of its data to one or more backend servers, thus providing a simple High Availability mechanism. On the other hand, the Open Source community has several projects to implement failover techniques, being one of them Heartbeat.</p>
<p>This article will show you how to implement a clustered, highly available and inexpensive solution based on GNU/Linux and combining <a href="http://www.mysql.com/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.mysql.com/?referer=');">MySQL</a> as the database engine and <a href="http://linux-ha.org/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/linux-ha.org/?referer=');">Heartbeat</a> as the failover mechanism. The configuration will consist of a 2-node active/passive cluster.</p>
<p><span id="more-63"></span></p>
<p>I assume you have MySQL up and running on both nodes and that your are working with MySQL 4.0.13 or above. If not, please refer to MySQL manual <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_Installing.html#Installing" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.mysql.com/documentation/mysql/bychapter/manual_Installing.html_Installing?referer=');">here</a> and download a recent copy <a href="http://www.mysql.com/downloads/index.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.mysql.com/downloads/index.html?referer=');">here</a>.</p>
<p><strong>How does replication works in MySQL</strong></p>
<p>Replication in MySQL is very simple: one machine acts as the master server and one or more machines act as the backup servers (the replica servers). The master server keeps all changes made to its databases in binary log files, so the backup server(s) can read these files and apply the changes to its own copy of the data.</p>
<p>In more detail, the binary log file records all the changes (UPDATE, DELETE, INSERT&#8230;) made to the master&#8217;s databases since the first time the replication was configured and started. The master also creates and maintains an index file to keep track of the binary logs created. Upon connecting, the slave server(s) obtains new updates from the binary log and aplies them to its copy of the data.</p>
<p><strong>Note:</strong> As MySQL suggests, visit their <a href="http://www.mysql.com/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.mysql.com/?referer=');">website</a> often to check the latest changes and improvements to its database replication implementation.</p>
<p><strong>How does Heartbeat works</strong></p>
<p>Heartbeat is a piece of software that provides High Availability features such as monitoring the availability of the machines in the cluster, transferring the virtual IPs (more on this later) in case of failures and starting and stopping services.</p>
<p>The Heartbeat software running on the slave server periodically checks the health of the master server by listening to its heartbeats sent via null modem cable and/or a crossover ethernet cable. Note that in the best scenario slave&#8217;s main task is nothing but to monitor the health of its master. In case of a crash the slave will not receive the heartbeats from the master and then it will take over the virtual IPs and the services offered by the master.</p>
<p><strong>The overall picture</strong></p>
<p>Next figure shows the picture of our cluster.</p>
<p><a href="http://www.karkomaonline.com/wp-content/uploads/2007/08/2004012416185184_1.png" title="The cluster layout"><img src="http://www.karkomaonline.com/wp-content/uploads/2007/08/2004012416185184_1.png" alt="The cluster layout" /></a></p>
<p>As previously stated, our configuration will consist of a 2-node active/passive cluster: dbserv1, the master server and dbserv2, the slave server. Both machines are linked via serial COM port /dev/ttyS0 (null modem cable) and a crossover ethernet cable (eth0), through which they send its heartbeats to each other.</p>
<p>The 192.168.1.103 IP address at eth1:0 is the floating IP address, the virtual IP. This is the service IP where the master listens to and that will be transferred to the slave in case of a failure in the master. Requests from the application servers will be made through the virtual IP.</p>
<p>Both servers have another IP address that can be used to administer the machines: 192.168.1.101 and 192.168.1.102. Bear in mind that the virtual IP (192.168.1.103) is set up by Heartbeat, meaning that if it is not up and running in the active server there will be no access to the virtual service.</p>
<p><strong>Setting up replication</strong></p>
<p>1. Create a replication user on the master:</p>
<blockquote><p>mysql -u root -p</p></blockquote>
<p>At MySQL prompt type:</p>
<blockquote><p>GRANT REPLICATION SLAVE ON *.* TO replica@&#8221;%&#8221; IDENTIFIED BY &#8216;replica_passwd&#8217;;</p></blockquote>
<p>2. Stop MySQL on both the master server and the slave server. Take a snapshot of your databases from the master.</p>
<blockquote><p>/etc/init.d/mysql stop<br />
tar cvzf mysqldb.tgz /path/to/your/databases</p></blockquote>
<p>In my configuration I would&#8230;</p>
<blockquote><p>/etc/init.d/mysql stop<br />
tar cvzf mysqldb.tgz /var/mysql-data/*</p></blockquote>
<p>3. Copy the data to the slave</p>
<blockquote><p>scp /path/to/mysqldb.tgz  admin@dbserv2:/path/to/your/databases</p></blockquote>
<p>If you are using InnoDB tables, copy your tablespace file(s) and associated log files to the slave. In my case, the tablespace is called ibdata and the log files are those ib_*. So:</p>
<blockquote><p>scp /var/mysql-data/ibdata admin@dbserv2:/var/mysql-data<br />
scp /var/log/mysql/ib_* admin@dbserv2:/var/log/mysql</p></blockquote>
<p>4. Activate the binary log and assign a unique ID to the master:</p>
<blockquote><p>vi /etc/my.cnf</p></blockquote>
<p>Then add/change the following</p>
<blockquote><p> [mysqld]<br />
&#8230;..<br />
# Enable binary logs. Path to bin log is optional<br />
log-bin=/var/log/mysql/dbserv1<br />
# If the binary log exceeds 10M, rotate the logs<br />
max_binlog_size=10M<br />
# Set master server ID<br />
server-id=1<br />
&#8230;..</p></blockquote>
<p>Now you can start mysqld on the master. Watch the logs to see if there are problems.</p>
<blockquote><p>/etc/init.d/mysql start</p></blockquote>
<p>5. Log in on the slave.</p>
<blockquote><p>vi /etc/my.cnf</p></blockquote>
<p>Then add/change the following:</p>
<blockquote><p>server-id=2<br />
# This is eth0. Take a look at figure 1<br />
master-host=192.168.100.1<br />
master-user=replica<br />
master-password=replica_passwd<br />
# Port that master server is listening to<br />
master-port=3306<br />
# Number of seconds before retrying to connect to master. Defaults to 60 secs<br />
#master-connect-retry</p></blockquote>
<p>6. Uncompress the databases</p>
<blockquote><p>cd /path/to/your/databases<br />
tar xvzf mysqldb.tgz</p>
<p>chown -R mysql.mysql /path/to/your/databases</p></blockquote>
<p>Make sure your tablespace file(s) and associated files are in place (/path/to/your/databases in our example).</p>
<p>7. Start mysqld on the slave. Watch the logs to see if there are problems.</p>
<blockquote><p>/etc/init.d/mysql start</p></blockquote>
<p>8. Check if replication is working. For example, log in on the master, create a database and see if it is replicated on the slave:</p>
<blockquote><p>mysql -u root -p</p>
<p>create database replica_test;<br />
show databases;</p></blockquote>
<p><code><br />
+----------------+<br />
| Database       |<br />
+----------------+<br />
| replica_test    |<br />
| mysql           |<br />
| test              |<br />
| tmp              |<br />
+----------------+</code></p>
<p>Log in on the slave server and make sure the database replica_test is created:</p>
<blockquote><p> mysql -u root -p<br />
show databases;</p></blockquote>
<p><code><br />
+----------------+<br />
| Database             |<br />
+----------------+<br />
| replica_test     |<br />
| mysql                   |<br />
| test                     |<br />
| tmp                       |<br />
+----------------+</code></p>
<p>If you have problems, please refer to MySQL manual <a href="http://www.mysql.com/documentation/mysql/bychapter/manual_Replication.html#Replication" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.mysql.com/documentation/mysql/bychapter/manual_Replication.html_Replication?referer=');">here</a>.</p>
<p><strong>Installing and setting up Heartbeat</strong></p>
<p>Download a recent copy of Heartbeat from <a href="http://linux-ha.org/download/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/linux-ha.org/download/?referer=');">here</a> and then as usual&#8230;.</p>
<blockquote><p>configure<br />
make<br />
make install</p></blockquote>
<p>or:</p>
<blockquote><p>rpm -Uhv heartbeat-1.0.4-1.i386.rpm</p></blockquote>
<p>if you downloaded the RPM based package.</p>
<p><strong> Configuring heartbeat</strong></p>
<p>There are three files involved in the configuration of heartbeat:</p>
<ul>
<li>ha.cf: the main configuration file that describes the machines involved and how they behave.</li>
<li>haresources: this configuration file specifies virtual IP (VIP) and services handled by heartbeat.</li>
<li>authkeys: specifies authentication keys for the servers.</li>
</ul>
<p><strong>Sample /etc/ha.d/ha.cf</strong></p>
<blockquote><p># Time between heartbeats in seconds<br />
keepalive 1<br />
# Node is pronounced dead after 15 seconds<br />
deadtime 15<br />
# Prevents the master node from re-acquiring cluster resources after a failover<br />
nice_failback on<br />
# Device for serial heartbeat<br />
serial  /dev/ttyS0<br />
# Speed at which to run the serial line (bps)<br />
baud    19200<br />
# Port for udp (default)<br />
udpport 694<br />
# Use a udp heartbeat over the eth0 interface<br />
udp     eth0</p>
<p>debugfile /var/log/ha/ha.debug<br />
logfile /var/log/ha/ha.log</p>
<p># First node of the cluster (must be uname -a)<br />
node    dbserv1<br />
# Second node of the cluster (must be uname -a)<br />
node    dbserv2</p></blockquote>
<p><strong>Sample /etc/ha.d/haresources</strong></p>
<blockquote><p>dbserv1 Ipaddress::192.168.1.103::eth1</p></blockquote>
<p>This tells Heartbeat to set up 192.168.1.103 as the virtual IP (VIP). See figure above.</p>
<p><strong>Sample /etc/ha.d/authkeys</strong></p>
<blockquote><p>auth 1<br />
1 crc<br />
2 sha1 HI!<br />
3 md5 Hello!</p></blockquote>
<p>This file determines the authentication keys. Must be mode 600. As I assume that our network is relatively secure I configure crc as the authentication method. There is also md5 and sha1 available.</p>
<p>Now start heartbeat on dbserv1 and the on dbserv2, watch the logs, then stop heartbeat on the first node and see what happens on the second node. Start again heartbeat on the first node and stop it on the second and see the logs. If all is okay, you have a 2-node cluster up and running.</p>
<p><strong> What we have</strong></p>
<p>At this point we have a 2-node cluster with certain degree of availability and fault tolerance. Despite this could be a valid solution for non-critical environments, in really critical environments this configuration should be improved.</p>
<p><strong>Advantages</strong></p>
<ul>
<li>The cluster is fault tolerant</li>
<li>The cluster is relatively secure</li>
<li>There is no single point of failure (comments?)</li>
<li>Automatic fail over mechanism</li>
<li>Proven and solid OpenSource software for production environment (my experience)</li>
<li> Simple and easy to install and configure</li>
<li>Easy to administer</li>
<li>Inexpensive</li>
</ul>
<p><strong>Disadvantages</strong></p>
<p>Our cluster presents almost one serious problem in critical environments (i.e. 99,99% availability). As you know, when the master node fails, the standby node takes over the service and the virtual IP address. In this scenario, when the master comes back online again, it will act as the stand-by node (remember nice_failback on from /etc/ha.d/ha.cf?). As our configuration has not implemented a two-way replication mechanism, the actual master is not generating binary logs and the actual slave is not configured to act as such. There are means to avoid this disadvantage, but this is your homework <img src='http://www.karkomaonline.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . Let me know your progress.</p>
<p>As usual, comments are very welcome.</p>
<p><strong> References:</strong></p>
<ul>
<li><a href="http://www.mysql.com/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.mysql.com/?referer=');">Mysql</a></li>
<li><a href="http://linux-ha.org/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/linux-ha.org/?referer=');">Heartbeat</a></li>
<li><a href="http://www.karkomaonline.com/links.php?category=Clustering+and+High+Availability" target="_blank">More links</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2004/01/implementing-high-availability-in-mysql/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Lost MySQL root password?</title>
		<link>http://www.karkomaonline.com/index.php/2003/08/lost-mysql-root-password/</link>
		<comments>http://www.karkomaonline.com/index.php/2003/08/lost-mysql-root-password/#comments</comments>
		<pubDate>Mon, 11 Aug 2003 02:49:37 +0000</pubDate>
		<dc:creator>karkoma</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.karkoma.info/index.php/2003/08/10/lost-mysql-root-password/</guid>
		<description><![CDATA[Ok, if this is your only problem this little trick will show how to recover your root password. Proceed as follows. Stop the db engine /etc/init.d/mysql stop Restart the daemon /usr/bin/mysqld_safe &#8211;skip-grant-tables &#38; Go to the MySQL interactive command mysql -h your_hostname mysql Change the password with the GRANT command GRANT ALL PRIVILEGES ON * [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, if this is your only problem this little trick will show how to recover your root password.</p>
<p><span id="more-24"></span> Proceed as follows.</p>
<ul>
<li>    Stop the db engine</li>
</ul>
<blockquote><p>/etc/init.d/mysql stop</p></blockquote>
<ul>
<li>    Restart the daemon</li>
</ul>
<blockquote><p>/usr/bin/mysqld_safe &#8211;skip-grant-tables &amp;</p></blockquote>
<ul>
<li>    Go to the MySQL interactive command</li>
</ul>
<blockquote><p>mysql -h your_hostname mysql</p></blockquote>
<ul>
<li>    Change the password with the GRANT command</li>
</ul>
<blockquote><p>GRANT ALL PRIVILEGES ON * to root@localhost IDENTIFIED BY &#8216;passwd&#8217;;<br />
FLUSH PRIVILEGES;</p></blockquote>
<p>Maybe it should be better to flush privileges from mysqladmin:</p>
<blockquote><p>mysqladmin -h localhost flush-privileges</p></blockquote>
<p>That&#8217;s it. Now try to login as usual.</p>
<p><strong>References</strong>:</p>
<ul>
<li>    MySQL <a href="http://www.mysql.com/doc/" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.mysql.com/doc/?referer=');">documentation</a></li>
<li>    GRANT and REVOKE <a href="http://www.mysql.com/doc/G/R/GRANT.html" target="_blank" onclick="pageTracker._trackPageview('/outgoing/www.mysql.com/doc/G/R/GRANT.html?referer=');">syntax</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.karkomaonline.com/index.php/2003/08/lost-mysql-root-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

