<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
    <channel>
        <title>How CUBRID HA Works?</title>
        <link>http://www.cubrid.org/?mid=cubrid_ha_process</link>
        <description>How CUBRID HA Works?</description>
        <language>en</language>
        <pubDate>Thu, 30 Jun 2011 12:41:10 -0800</pubDate>
        <lastBuildDate>Tue, 20 Mar 2012 23:30:18 -0800</lastBuildDate>
        <generator>XpressEngine 1.4.4.1</generator>
                        										        <item>
            <title>How CUBRID HA ...</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/cubrid_ha_process</link>
            <guid isPermaLink="true">http://www.cubrid.org/cubrid_ha_process</guid>
                                    <description><![CDATA[<h1>How CUBRID HA Works?</h1>

<p>It short&nbsp;sentences, CUBRID HA:</p><p></p><ul><li>Is a feature to provide load-balanced, fault-tolerant and&nbsp;continuous&nbsp;service availability.</li><li>Provides automatic <a href="http://blog.cubrid.org/cubrid-story/overview-of-new-high-availability-features-in-cubrid-3-2/" target="_self">fail-over</a> feature which allows a falling master node to delegate the control to slave nodes without human intervention.</li></ul><p></p><p>More detailed information can be found in <a href="/manual/840/en/CUBRID%20HA-Overview" target="_self">CUBRID HA Overview</a> documentation.</p><p>The following image illustrates the architecture of the&nbsp;CUBRID HA Process.</p>

<p style="text-align:center"><img src="http://www.cubrid.org/files/attach/images/49/968/197/cubrid-ha-process-architecture.png" alt="CUBRID HA Process Architecture" width="735" height="691" editor_component="image_link"/></p>

<p>The process can be divided into two parts: Client and Server.</p><h3>Client side processes</h3>

<ol><li>Users make requests through a client application (a script on a web server).</li><li>Each application connects to a particular&nbsp;<a href="/manual/840/en/System%20Architecture-Broker" target="_self">broker</a>, a CUBRID&nbsp;middle-ware,&nbsp;and sends the request.</li><li>Then the broker relays the message to an active (master) database server.</li><li>The master database server executes the request and returns the data.</li></ol>

<h3>Server side processes</h3>

<p>On the server side each CUBRID HA node consists of the following&nbsp;<a href="/manual/840/en/Processes" target="_self">processes</a>:</p>

<ul><li><b>One</b>&nbsp;<b>cub_master</b>&nbsp;master process.</li><li><b>One or more</b>&nbsp;<b>cub_server</b>&nbsp;database server processes.</li><li><b>One or more</b>&nbsp;<b>copylogdb&nbsp;</b>replication log copy processes.</li><li>And,&nbsp;<b>one or more&nbsp;applylogdb&nbsp;</b>replication log reflection processes.</li></ul>

<p>When a database is configured, all of these processes will start. Since each of the processes run independently, the delay in replicating reflections does not affect the transaction that is being executed.</p>

<p>Additionally, each node uses two log files to deliver High-Availability:</p>

<ol><li><b>Transaction Log</b><br />Each incoming write transaction is automatically logged in this&nbsp;file.</li><li><b>Replica Log</b><br />This log file is used by a slave database server to apply the changes made to a master database server.<br />When the active database server fails, the fail-over occurs and the first <a href="/manual/840/en/cubrid_ha.conf" target="_self">configured</a> slave database server becomes a master node, while the failed node enters into a <b>dead&nbsp;</b>state. After the failed database server is restored, it uses the Replica Log file to replicate all the changes made in the meantime at the master database server. The database administrators have an option to make the restored node as a master node, or leave it as a standby. You can learn more about status changes in&nbsp;<a href="/manual/840/en/Servers" target="_self">CUBRID HA Servers</a>.</li></ol>

<p>Thus, when a request reaches the master database server, the following process flow can be observed.</p>

<ol><li>If the client request results in a write operation, the master node logs it to its&nbsp;<b>Transaction Log</b>&nbsp;file.</li><li>At any moment of a time the master node communicates with&nbsp;slave nodes through&nbsp;<a href="/manual/840/en/heartbeat%20Message" target="_self">CUBRID Heartbeat messages</a>. This allows to detect the failure of the master node and fail-over to one of the slave nodes based on configurations.</li><li>While a transaction is being logged on the active server, the&nbsp;<b>copylogdb</b>&nbsp;utility of each&nbsp;slave server requests the transaction log from the master node in real-time.</li><li>Then the&nbsp;<b>copylogdb</b>&nbsp;utility&nbsp;reflects the&nbsp;requested transaction log in a <b>Replica Log</b>&nbsp;file.</li><li>In the meantime, in each database server&nbsp;the <b>applylogdb</b>&nbsp;utility is running independently which constantly checks if the Replica Log file has been updated. All new transactions are automatically replicated by the <b>applylogdb</b>&nbsp;to its database server as shown in the figure above.&nbsp;The information of reflected replications is stored in the internal system table called <b><a href="/manual/840/en/db_ha_apply_info" target="_self">db_ha_apply_info</a></b>. DBAs can access this information using the <b><a href="/manual/840/en/cubrid%20applyinfo" target="_self">cubrid_applyinfo</a></b> utility.</li><li>As a part of the normal operation, each standby database server logs the transaction to their&nbsp;<b>Transaction Log</b>&nbsp;files.</li><ul><li>If the master database server fails, upon restoration it can replicate the data from one of these Transaction Log files of the slave nodes.</li></ul></ol>

<p>This explains the entire CUBRID HA Process.</p>]]></description>
                        <pubDate>Thu, 30 Jun 2011 11:41:45 -0800</pubDate>
                        <category>HA</category>
                        <category>CUBRID Heartbeat</category>
                        <category>replication</category>
                        <category>applylogdb</category>
                        <category>copylogdb</category>
                        <category>cub_server</category>
                        <category>db_ha_apply_info</category>
                        <category>cubrid_applyinfo</category>
                                </item>
            </channel>
</rss>
