<?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>Wiki Tutorials</title>
        <link>http://www.cubrid.org/?mid=wiki_tutorials</link>
        <description>Wiki Tutorials</description>
        <language>en</language>
        <pubDate>Tue, 20 Dec 2011 05:54:58 -0800</pubDate>
        <lastBuildDate>Tue, 21 May 2013 20:59:36 -0800</lastBuildDate>
        <generator>XpressEngine 1.4.4.1</generator>
                        										        <item>
            <title>Getting Started with CUBRID Database AMI (Amazon Machine Image)</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-database-ami-amazon-machine-image</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-database-ami-amazon-machine-image</guid>
                                    <description><![CDATA[<p>For those users looking to seamlessly deploy CUBRID Database on Amazon Web Services (AWS), we have created Amazon EC2 Machine Images (AMI) with CUBRID and its APIs installed. In this tutorial I will explain the key steps you need to perform in order to get everything started on AWS. We will:</p>
<ol>
<li>Review available CUBRID AMIs.</li>
<li>Review the software stack of the CUBRID AMI.</li>
<li>Create an account on Amazon Web Services.</li>
<li>Launch your instances based on CUBRID AMI.</li>
<li>Configure your instance.</li>
</ol>
<h2>CUBRID AMI</h2>
<p>The following is a list of CUBRID AMI we (<strong>owner ID:&nbsp;</strong><b>024941853939</b>) provide officially. We distribute CUBRID AMIs to all available regions (<em>if a new region is available and we do not distribute there, let us know and we will add it as well</em>).&nbsp;Shortly we will add AMIs based on other Linux distirbutions as well.</p>
<table border="0">
<thead> 
<tr>
<td>Owner ID</td>
<td>CUBRID Version</td>
<td>OS</td>
<td>Root Device</td>
<td>Image Size</td>
<td>AMI ID</td>
<td>EC2 Region</td>
</tr>
</thead> 
<tbody>
<tr>
<td>024941853939</td>
<td>CUBRID 8.4.3.1005 x64</td>
<td>Ubuntu 12.04.1 x64</td>
<td>EBS</td>
<td>8GB</td>
<td>ami-cd8713a4</td>
<td>us-east-1 (N. Virginia)</td>
</tr>
<tr>
<td style="text-align: center;"><span style="text-align: center;">=</span></td>
<td style="text-align: center;"><span style="text-align: center;">=</span></td>
<td style="text-align: center;"><span style="text-align: center;">=</span></td>
<td style="text-align: center;"><span style="text-align: center;">=</span></td>
<td style="text-align: center;">=</td>
<td>ami-5aea606a</td>
<td>us-west-2 (Oregon)</td>
</tr>
<tr>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td>ami-6ae4c72f</td>
<td>us-west-1 (N. California)</td>
</tr>
<tr>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td>ami-9ee3edea</td>
<td>eu-west-1 (Ireland)</td>
</tr>
<tr>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td>ami-980c41ca</td>
<td>ap-southeast-1 (Singapore)</td>
</tr>
<tr>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td>ami-77c14576</td>
<td>ap-northeast-1 (Tokyo)</td>
</tr>
<tr>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td>ami-ee5accd4</td>
<td>ap-southeast-2 (Sydney)</td>
</tr>
<tr>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td style="text-align: center;">=</td>
<td>ami-039c471e</td>
<td>sa-east-1 (S&atilde;o Paulo)</td>
</tr>
</tbody>
</table>
<p>I will explain how to use these Amazon Machine Images below. First, let's see what software will be available for you in this Amazon Machine Image.</p>
<h2>Software Stack</h2>
<h3>OS</h3>
<ul>
<li><strong>Official Ubuntu</strong> 12.04.1 (precise) x64 LTS cloud AMI <a href="https://help.ubuntu.com/community/EC2StartersGuide">distributed</a> by Canonical (AMI ID:&nbsp;ami-8e109ebe; note, this is <em>not</em> CUBRID AMI ID).</li>
</ul>
<p>We will soon provide CentOS based CUBRID AMIs.</p>
<h3>Default software</h3>
<p>The following software is installed on Ubuntu 12.04.1 by default.</p>
<ul>
<li><strong>Python</strong> 2.7.3 with pip 1.0</li>
<li><strong>Perl</strong> 5.14.2 with CPAN 1.57</li>
</ul>
<h3>Custom software</h3>
<p>Now here we have installed the software necessary to work with CUBRID Database Server.&nbsp;</p>
<ul>
<li><strong>CUBRID Database Server</strong>&nbsp;8.4.3.1005 x64</li>
<li><strong>Python driver</strong> v8.4.3.0002</li>
<li><strong>Perl driver</strong>&nbsp;8.4.3.0001</li>
<li><strong>PHP&nbsp;</strong>5.3.10 with PECL/PEAR</li>
<li><strong>PHP driver</strong>&nbsp;8.4.3.0001</li>
<li><strong>PDO driver</strong>&nbsp;8.4.3.0001</li>
<li><strong>Apache HTTP Server</strong>&nbsp;2.2.22 (installed automatically by PHP)</li>
</ul>
<p>These are all you need to get started with CUBRID Database on Amazon Web Services.</p>
<h2>Getting Started</h2>
<h3>Create an account on Amazon Web Services</h3>
<p>If you already have an AWS account, you can skip this step and continue. If you do not have one:</p>
<ol>
<li>Go to <a href="http://aws.amazon.com">http://aws.amazon.com</a>, and click on the <strong>Sign Up</strong> button. Sign in to your existing AWS account or create a new one.</li>
<li>Go to&nbsp;<a href="http://aws.amazon.com/ec2">http://aws.amazon.com/ec2</a>&nbsp;and clck on teh <strong>Sign Up Now</strong>&nbsp;button. If it is the first time you are signing up, you may be eligible for&nbsp;free&nbsp;750&nbsp;hours of Micro instance every month for one year.<ol>
<li>Enter your credit card information and complete your signup for the Amazon EC2 service.&nbsp;It takes from several hours to couple of days for your EC2 account to set up. Eventually you should receive a confirmation email from Amazon Web Services.</li>
</ol></li>
<li>Once you have your EC2 account set up, go to <a href="https://console.aws.amazon.com/ec2/">EC2 Web Console</a>.<ol>
<li>Create a <strong>key pair</strong>. You will need this key pair to launch EC2 instances and connect to them via SSH. The public key will remain in your EC2 account, while you will use the private key when establising an SSH connection to newly created instances.<ol>
<li>Click <strong>Key Pairs</strong> under <em>Networking and Security</em> in the Navigation pane and then click the <strong>Create Key Pair</strong> button (save it in e.g. <em>~/.ec2/ec2.pem</em>).&nbsp;<span style="color: #ff0000;">Download the private key.</span>&nbsp;You will not be able to download it later. Do it now!</li>
</ol></li>
<li>Set up your Amazon <strong>API credentials</strong>. For this you need to create a new certificate.<ol>
<li>On the top right corner of the EC2 page go to the menu displayed by your name, there choose <strong>Security Credentials</strong>.</li>
<li>Under the <em>Access Credentials</em> click on the <strong>X.509 Certificates</strong> tab.</li>
<li>Create a new certificate.</li>
<li>Once created, download the private key and the certificate (save them in e.g. <em>~/.ec2/cert-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem</em> and <em>~/.ec2/pk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem</em>).</li>
<li>Make your credential files private. In your command line type:<br /><code>chmod go-rwx ~/.ec2/*.pem</code></li>
<li>If at a later time you need to create a new certificate, you can come back here and create a new certificate again.</li>
</ol></li>
</ol></li>
</ol><ol></ol>
<p>Congratulations! Now you are ready to create your first Amazon EC2 instance.</p>
<h3>Launching CUBRID Instance</h3>
<p>There are different ways you can find and launch CUBRID Amazon Machine Images. Below I will explain two ways:</p>
<ul>
<li>From AWS site</li>
<li>From your EC2 Web Console</li>
</ul>
<h4>From AWS site</h4>
<p>You can navigate to&nbsp;<a href="http://aws.amazon.com/amis/cubrid-8-4-3-sql-database-ebs-64-bit-ubuntu-12-04-1">http://aws.amazon.com/amis/cubrid-8-4-3-sql-database-ebs-64-bit-ubuntu-12-04-1</a>&nbsp;public AMI listing and press the Launch Instance button from there. Then continue as described below.</p>
<p><img height="531" width="737" alt="aws_cubrid_ami_public_listing_8.4.3.png" src="/files/attach/images/245686/716/568/aws_cubrid_ami_public_listing_8.4.3.png" /></p>
<h4>From your EC2 Web Console</h4>
<ol>
<li>Go back to your&nbsp;<a href="https://console.aws.amazon.com/ec2/">EC2 Web Console</a>.</li>
<li>At the top right corner of the page you will see a dropdown menu with a list of <a href="http://aws.amazon.com/about-aws/globalinfrastructure/">availability zones</a>.&nbsp;Switch to the one you&nbsp;think is most suitable for your needs.</li>
<li>Once the Web Console is refreshed, you will see a <strong>Launch Instance</strong> button. Press it&nbsp;in order to&nbsp;see the Launch Wizard.</li>
<li>Select the&nbsp;<strong>Classic Wizard</strong>&nbsp;and press <strong>Continue</strong>.</li>
</ol>
<h4>Configure EC2 Instance</h4>
<ol>
<li>Now you need to choose one of CUBRID AMIs.ins<ol>
<li>Press on the <strong>Community AMIs</strong> tab.</li>
<li>In the search box type <strong>cubrid</strong>&nbsp;or directly enter one of&nbsp;the CUBRID AMI IDs available in that region. The system will list matching AMIs as shown in the schreenshot below.<br /><img src="/files/attach/images/245686/716/568/aws_choose_cubrid_ami.png" alt="aws_choose_cubrid_ami.png" width="655" height="179" /> </li>
<li>Make sure the&nbsp;<strong>owner ID is&nbsp;</strong><b>024941853939</b>. You can find it the <strong>Manifest</strong>&nbsp;field as shown above. This owner ID proves that the selected AMI is created by us, the CUBRID Team, and we will provide support. In case another owner ID is set for some of our CUBRID AMIs, we will mention so in the table above.</li>
<li>To select the desired CUBRID AMI, press the <strong>Select</strong> button on the right of that image.</li>
<li>Next,&nbsp;configure your instances.<ol>
<li>Choose the <strong>number of instances</strong>. In this tutorial we will choose to launch only 1 instance.</li>
<li>Then choose the&nbsp;<strong><a href="http://aws.amazon.com/ec2/instance-types/">Instance Type</a></strong>&nbsp;you want to launch. Each type differs in CPU units, CPU cores, Memory, and Price. You may want to check out the <a href="http://aws.amazon.com/ec2/pricing/">EC2 Pricing</a> to make the right decision. For this tutorial we will choose the smallest T1.Micro instance which provides <em>613MB of memory</em> and <em>up to 2 EC units (</em><i>for short periodic bursts)</i>. <strong>Notice</strong>, though, that this Micro instance does <strong>not</strong> guarantee 2 EC units. In fact, it will provide&nbsp;only short periodic bursts of 2 EC units, and often it will fall way below the expectation. For more details and test results on this matter check out&nbsp;Greg Wilson's blog about&nbsp;<a href="http://gregsramblings.com/2011/02/07/amazon-ec2-micro-instance-cpu-steal/">Amazon EC2 Micro Instance and Stolen CPU</a>.</li>
<li>Next, you may choose between <strong>Launch Instances</strong>&nbsp;(the normal EC2 instances) and <strong><a href="http://aws.amazon.com/ec2/spot-instances/">Request Spot Instances</a></strong>. If you are just beginning, I suggest you go with a common&nbsp;<strong>Launch Instances</strong>&nbsp;option. This is what we will do in this tutorial.</li>
<li><strong>Availability Zone</strong>: if you have no preference on where exactly in your current region should the instance launch, simply leave it as <strong>No Preference</strong>.</li>
<li>Once done, press the <strong>Continue</strong> button.<br /><img height="407" width="615" alt="aws_cubrid_ami_details.png" src="/files/attach/images/245686/716/568/aws_cubrid_ami_details.png" />&nbsp;</li>
</ol></li>
<li>Next, the Launch Wizard will show <strong>Advanced Options</strong>. You may leave everything with the default settings, and press <strong>Continue</strong>.<br /><img height="438" width="655" alt="aws_cubrid_ami_advanced_options.png" src="/files/attach/images/245686/716/568/aws_cubrid_ami_advanced_options.png" /></li>
<li><strong>Storage Device Configuration</strong>: the defult configuration of the CUBRID AMI will attach an 8GB EBS volume storage device (<em>default from Ubuntu by Canonical</em>) to the newly launched instance. You may leave it with the default settings, or if necessary change it by pressing on the <em>Edit</em> button. When done, press on the <strong>Continue</strong> button.<br /><img height="436" width="655" alt="aws_cubrid_ami_storage_device.png" src="/files/attach/images/245686/716/568/aws_cubrid_ami_storage_device.png" />&nbsp;</li>
<li>Next, add tags to your instance. For example, you can give a&nbsp;<strong>Name</strong>&nbsp;to your instance such as&nbsp;<strong>My new instance with CUBRID 8.4.3</strong>&nbsp;or something of that sort. Then press the <strong>Continue</strong> button.<br /><img height="438" width="655" alt="aws_cubrid_ami_tags.png" src="/files/attach/images/245686/716/568/aws_cubrid_ami_tags.png" /></li>
<li>Now you need to choose the <strong>Key Pairs</strong>&nbsp;to let the EC2 know which keys will allow users to access this instance via SSH. Now, you have already created your Key Pair above when you created your EC2 account, have not you? If you have previously created your Key Pair <strong>and</strong>&nbsp;you have the private key downloaded, then choose it from the given list as shown below. If you have not created the Key Pair before or want to create a new one now, then choose the <strong>Create a new Key Pair</strong> option, and create one. In this tutorial, I will use the previously created Key Pair. <em>Remember</em>, that once you set this Key Pair in this step, you will not be able to change it after the instance is launched.<br />&nbsp;<img height="437" width="655" alt="aws_cubrid_ami_key_pairs.png" src="/files/attach/images/245686/716/568/aws_cubrid_ami_key_pairs.png" /> </li>
<li>Next, <strong>Configure the Firewall</strong>.<ol>
<li>If you have not created any <strong>Security Group</strong> before, you will be given a <strong>Default</strong>&nbsp;group as shown in the following screenshot. This default security group restricts any kind of access to this instance from outside. But we will not choose it. Instead, we will create a new Security Group specifically for CUBRID Database usage. So, continue reading.<br /><img height="412" width="615" alt="aws_cubrid_ami_firewall.png" src="/files/attach/images/245686/716/568/aws_cubrid_ami_firewall.png" /></li>
<li>We will create a new Security Group to open CUBRID database related ports. So choose the <strong>Create a new Security Group</strong> option.<ol>
<li>For a <strong>Group Name</strong> enter <strong>CUBRID</strong>&nbsp;for you to know what this Security Group is related to.</li>
<li><strong>Group Description</strong>:&nbsp;<strong>Open CUBRID Database related ports</strong>.</li>
<li>Choose <strong>Custom TCP rule</strong>.</li>
<li>Enter <strong>8001-8003</strong>&nbsp;to a <strong>Port range</strong>.</li>
<li>Leave <strong>Source</strong>&nbsp;as <strong>0.0.0.0/0</strong>. This tells EC2 that the above specified port will listen to connections from any IP. If you want to limit only specific IP to have an access to this instance, enter the IP here.</li>
<li>Once done, press the <strong>Add Rule</strong> button.</li>
<li>Now repeat the last 3 steps to enter separate rules for <strong>30000</strong>, <strong>33000</strong>, <strong>8282</strong>, <strong>1523</strong> ports as shown in the screenshot below.</li>
<li>Finally open the SSH port 22. This time choose <strong>SSH</strong> from the <em>Create a new rule</em> dropdown box and press on the <strong>Add Rule</strong> button.</li>
<li>We are done! Press the <strong>Continue</strong> button.<br /><img height="385" width="575" alt="aws_cubrid_ami_firewall_cubrid.png" src="/files/attach/images/245686/716/568/aws_cubrid_ami_firewall_cubrid.png" /></li>
</ol></li>
</ol></li>
<li>Now, <strong>Review the Summary</strong>. If necessary, you can go back and customize any option as you wish. Once ready, press the <strong>Launch</strong> button to take off.<br /><img height="538" width="615" alt="aws_cubrid_ami_summary.png" src="/files/attach/images/245686/716/568/aws_cubrid_ami_summary.png" />&nbsp;</li>
</ol></li>
</ol>
<p>Quite a long way but you have made it! So, congratulations with your new CUBRID Instance! In fact, you can apply the same process with any other AMI distributed by other vendors.</p>
<h2>SSH Connection</h2>
<p>Now let's connect to our CUBRID Amazon Server via SSH and have a sightseeing tour! For this we need two items:</p>
<ol>
<li>A Private Key.</li>
<li>A Public DNS</li>
</ol>
<h3>Private Key</h3>
<p>The first thing to remember is that we have opened SSH port 22 in our "CUBRID" Security Group (<strong>step 5.10</strong> above). This means we can connect to the newly created instance right away with our <strong>private key</strong>. In fact, only those users who posess this&nbsp;<strong>private key</strong> that matches the <em>public key</em> assosiated with the newly launched instance can access this instance. Just to remind you, once you have set a Key Pair during the instance initialization step, you will not be able to change it.</p>
<h3>Public DNS</h3>
<p>In order to connect to our remote Amazon EC2 instance, we need to know either the IP address or the Public DNS attached to that instance. You can find the Public DNS of your instance if you go to&nbsp;<a href="https://console.aws.amazon.com/ec2/">https://console.aws.amazon.com/ec2</a>-&gt;Instances-&gt;<strong>My new instance with CUBRID 8.4.3</strong>.</p>
<p>Once you select your instance a detailed description will be displayed below it. You can find your Public DNS there as shown below.</p>
<p><img src="/files/attach/images/245686/716/568/aws_cubrid_ami_public_dns_1.png" alt="aws_cubrid_ami_public_dns.png" width="669" height="213" /></p>
<h3>Establish SSH connection</h3>
<p>So, we now have both the private key and the Public DNS. Let's establish an SSH connection.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;ssh&nbsp;-i&nbsp;MY_PRIVATE_KEY_FILE.pem&nbsp;ubuntu@MY_PUBLIC_DNS<br /> The&nbsp;authenticity&nbsp;of&nbsp;host&nbsp;'MY_PUBLIC_DNS&nbsp;(MY_PUBLIC_IP)'&nbsp;can't&nbsp;be&nbsp;established.<br /> RSA&nbsp;key&nbsp;fingerprint&nbsp;is&nbsp;dc:17:a9:ca:b8:c4:e5:59:f3:e4:8a:1a:03:cb:94:9e.<br /> Are&nbsp;you&nbsp;sure&nbsp;you&nbsp;want&nbsp;to&nbsp;continue&nbsp;connecting&nbsp;(yes/no)?&nbsp;yes<br /> Warning:&nbsp;Permanently&nbsp;added&nbsp;'MY_PUBLIC_DNS,MY_PUBLIC_IP'&nbsp;(RSA)&nbsp;to&nbsp;the&nbsp;list&nbsp;of&nbsp;known&nbsp;hosts.<br /> Welcome&nbsp;to&nbsp;Ubuntu&nbsp;12.04.1&nbsp;LTS&nbsp;(GNU/Linux&nbsp;3.2.0-31-virtual&nbsp;x86_64)<br /> <br /> &nbsp;*&nbsp;Documentation:&nbsp;&nbsp;https://help.ubuntu.com/<br /> <br /> &nbsp;&nbsp;System&nbsp;information&nbsp;as&nbsp;of&nbsp;Tue&nbsp;Jan&nbsp;29&nbsp;08:33:09&nbsp;UTC&nbsp;2013<br /> <br /> &nbsp;&nbsp;System&nbsp;load:&nbsp;&nbsp;0.08&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Processes:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;64<br /> &nbsp;&nbsp;Usage&nbsp;of&nbsp;/:&nbsp;&nbsp;&nbsp;14.9%&nbsp;of&nbsp;7.87GB&nbsp;&nbsp;&nbsp;Users&nbsp;logged&nbsp;in:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br /> &nbsp;&nbsp;Memory&nbsp;usage:&nbsp;8%&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IP&nbsp;address&nbsp;for&nbsp;eth0:&nbsp;10.248.26.17<br /> &nbsp;&nbsp;Swap&nbsp;usage:&nbsp;&nbsp;&nbsp;0%<br /> <br /> &nbsp;&nbsp;Graph&nbsp;this&nbsp;data&nbsp;and&nbsp;manage&nbsp;this&nbsp;system&nbsp;at&nbsp;https://landscape.canonical.com/<br /> <br /> 80&nbsp;packages&nbsp;can&nbsp;be&nbsp;updated.<br /> 35&nbsp;updates&nbsp;are&nbsp;security&nbsp;updates.<br /> <br /> Get&nbsp;cloud&nbsp;support&nbsp;with&nbsp;Ubuntu&nbsp;Advantage&nbsp;Cloud&nbsp;Guest<br /> &nbsp;&nbsp;http://www.ubuntu.com/business/services/cloud<br /> ubuntu@ip-MY_INTERNAL_IP:~$</div>
<p>Thus, we are in!</p>
<h2>Check CUBRID</h2>
<h3>Check CUBRID Server Status</h3>
<p>The first thing you can do is check the status of CUBRID Database Server.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">ubuntu@ip-MY_INTERNAL_IP:~$&nbsp;cubrid&nbsp;service&nbsp;status<br /> @&nbsp;cubrid&nbsp;master&nbsp;status<br /> ++&nbsp;cubrid&nbsp;master&nbsp;is&nbsp;not&nbsp;running.<br /> @&nbsp;cubrid&nbsp;server&nbsp;status<br /> ++&nbsp;cubrid&nbsp;master&nbsp;is&nbsp;not&nbsp;running.<br /> @&nbsp;cubrid&nbsp;broker&nbsp;status<br /> ++&nbsp;cubrid&nbsp;broker&nbsp;is&nbsp;not&nbsp;running.<br /> @&nbsp;cubrid&nbsp;manager&nbsp;server&nbsp;status<br /> ++&nbsp;cubrid&nbsp;manager&nbsp;server&nbsp;is&nbsp;not&nbsp;running.</div>
<p>Since we have not yet started the CUBRID Service, everything is stopped.</p>
<h3>Start CUBRID Server Status</h3>
<p>Start the CUBRID Service status:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">ubuntu@ip-MY_INTERNAL_IP:~$&nbsp;cubrid&nbsp;service&nbsp;start<br /> @&nbsp;cubrid&nbsp;master&nbsp;start<br /> ++&nbsp;cubrid&nbsp;master&nbsp;start:&nbsp;success<br /> @&nbsp;cubrid&nbsp;broker&nbsp;start<br /> ++&nbsp;cubrid&nbsp;broker&nbsp;start:&nbsp;success<br /> @&nbsp;cubrid&nbsp;manager&nbsp;server&nbsp;start<br /> ++&nbsp;cubrid&nbsp;manager&nbsp;server&nbsp;start:&nbsp;success</div>
<p>CUBRID Master, Broker and Manager Server services will start up.</p>
<p>Now, if you had created a database before and have set to auto start it, the CUBRID Server service would also start which would start the specified database.</p>
<p><strong>Notice</strong>, that in case you restart your EC2 instance, you will need to start CUBRID Service manually each time as it is not set to start on system startup.</p>
<h2>Conclusion</h2>
<p>In this tutorial you have learnt how to find and launch Amazon EC2 instances based on CUBRID Amazon Machine Images. We provide CUBRID AMIs on all regions. Now go straight to <a href="/wiki_tutorials">CUBRID Tutorials</a>&nbsp;and proceed to creating your first CUBRID database. For Driver related tutorials visit the <a href="/wiki_apis">CUBRID APIs</a> wiki page.</p>
<p>If you ever need any help or have a question, feel free to comment below, ask a question at <a href="/questions">CUBRID Q&amp;A site</a> or <a href="/forum">forum</a>, <a href="https://www.facebook.com/cubrid">Facebook</a> or <a href="https://twitter.com/CUBRID">Twitter</a>, or at <a href="http://webchat.freenode.net/?channels=cubrid">#cubrid Freenode Web Chat</a>.</p>
<ul>
</ul>]]></description>
                        <pubDate>Tue, 29 Jan 2013 01:33:36 -0800</pubDate>
                        <category>Amazon</category>
                        <category>AWS</category>
                        <category>EC2</category>
                        <category>AMI</category>
                        <category>ubuntu</category>
                                </item>
        										        <item>
            <title>CUBRID Tutorials</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-tutorials</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-tutorials</guid>
                                    <description><![CDATA[<h2>Quick Start</h2>
<p>It is very easy to get started with CUBRID. Follow these step-by-step tutorials and you will see how fun it is to learn CUBRID.</p>
<ul>
<li>Follow [CUBRID Installation Instructions] (Windows, Linux)</li>
<li><a target="_self" href="/manual/840/en/Starting%20the%20CUBRID%20Service">Start CUBRID Service</a></li>
<li>[Create a sample CUBRID Database from the command line]</li>
<li>[Start or Autostart CUBRID Database]</li>
<li>[Change database user password]</li>
<li>[Getting started with demodb (CUBRID Demo Database)]</li>
<li>[Create the demodb CUBRID Demo Database]</li>
<li>[Connecting to a remote CUBRID Database]</li>
<li>[Important Facts to Know about CUBRID]</li>
<li>[How to ... using CUBRID Tutorials|How to ... using CUBRID] - a set of HowTo tutorials.</li>
</ul>
<h3>Easy Database Administration</h3>
<ul>
<li><a target="_self" href="/blog/qcubrid-appstools/cubrid-web-manager-the-next-generation-sql-client-with-monitoring-features/">CUBRID Web Manager - the next generation SQL client with monitoring features</a>&nbsp;- Blog article</li>
<li><a target="_self" href="/?mid=downloads&amp;item=cubrid_manager&amp;os=detect">Download CUBRID Manager</a>&nbsp;(Windows, Linux, Mac OS X)</li>
<li><a target="_self" href="/run_cubrid_manager_on_mac">Run CUBRID Manager</a>. This tutorial will show you how to:  
<ul>
<li>Add and Connect to a host</li>
<li>Login to and&nbsp;Start a database</li>
<li>Execute queries (SELECT, UPDATE, DELETE)</li>
</ul>
</li>
<li>More details are available at <a target="_self" href="/wiki_tools/entry/cubrid-manager-manual">CM Manual</a>.</li>
</ul>
<h3>Install CUBRID Database Drivers</h3>
<ul>
<li><a target="_self" href="/wiki_apis/entry/cubrid-php-driver-installation-instructions">PHP Driver</a></li>
<li><a target="_self" href="/wiki_apis/entry/cubrid-pdo-driver-installation-instructions">PDO Driver</a></li>
<li><a target="_self" href="/wiki_apis/entry/cubrid-python-driver-installation-instructions">Python Driver</a></li>
<li><a target="_self" href="/wiki_apis/entry/cubrid-perl-driver-build-guide">Perl Driver</a></li>
<li><a target="_self" href="/wiki_apis/entry/cubrid-ruby-driver-installation-instructions">Ruby Driver</a></li>
<li><a target="_self" href="/wiki_apis/entry/cubrid-ado-net-driver-installation-guide">ADO.NET Driver</a></li>
<li><a target="_self" href="/wiki_apis/entry/cubrid-odbc-driver-installation-instructions">ODBC Driver</a></li>
<li><a target="_self" href="/wiki_apis/entry/cubrid-odbc-driver-installation-instructions">OLEDB Driver</a></li>
<li><a target="_self" href="/wiki_apis/entry/setting-java-environment-path">JDBC Driver</a></li>
<li><a href="/wiki_apis/entry/cubrid-node-js-driver-installation-instructions">Node.js Driver</a></li>
<li><a target="_self" href="http://cubrid-talks.blogspot.kr/2012/12/cubrid-connection-strings.html">Interactive Connection String Builder</a> - user blog</li>
</ul>
<h3>Have Questions?</h3>
<p>So far so easy! But if you have questions, head to <a target="_self" href="/questions">CUBRID Q&amp;A site</a>. If you run into issues, post them on <a target="_self" href="/forum">CUBRID Forum</a>. We will be very glad to help you out!</p>
<h2>Going Further</h2>
<ul>
<li>[How to Contribute to CUBRID Project]</li>
<li><a target="_self" href="http://www.slideshare.net/cubrid/growing-in-the-wild-the-story-by-cubrid-database-developers" class="ss">Growing in the Wild. The story by CUBRID Database Developers.</a>&nbsp;- RIT++ 2012 Conference presentation</li>
<li><a target="_self" href="http://www.slideshare.net/cubrid/database-sharding-the-right-way-easy-reliable-and-open-source-highload-2012" class="ss">Database Sharding the Right Way: Easy, Reliable, and Open source</a> - HighLoad++ 2012 Conference presentation</li>
<li>[CUBRID Configurations]</li>
<li><a class="pdf" href="/?module=file&amp;act=procFileDownload&amp;file_srl=313266&amp;sid=ab3cc8f6cd6c836e486e51382ad0c736">CUBRID &ndash; Open Source RDBMS Highly Optimized for the Web</a>&nbsp;- M&amp;T Magazine, Sprint 2012, Vol. 20, Issue 1.</li>
<li><a href="/cubrid_version">How to Get the CUBRID Version Number</a></li>
</ul>
<h3>CUBRID SQL Tutorials</h3>
<ul>
<li>[CUBRID RDBMS Size Limits]</li>
<li>[Shared Query Plan Caching in CUBRID]</li>
<li>[Why prepare queries if auto-parameterization already does that?]</li>
<li>[Execute prepared SQL in CUBRID]</li>
<li><a target="_self" href="/cubrid_query_tuning">CUBRID Query Tuning</a></li>
<li><a target="_self" href="/cubrid_covering_index">What is Covering Index in CUBRID 8.4.0?</a></li>
<li><a target="_self" href="/cubrid_click_counter">CUBRID Click Counter</a></li>
<li><a target="_self" href="/cubrid_implicit_type_conversion">Comparison of Implicit Type Conversion in MSSQL, Oracle, MySQL, and CUBRID</a></li>
<li><a target="_self" href="/cubrid_mysql_oracle_data_type_mapping">CUBRID vs. MySQL vs. Oracle Data Type Mapping</a></li>
<li><a target="_self" href="/blog/cubrid-comparison/things-to-understand-when-moving-from-mysql-to-cubrid/">Things to Understand When Moving from MySQL to CUBRID</a>&nbsp;- blog article</li>
<li><a target="_self" href="/blog/dev-platform/how-sql-update-is-performed-in-cubrid-rdbms/">How SQL UPDATE is performed in CUBRID</a>&nbsp;- blog article.</li>
<li><a target="_self" href="/cubrid_serial">CUBRID Serials</a></li>
<li><a target="_self" href="/cubrid_database_information">Database Information in CUBRID</a></li>
<li><a target="_self" href="/manual/840/en/CUBRID%20SQL%20Guide">CUBRID SQL Guide</a></li>
<li>Hierarchical Queries in CUBRID  
<ul>
<li><a target="_self" href="http://ftp.cubrid.org/CUBRID_Docs/Tutorials/cubrid-hierarchical-query.pdf" class="pdf">CUBRID Hierarchical Queries</a></li>
<li><a target="_self" href="/manual/841/en/Hierarchical%20Query">Hierarchical Query</a> - Manual</li>
<li><a href="/concat_different_row_columns">How to Concatenate Column Values from Different Rows</a></li>
</ul>
</li>
<li>[Working with CUBRID BLOB / CLOB Data Types]</li>
<li>[Inserting a BLOB file to a CUBRID database]</li>
<li><a target="_self" href="http://cubrid-talks.blogspot.kr/2012/11/playing-with-clob-data-in-cubrid.html">Playing with CLOB data in CUBRID</a>&nbsp;- user blog</li>
<li><a target="_self" href="/transaction_and_lock">CUBRID Transaction and Lock</a></li>
<li><a target="_self" href="/cubrid_database_information">Obtaining Basic Database Information</a></li>
<li><a target="_self" href="/cubrid_mysql_oracle_data_type_mapping">Best Way to Store IP Address in CUBRID</a></li>
</ul>
<h3>Advanced CUBRID Server Topics</h3>
<ul>
<li>CUBRID Architecture  
<ul>
<li>[CUBRID Source Code]</li>
<li><a class="ss" target="_self" href="/cubrid_architecture_components">CUBRID Inside - Architecture, Source &amp; Management Components</a></li>
<li><a target="_self" href="/cubrid_architecture_sns">CUBRID Reference Architecture for Social Networking Service</a></li>
<li><a target="_self" href="/release_policy">CUBRID Release Policy</a></li>
<li><a target="_self" href="/cubrid_architecture">The Architecture of CUBRID</a></li>
<li><a target="_blank" href="http://blog.cubrid.org/cubrid-story/architecture-of-cubrid/">Architecture of CUBRID</a>&nbsp;- Blog article</li>
<li><a target="_self" href="/blog/cubrid-story/the-cubrid-broker-story/">The CUBRID Broker Story</a>&nbsp;- Blog article</li>
<li><a target="_self" href="/blog/cubrid-life/cubrid-database-processes/">CUBRID Database Processes</a>&nbsp;- Blog article</li>
<li><a target="_self" href="/blog/cubrid-life/basic-operations-of-cubrid-processes/">Basic Operations of CUBRID Processes</a>&nbsp;- Blog article</li>
<li>[CUBRID Query Processing]</li>
<li><a target="_self" href="/blog/cubrid-life/all-about-two-phase-locking-and-a-little-bit-mvcc/">All about Two-Phase Locking and a little bit MVCC</a> - Blog article</li>
<li><a target="_self" href="/blog/cubrid-life/how-data-is-stored-in-cubrid-rdbms-intro-to-objects-classes-oid-and-inheritance/">How data is stored in CUBRID RDBMS? Intro to Objects, Classes, OID and Inheritance</a>&nbsp;- Blog article</li>
</ul>
</li>
<li>CUBRID Performance  
<ul>
<li><a target="_self" href="/cubrid_840_key_features">CUBRID 8.4.0 Key Features</a></li>
<li><a target="_self" href="http://ftp.cubrid.org/CUBRID_Docs/Release_Notes/CUBRID2008R4.0_QA_Completion_Report.pdf" class="pdf">CUBRID 8.4.0 QA Completion Report</a></li>
<li><a target="_self" href="/cubrid_volume_space_reusability_test">CUBRID 8.4.0 vs. 8.3.1 Volume Space Reusability Comparison</a></li>
<li><a target="_self" href="/cubrid_mysql_sns_benchmark_test">CUBRID vs. MySQL Benchmark Test Results for SNS Data and Workload</a></li>
<li><a target="_self" href="/query_tuning_results">Increasing Database Performance by Query Tuning</a></li>
<li><a target="_self" href="/ssd_performance_test">CUBRID vs. MySQL performance test results before and after the SSD usage</a></li>
<li><a target="_self" href="/benchmark_result">NBD Benchmark Results</a></li>
</ul>
</li>
<li><a target="_blank" href="http://www.slideshare.net/cubrid/cubrid-developers-course" title="View SlideShare Presentation" class="ss">CUBRID Developer's Course</a><a target="_self" href="/files/docs/misc/CUBRID Developer's Course.pdf" title="Download this Presentation in PDF" class="pdf"></a></li>
<li><a target="_self" href="/intro_cubrid_security">Introduction to CUBRID Security - Part I</a><a target="_self" href="/files/docs/tutorials/cubrid/Introduction to CUBRID Security - Part I.pdf" title="Download this Presentation in PDF" class="pdf"></a></li>
<li><a target="_self" href="/intro_cubrid_security_2">Introduction to CUBRID Security - Part II</a><a target="_self" href="/files/docs/tutorials/cubrid/Introduction to CUBRID Security - Part II.pdf" title="Download this Presentation in PDF" class="pdf"></a></li>
<li>CSQL Interpreter  
<ul>
<li><a target="_self" href="/how_to_use_csql_utilities">How to Use CSQL (CUBRID SQL Interpreter)</a></li>
<li><a target="_blank" href="http://blog.cubrid.org/cubrid-story/csql-interpreter/">CSQL - Command Line SQL Interpreter</a>&nbsp;- Blog article</li>
</ul>
</li>
<li><a target="_self" href="/server_error_mesages">Server Error Msg</a></li>
<li>[CUBRID Error Codes]</li>
<li><a target="_self" href="/wiki_tutorials/entry/Data_Structures">Data Structures</a></li>
<li><a target="_self" href="/wiki_tutorials/entry/Connection_Management_and_Threads_in_CUBRID_Server">Connection Management and Threads in CUBRID Server</a></li>
<li><a target="_self" href="/wiki_tutorials/entry/Server_Startup/Shutdown_Process">Server Startup/Shutdown Process</a></li>
<li><a href="/cubrid_log_files">CUBRID Log Files</a></li>
<li>CUBRID HA  
<ul>
<li><a target="_self" href="/cubrid_ha_process">How CUBRID HA Works?</a></li>
<li>[Configure CUBRID HA with Vagrant and Chef Cookbook under 4 minutes]</li>
<li><a href="/files/docs/misc/CUBRID HA Starting Guide.pdf" title="Download this Presentation in PDF" class="pdf">CUBRID HA Starting Guide</a></li>
<li><a href="/?module=file&amp;act=procFileDownload&amp;file_srl=378680&amp;sid=6697aeb1683621b5b923f3de8d7b692e" class="pdf">CUBRID HA Guide Extended</a></li>
<li><a target="_blank" href="http://blog.cubrid.org/cubrid-story/overview-of-new-high-availability-features-in-cubrid-3-2/">Overview of New High-Availability Features in CUBRID 8.4.0</a>&nbsp;- Blog article</li>
<li><a target="_self" href="/cubrid_ha_oscon">CUBRID HA - Guaranteed Way to Never-Die Web Services</a>&nbsp;- OSCON 2011 Conference presentation</li>
</ul>
</li>
<li>CUBRID SHARD  
<ul>
<li><a target="_self" href="http://www.slideshare.net/cubrid/database-sharding-the-right-way-easy-reliable-and-open-source-highload-2012" class="ss">Database Sharding the Right Way: Easy, Reliable, and Open source</a>&nbsp;- HighLoad++ 2012 Conference presentation</li>
<li>[Configure CUBRID SHARD with Vagrant and Chef Cookbook under 2 minutes]</li>
<li><a href="http://www.slideshare.net/cubrid/easy-mysql-database-sharding-with-cubrid-shard-2013-percona">Easy MySQL Database Sharding with CUBRID SHARD</a> - 2013 Percona MySQL Conference presentation</li>
<li><a href="http://www.slideshare.net/cubrid/mysql-cubrid-shard-2013-rit">Быстрый и простой способ шардирования MySQL с помощью CUBRID SHARD</a> - 2013 RIT++</li>
<li><a target="_self" href="http://ftp.cubrid.org/CUBRID_Docs/Tutorials/cubrid-sharding-user-spec.pdf">CUBRID Database Sharding User Specifications</a></li>
<li><a target="_self" href="/blog/cubrid-life/database-sharding-with-cubrid/">Database Sharding with CUBRID</a>&nbsp;- Blog article</li>
<li><a target="_self" href="/blog/dev-platform/database-sharding-platform-at-nhn/">Database Sharding Platform at NHN</a>&nbsp;- Blog article</li>
<li><a target="_self" href="/?document_srl=485890&amp;mid=forum&amp;quote=Y&amp;rnd=486937#comment_486937">Getting started with CUBRID SHARD</a>&nbsp;- Forum post</li>
</ul>
</li>
<li><a target="_self" href="/cubrid_automated_scripts_hosting_service">CUBRID Automated Scripts for DB Hosting Service</a></li>
<li>Backup &amp; Restore  
<ul>
<li><a target="_self" href="/backup_cubrid_database">How to Backup a Database in CUBRID</a></li>
<li><a target="_self" href="/restore_cubrid_database">How to Restore a Database in CUBRID</a></li>
<li><a href="/cubrid_backup_restore">CUBRID Backup &amp; Restore - Part I (Backup)</a></li>
<li><a href="/cubrid_backup_restore_2">CUBRID Backup &amp; Restore - Part II (Restore)</a></li>
<li><a target="_self" href="/import_large_file">How to Efficiently Import Large Files in CUBRID</a></li>
</ul>
</li>
<li><a target="_self" href="/cubrid_triggers">CUBRID Triggers</a></li>
<li>Java Stored Procedures  
<ul>
<li><a target="_self" href="/cubrid_java_stored_procedures">CUBRID Java Stored Procedures</a></li>
<li><a target="_self" href="/manual/841/en/Java%20Stored%20Function%7CProcedure">Java Stored Procedure</a> - Manual</li>
<li><a target="_self" href="http://cubrid-talks.blogspot.kr/2012/11/emulate-long-running-SQL-queries-in-CUBRID.html">Emulate long running SQL queries in CUBRID</a>&nbsp;- user blog</li>
</ul>
</li>
</ul>
<h2>Working with Third-party Tools</h2>
<ul>
<li><a target="_self" href="/wiki_tutorials/entry/CUBRID_Service_through_CUBRID_Manager">CUBRID Service through CUBRID Manager</a></li>
<li><a target="_self" href="/wiki_tutorials/entry/RCP_Application">RCP Application</a></li>
<li>[Using Solr / Lucene for full text search with CUBRID Database on Ubuntu]</li>
<li><a target="_self" href="/install_cubrid_autoset">Install CUBRID with AutoSet</a></li>
<li><a target="_self" href="/ddlutils_scriptella_database_migration">Use Apache DdlUtils and Scriptella to migrate databases to CUBRID</a></li>
<li><a target="_blank" href="http://blog.cubrid.org/notice/apache-ddlutils-scriptella-migrating-to-cubrid/">Apache DDLUtils &amp; Scriptella: Migrating to CUBRID</a>&nbsp;- Video Tutorial</li>
<li><a target="_blank" href="http://blog.cubrid.org/cubrid-videos/scriptella-for-cubrid-video-tutorial/">Scriptella for CUBRID</a>&nbsp;- Video Tutorial</li>
<li><a target="_self" href="/how_to_do_replication_on_unix_and_linux">How to Do Replication on UNIX &amp; Linux</a></li>
<li><a target="_blank" href="http://blog.cubrid.org/cubrid-story/cubrid-support-tools/">CUBRID Administration Tools</a>&nbsp;- Blog article</li>
<li><a target="_self" href="/cubrid_web_query_tutorial">CUBRID WebQuery Tutorial</a></li>
<li><a target="_blank" href="http://blog.cubrid.org/cubrid-videos/uniform-server-cubrid-video-tutorial/">Uniform Server</a> - CUBRID Video Tutorial</li>
<li><a target="_blank" href="http://blog.cubrid.org/cubrid-videos/phpmyedit-for-cubrid-video-tutorial/">phpMyEdit for CUBRID</a> - Video Tutorial</li>
<li><a target="_blank" href="http://blog.cubrid.org/cubrid-videos/sql-buddy-for-cubrid-video-tutorial/">SQL Buddy for CUBRID</a> - Video Tutorial</li>
<li>Eclipse  
<ul>
<li><a target="_self" href="/using_cubrid_in_squirrel_sql_client">CUBRID Through SQuirrel SQL Client</a></li>
<li><a target="_self" href="/eclipse_sql_explorer">CUBRID Through Eclipse SQL Explorer</a></li>
<li><a target="_self" href="/quantumdb_eclipse_plugin">CUBRID through QuantumDB Eclipse plugin</a></li>
</ul>
</li>
<li><a target="_self" href="/using_cubrid_in_aquadatastudio">Using CUBRID in AquaDataStudio</a></li>
<li><a target="_self" href="/wordpress_for_cubrid_installation_guide">Installing WordPress for CUBRID</a></li>
<li><a target="_self" href="/cubrid_hibernate_tutorial">Using Hibernate with CUBRID</a></li>
<li><a target="_self" href="/analyzing_jdbc_logs">Analyzing JDBC Logs with log4jdbc</a></li>
<li><a target="_self" href="/store_java_logs_to_databdase_using_log4j">Store Java Logs to Database Using log4j</a></li>
<li><a target="_self" href="/clj_dbcp">Clj-DBCP Clojure Library for Connecting to CUBRID Database</a></li>
<li><a target="_self" href="/using_cubrid_with_powershell">Using CUBRID with PowerShell</a></li>
<li><a href="/wiki_tutorials/entry/solved-chef-nameerror-cannot-find-a-resource-for-converge_by-on-centos">[!Solved] Chef: NameError: Cannot find a resource for converge_by on centos</a></li>
</ul>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>]]></description>
                        <pubDate>Tue, 20 Dec 2011 04:59:29 -0800</pubDate>
                        <category>CUBRID</category>
                        <category>tutorials</category>
                                </item>
        										        <item>
            <title>DLL Load Failed</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=dll-load-failed</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=dll-load-failed</guid>
                                    <description><![CDATA[<p>A common problem encountered when configuring drivers is the "Dll Load Failed" error. This error can occur when <b>cascci.dll</b>&nbsp;file is not found or when the file found is not the correct 32 bit or 64 bit version that we are expecting. For example, "<span style="background-color: #fafafa;">ImportError:&nbsp;DLL&nbsp;load&nbsp;failed:&nbsp;%1&nbsp;is&nbsp;not&nbsp;a&nbsp;valid&nbsp;Win32&nbsp;application." error encountered in python (see example error message below), is caused when you install 32 bit version of python and 64 bit version of CUBRID on a 64 bit machine. The problem is CUBRID 64 bit comes with 64 bit version of cascci.dll which cannot be loaded by python.</span></p>
<p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">C:&#92;Program&nbsp;Files&nbsp;(x86)&#92;Python266&gt;python.exe<br /> Python&nbsp;2.6.6&nbsp;(r266:84297,&nbsp;Aug&nbsp;24&nbsp;2010,&nbsp;18:46:32)&nbsp;[MSC&nbsp;v.1500&nbsp;32&nbsp;bit&nbsp;(Intel)]&nbsp;on&nbsp;win32<br /> Type&nbsp;"help",&nbsp;"copyright",&nbsp;"credits"&nbsp;or&nbsp;"license"&nbsp;for&nbsp;more&nbsp;information.<br /> &gt;&gt;&gt;&nbsp;import&nbsp;CUBRIDdb<br /> Traceback:&nbsp;&nbsp;File&nbsp;"&lt;stdin&gt;",&nbsp;line&nbsp;1,&nbsp;in&nbsp;&lt;module&gt;<br /> &nbsp;&nbsp;File&nbsp;"C:&#92;Program&nbsp;Files&nbsp;(x86)&#92;Python266&#92;lib&#92;CUBRIDdb&#92;__init__.py",&nbsp;line&nbsp;9,&nbsp;in&nbsp;&lt;module&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;import&nbsp;_cubrid<br /> ImportError:&nbsp;DLL&nbsp;load&nbsp;failed:&nbsp;%1&nbsp;is&nbsp;not&nbsp;a&nbsp;valid&nbsp;Win32&nbsp;application.<br /> &gt;&gt;&gt;</div>
</p>
<p>The solution for this error is to download the cascci.dll driver for your CUBRID server version from here:&nbsp;</p>
<p><a href="http://www.cubrid.org/?mid=downloads&amp;item=cci_driver&amp;os=detect&amp;ostype=x86">http://www.cubrid.org/?mid=downloads&amp;item=cci_driver&amp;os=detect&amp;ostype=x86</a></p>
<p>And you must copy this file either in the same folder as your python installation (where the python.exe file is located) or into a location that is in the path. The idea we want here is to use our version of cci driver and not the one that comes with the CUBRID installation ($CUBRID&#92;bin&#92;cascci.dll). The same procedure is done for <b>php </b>driver also.</p>
<p><b>Note</b>: From the archives in the link above, only <b>cascci.dll</b>&nbsp;is required for driver usage. If you wish to replace C:&#92;CUBRID&#92;bin&#92;cascci.dll file, then you should replace &nbsp;<b>C:&#92;CUBRID&#92;lib&#92;cascci.lib also&nbsp;</b>with the cascci.lib file from the archive.</p>
<p>If anything is unclear, don't hesitate to ask a question in our <a href="/questions">Q&amp;A Site</a>.</p>]]></description>
                        <pubDate>Mon, 13 May 2013 05:02:25 -0800</pubDate>
                        <category>cascci.dll</category>
                        <category>dll loading</category>
                        <category>python</category>
                        <category>php</category>
                                </item>
        										        <item>
            <title>How to ... using CUBRID Tutorials</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-recipes</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-recipes</guid>
                                    <description><![CDATA[<div class="grid col2"><span>
<h3>Configuring CUBRID</h3>
<ul>
<li>[CUBRID Installation Instructions]</li>
<li>[Connecting to a remote CUBRID Database]</li>
<li>[How to Build CUBRID from Source on Fedora/Centos]</li>
<li>[How to Build CUBRID from Source on Ubuntu]</li>
<li>[How to Create a CUBRID Database]</li>
<li>[How to Start or Autostart a CUBRID Database]</li>
<li>[How to Start / Stop / Restart CUBRID Service]</li>
<li>[Getting started with demodb (CUBRID Demo Database)]</li>
<li>[How to Upgrade CUBRID Safely on Ubuntu]</li>
</ul>
<h3>CUBRID Specific Features</h3>
<ul>
<li>[CUBRID Database File Types and Their Meaning]</li>
<li>[CUBRID DATETIME Data Type]</li>
<li>[CUBRID iptables Firewall Configuration]</li>
<li>[CUBRID Log Files]</li>
<li>[How to Drop Some / All Tables]</li>
<li>[How to Enable/Disable AutoCommit Mode]</li>
<li>[How to Get Primary Keys]</li>
<li>[How to Get Foreign Keys]</li>
<li>[How to Insert Data into Tables with AUTO_INCREMENT Column(s)]</li>
<li>[How to Quote Reserved Keywords]</li>
<li>[How to Reduce Disk Space Occupied by CUBRID]</li>
<li>[How to Show Create Table Statement]</li>
</ul>
</span> <span>
<h3>Error Handling</h3>
<ul>
<li>[Common Microsoft Errors]</li>
<li>[DLL Load Failed]</li>
<li>[Dropping Primary Key Error]</li>
<li>[Permission Denied Error]</li>
<li>[Unable to Resolve Host]</li>
<li>[Unique Constraint Violation Error]</li>
<li>[Update / Delete Operations Restriction Error]</li>
</ul>
<h3>Export/Import Database/Tables</h3>
<ul>
<li>[Copy / Clone Database]</li>
<li>[Exporting / Unloading a Database Using CUBRID Manager]</li>
<li>[How to Run a SQL Script / File]</li>
<li>[Importing / Loading a Database Using CUBRID Manager]</li>
<li>[Migrating Tables Using CUBRID Manager]</li>
</ul>
<h3>Troubleshooting Drivers</h3>
<ul>
<li>[How to Get PHP Version]</li>
</ul>
</span></div>]]></description>
                        <pubDate>Mon, 29 Oct 2012 01:17:39 -0800</pubDate>
                        <category>error handling</category>
                        <category>export</category>
                        <category>import</category>
                                </item>
        										        <item>
            <title>How to Unsubscribe From Newsletter</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-unsubscribe-from-newsletter</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-unsubscribe-from-newsletter</guid>
                                    <description><![CDATA[<p>Hello everyone,</p>
<p>This easy step by step tutorial will teach you how to unsubscribe from the CUBRID Newsletter.</p>
<p>1. First, you must <b>login</b>. If you do not have an account, click "<b>Register</b>" in the top right part of this page.</p>
<p>2. To enable the newsletter, go to your profile by clicking "<b>My Profile</b>" in the top right part of the screen.</p>
<p>3. In the profile page, click the <b>Edit Profile</b> button in the lower part of the page.</p>
<p>4. In the Edit Profile screen, <b>uncheck </b>the checkbox next to Newsletter and click <b>Submit</b>.</p>
<p>The direct link of the Edit Profile screen is&nbsp;<a href="/?act=dispMemberModifyInfo">http://www.cubrid.org/?act=dispMemberModifyInfo</a>.</p>
<p>We wish you a great day and hope that you will return to our community in the future!</p>]]></description>
                        <pubDate>Thu, 02 May 2013 03:22:18 -0800</pubDate>
                        <category>newsletter</category>
                        <category>unsubscribe</category>
                        <category>cubrid community</category>
                                </item>
        										        <item>
            <title>How to Subscribe to Newsletter</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-subscribe-to-newsletter</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-subscribe-to-newsletter</guid>
                                    <description><![CDATA[<p>Hello everyone,</p>
<p>This easy step by step tutorial will teach you how to subscribe to the CUBRID Newsletter. Before starting, you should know that we will send you one email per week with the latest news in the CUBRID Community.</p>
<p>1. First, you must <b>login</b>. If you do not have an account, click "<b>Register</b>" in the top right part of this page.</p>
<p>2. To enable the newsletter, go to your profile by clicking "<b>My Profile</b>" in the top right part of the screen.</p>
<p>3. In the profile page, click the <b>Edit Profile</b> button in the lower part of the page.</p>
<p>4. In the Edit Profile screen, check the checkbox next to Newsletter and click <b>Submit</b>.</p>
<p>The direct link of the Edit Profile screen is&nbsp;<a href="http://www.cubrid.org/?mid=wiki_tutorials&amp;act=dispMemberModifyInfo">http://www.cubrid.org/?mid=wiki_tutorials&amp;act=dispMemberModifyInfo</a>.</p>
<p>Thank you for enabling the CUBRID newsletter and becoming part of the CUBRID Community!</p>]]></description>
                        <pubDate>Thu, 02 May 2013 03:17:48 -0800</pubDate>
                        <category>newsletter</category>
                        <category>cubrid community</category>
                        <category>my profile</category>
                                </item>
        										        <item>
            <title>Installing CUBRID on Ubuntu</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=installing-cubrid-on-ubuntu</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=installing-cubrid-on-ubuntu</guid>
                                    <description><![CDATA[<p>To install CUBRID using <strong>apt-get</strong>&nbsp;on Ubuntu, we need to add CUBRID's repository so that Ubuntu knows where to download the packages from, and then tell the OS to update its indexes.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">sudo add-apt-repository ppa:cubrid/cubrid<br />sudo apt-get update</div>
<p>If <code>add-apt-repository</code> command is not recognized by your system, you must install the <strong>python-software-properties</strong> package. Once the Python packages are installed, perform the step 1 above again, then continue.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">sudo&nbsp;apt-get&nbsp;install&nbsp;python-software-properties</div>
<p>Now install the latest version of CUBRID:</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">sudo apt-get install cubrid</div>
<p>To install an earlier version, indicate the version as:</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">sudo apt-get install cubrid-8.4.0</div>
<p>To complete the installation and set the CUBRID PATH variables, reboot your OS. Until you reboot, you can also run the command ". /etc/profile.d/cubrid.sh" every time you open up a terminal if cubrid command is not found.</p>
<p><strong>Optional:</strong>&nbsp;If you want to install the demodb sample database, run the command:</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">&nbsp;sudo apt-get install cubrid-demodb</div>
<h2>Installation Notes</h2>
<ul>
<li>CUBRID is installed in /opt/cubrid.</li>
<li>The configuration files are placed in /etc/opt/cubrid.</li>
<li>Variable files (such as logs or databases) are stored in /var/opt/cubrid.</li>
<li>The path variables $CUBRID and $CUBRID_DATABASES are set in the file /etc/profile.d/cubrid.sh.</li>
<li><strong>If you run a CUBRID service command, you can view its output in /var/opt/cubrid/tmp/service.cubrid.</strong></li>
<li>CUBRID is set to automatically start on boot and the service file is located at /etc/init.d/cubrid.</li>
<li><strong>Highly Important!&nbsp;</strong>cubrid or standalone csql commands can be only ran as cubrid user (which has no password). To connect as this user, use "sudo su -s $SHELL cubrid".</li>
</ul>]]></description>
                        <pubDate>Tue, 24 Jan 2012 20:49:06 -0800</pubDate>
                        <category>CUBRID</category>
                        <category>installation instructions</category>
                        <category>ubuntu</category>
                        <category>linux</category>
                        <category>launchpad</category>
                                </item>
        										        <item>
            <title>How to Enable/Disable AutoCommit Mode</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-enabledisable-autocommit-mode</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-enabledisable-autocommit-mode</guid>
                                    <description><![CDATA[<p>One thing anyone would want from a database is to use Transactions. In order to do so, one must know that CUBRID has autocommit enabled by default. In order to be able to use Transactions, this will need to be disabled and there are several ways to do this:</p>
<ul>
<li><b>CSQL Interpreter</b></li>
</ul>
<p><span style="white-space: pre;"> </span>In CSQL, the command ;autocommit or ;au for short:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">;au&nbsp;off</div>
<p><span style="white-space: pre;"> </span>Here is an example:&nbsp;<a href="/manual/90/en/Transaction%20Commit">http://www.cubrid.org/manual/90/en/Transaction Commit</a></p>
<ul>
<li><b>CUBRID Manager</b></li>
</ul>
<p><span style="white-space: pre;"> </span>In CUBRID Manager, autocommit can be disabled by clicking the autocommit icon in the upper part of the query editor tab.</p>
<p style="text-align: center;"><img height="120" width="779" alt="autocommit.png" src="/files/attach/images/245686/428/630/autocommit.png" /></p>
<ul>
<li><b>Drivers</b></li>
</ul>
<p><span style="white-space: pre;">&nbsp;</span>In various drivers, there are functions for each driver that allow enabling/disabling the autocommit mode:</p>
<p>PHP -&nbsp;<a href="http://www.php.net/manual/en/function.cubrid-set-autocommit.php">http://www.php.net/manual/en/function.cubrid-set-autocommit.php</a></p>
<p>Python -&nbsp;<a href="/wiki_apis/entry/cubrid-python-api-documentation">http://www.cubrid.org/wiki_apis/entry/cubrid-python-api-documentation</a>&nbsp;(autocommit in url)</p>
<p>Ruby -&nbsp;<a href="/wiki_apis/entry/cubrid-ruby-api-documentation">http://www.cubrid.org/wiki_apis/entry/cubrid-ruby-api-documentation</a></p>
<p>JDBC -&nbsp;<a href="/accessing_cubrid_with_jdbc_part2">http://www.cubrid.org/accessing_cubrid_with_jdbc_part2</a>&nbsp;(setAutoCommit function)</p>
<p>CCI -&nbsp;<a href="http://www.cubrid.org/manual/90/en/cci_set_autocommit">http://www.cubrid.org/manual/90/en/cci_set_autocommit</a></p>
<p>ADO.NET -&nbsp;<a href="http://www.cubrid.org/wiki_apis/entry/connection-options">http://www.cubrid.org/wiki_apis/entry/connection-options</a></p>
<p>&nbsp;</p>
<p><span style="white-space: pre;"> </span>Regardless of the approach chosen, 2 SQL commands can be used to commit or rollback a transaction:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">COMMIT</div>
<p>in order to commit a transaction and</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">ROLLBACK</div>
<p>in order to perform a rollback. You can also perform rollbacks to a savepoint. A tutorial with an example can be found here:&nbsp;<a href="/manual/90/en/Savepoint%20and%20Partial%20Rollback">http://www.cubrid.org/manual/90/en/Savepoint and Partial Rollback</a></p>]]></description>
                        <pubDate>Mon, 08 Apr 2013 06:50:41 -0800</pubDate>
                        <category>autocommit</category>
                        <category>transactions</category>
                                </item>
        										        <item>
            <title>How to Build CUBRID from Source on Fedora/Centos</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-build-cubrid-from-source-on-fedoracentos</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-build-cubrid-from-source-on-fedoracentos</guid>
                                    <description><![CDATA[<h2>Prerequisites</h2>
<p>To install the required packages, simply run the command below:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">sudo&nbsp;yum&nbsp;install&nbsp;libtool&nbsp;texinfo&nbsp;java-1.6.0-openjdk-devel&nbsp;flex&nbsp;gcc-c++&nbsp;ant&nbsp;ncurses-devel&nbsp;gc-devel&nbsp;glibc-devel&nbsp;lzo-devel&nbsp;libedit-devel&nbsp;pcre-devel&nbsp;libaio-devel&nbsp;elfutils-libelf-devel&nbsp;chrpath</div>
<p><i>Note</i>: <b>java-1.7.0-openjdk-devel</b> must be used on Fedora 17 and above instead of <b>java-1.6.0-openjdk-devel</b>.</p>
<p><i>Note</i>: On Fedora 15 and above, you must also install <b>systemd-units</b>.</p>
<p>Set the JAVA Environment Path:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">export&nbsp;JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0</div>
<p>Make sure the path corresponds to your installation.</p>
<h2><br />Building CUBRID</h2>
<p>Generate the configure script according to your environment:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">./autogen.sh</div>
<p>&nbsp;</p>
<p>Run configure with --prefix specifying the location where you want CUBRID to be built. <b>On 64 bit systems, you must add --enable-64-bit parameter.</b></p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">./configure&nbsp;--prefix=/usr/share/cubrid</div>
<p>(or ./configure --prefix=/usr/share/cubrid --enable-64-bit for 64 bit systems)</p>
<p>Run &nbsp;make and make install (for make install sudo access may be required to copy files to /usr/share/cubrid.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">make<br /> sudo&nbsp;make&nbsp;install</div>
<p>All the files are installed in the prefix directory (in this case /usr/share/cubrid).</p>
<p>The files are owned by root. If you want to edit the owner run:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">sudo&nbsp;chown&nbsp;-R&nbsp;user:user&nbsp;/usr/share/cubrid</div>
<p>The username and group in our example is <b>user</b>.</p>
<p>&nbsp;</p>
<p>In order to set the CUBRID enviroment variables, you can use this <a href="/?module=file&amp;act=procFileDownload&amp;file_srl=626669&amp;sid=5ab66a862e907cbb861a19266d941479">cubrid.sh</a>&nbsp;file. If you install CUBRID in a different directory, replace /usr/share/cubrid in the file with the path where you have installed CUBRID.</p>
<p>You have 2 options on how to use the <a href="/?module=file&amp;act=procFileDownload&amp;file_srl=626669&amp;sid=5ab66a862e907cbb861a19266d941479">cubrid.sh</a> file:&nbsp;</p>
<p>1. copy it to /etc/profile.d/cubrid.sh and this way it will be loaded automatically</p>
<p>2. copy it to any location you want and load it using the command:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">.&nbsp;/home/user/cubrid.sh</div>
<p>Make sure to leave a space between the "." and the <a href="/?module=file&amp;act=procFileDownload&amp;file_srl=626669&amp;sid=5ab66a862e907cbb861a19266d941479">cubrid.sh</a> file. We assumed that /home/user is the directory where you copied the cubrid.sh file.</p>
<p>&nbsp;</p>
<p>Create the databases folder and databases.txt file:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">mkdir&nbsp;-p&nbsp;/usr/share/cubrid/databases<br /> touch&nbsp;/usr/share/cubrid/databases/databases.txt</div>
<p>&nbsp;</p>
<p>Then, you can start and use cubrid:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">cubrid&nbsp;service&nbsp;start</div>
<p>If you encounter any issue, post it on <a href="/forum">our forum</a> or post a question in our <a href="/questions">Q&amp;A section</a>.</p>]]></description>
                        <pubDate>Wed, 03 Apr 2013 02:28:31 -0800</pubDate>
                        <category>build cubrid</category>
                        <category>Fedora</category>
                        <category>CentOS</category>
                                </item>
        										        <item>
            <title>How to Build CUBRID from Source on Ubuntu</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-build-cubrid-from-source-on-ubuntu</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-build-cubrid-from-source-on-ubuntu</guid>
                                    <description><![CDATA[<h2>Prerequisites</h2>
<p>To install the required packages, simply run the command below:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">sudo&nbsp;apt-get&nbsp;install&nbsp;openjdk-6-jdk&nbsp;ant&nbsp;texinfo&nbsp;make-doc&nbsp;libncurses5-dev&nbsp;libtool&nbsp;flex&nbsp;autoconf&nbsp;automake&nbsp;g++&nbsp;libelf-dev</div>
<p><i>Note</i>:&nbsp;<b>openjdk-7-jdk</b>&nbsp;must be used on Ubuntu 12.10 and above instead of&nbsp;<b>openjdk-6-jdk</b>.</p>
<p>Set the JAVA Environment Path:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">export&nbsp;JAVA_HOME=/usr/lib/jvm/java-6-openjdk-i386</div>
<p>Make sure the path corresponds to your installation.</p>
<h2><br />Building CUBRID</h2>
<p>Generate the configure script according to your environment:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">./autogen.sh</div>
<p>&nbsp;</p>
<p>Run configure with --prefix specifying the location where you want CUBRID to be built. <b>On 64 bit systems, you must add --enable-64-bit parameter.</b></p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">./configure&nbsp;--prefix=/opt/cubrid</div>
<p>(or ./configure --prefix=/opt/cubrid --enable-64-bit for 64 bit systems)</p>
<p>Run &nbsp;make and make install (for make install sudo access may be required to copy files to /opt/cubrid.</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">make<br /> sudo&nbsp;make&nbsp;install</div>
<p>All the files are installed in the prefix directory (in this case /opt/cubrid).</p>
<p>The files are owned by root. If you want to edit the owner run:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">sudo&nbsp;chown&nbsp;-R&nbsp;user:user&nbsp;/opt/cubrid</div>
<p>The username and group in our example is <b>user</b>.</p>
<p>In order to set the CUBRID enviroment variables, you can use this&nbsp;<a href="/?module=file&amp;act=procFileDownload&amp;file_srl=626839&amp;sid=09657542458f78a39f0b9816c8a57aef">cubrid.sh</a> file. If you install CUBRID in a different directory, replace /opt/cubrid in the file with the path where you have installed CUBRID.</p>
<p>You have 2 options on how to use the&nbsp;<a href="/?module=file&amp;act=procFileDownload&amp;file_srl=626839&amp;sid=09657542458f78a39f0b9816c8a57aef">cubrid.sh</a>&nbsp;file:&nbsp;</p>
<p>1. copy it to /etc/profile.d/cubrid.sh and this way it will be loaded automatically</p>
<p>2. copy it to any location you want and load it using the command:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">.&nbsp;/home/user/cubrid.sh</div>
<p>Make sure to leave a space between the "." and the&nbsp;<a href="/?module=file&amp;act=procFileDownload&amp;file_srl=626839&amp;sid=09657542458f78a39f0b9816c8a57aef">cubrid.sh</a>&nbsp;file. We assumed that /home/user is the directory where you copied the cubrid.sh file.</p>
<p>&nbsp;</p>
<p>Create the databases folder and databases.txt file:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">mkdir&nbsp;-p&nbsp;/opt/cubrid/databases<br /> touch&nbsp;/opt/cubrid/databases/databases.txt</div>
<p>&nbsp;</p>
<p>Then, you can start and use cubrid:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">cubrid&nbsp;service&nbsp;start</div>
<p>If you encounter any issue, post it on <a href="/forum">our forum</a> or post a question in our <a href="/questions">Q&amp;A section</a>.</p>]]></description>
                        <pubDate>Tue, 02 Apr 2013 23:37:01 -0800</pubDate>
                        <category>build cubrid</category>
                        <category>ubuntu</category>
                                </item>
        										        <item>
            <title>How to Start or Autostart a CUBRID Database</title>
            <dc:creator>Laura Oh</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=start-or-autostart-cubrid-database</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=start-or-autostart-cubrid-database</guid>
                                    <description><![CDATA[<h1>1. CUBRID Script for Autostart on Linux</h1>
<p>1-1.&nbsp;We provide a cubrid script for auto start database processes.</p>
<p>Please get download a script file from : <br /><a href="http://svn.cubrid.org/websvn/filedetails.php?repname=cubridscripts&amp;path=/cubrid_scripts/cubrid">http://svn.cubrid.org/websvn/filedetails.php?repname=cubridscripts&amp;path=/cubrid_scripts/cubrid</a></p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="true" first_line="1" code_type="Plain" editor_component="code_highlighter">#!/bin/bash<br /> #&nbsp;<br /> #&nbsp;cubrid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This&nbsp;shell&nbsp;script&nbsp;takes&nbsp;care&nbsp;of&nbsp;starting&nbsp;and&nbsp;stopping<br /> #&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;CUBRID&nbsp;service<br /> #<br /> #&nbsp;chkconfig:&nbsp;2345&nbsp;98&nbsp;05<br /> #&nbsp;description:&nbsp;cubrid&nbsp;start/stop&nbsp;script&nbsp;&nbsp;<br /> #<br /> #&nbsp;ts:4<br /> <br /> ###&nbsp;BEGIN&nbsp;INIT&nbsp;INFO<br /> #<br /> #&nbsp;Short-Description:&nbsp;CUBRID&nbsp;&nbsp;&nbsp;<br /> #&nbsp;Provides:&nbsp;CUBRID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> #&nbsp;Default-Start:&nbsp;3&nbsp;5<br /> #&nbsp;Default-Stop:&nbsp;0&nbsp;6<br /> ###&nbsp;END&nbsp;INIT&nbsp;INFO<br /> <br /> <br /> #&nbsp;Source&nbsp;function&nbsp;library.<br /> .&nbsp;/etc/init.d/functions<br /> <br /> #&nbsp;return&nbsp;code<br /> CUBRID_SUCCESS=0<br /> CUBRID_FAILED=1<br /> <br /> US=`uname&nbsp;-n`<br /> WHOAMI=`whoami`<br /> RETVAL=0<br /> prog=cubrid<br /> _old_IFS="&nbsp;$IFS"<br /> <br /> ###&nbsp;user&nbsp;specific&nbsp;environment&nbsp;##################<br /> CUBRID_USER=cubrid<br /> <br /> if&nbsp;[&nbsp;$WHOAMI&nbsp;=&nbsp;"root"&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CUBRID_DATABASES=`su&nbsp;-&nbsp;$CUBRID_USER&nbsp;-c&nbsp;'printenv&nbsp;CUBRID_DATABASES'`<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CUBRID_HOME=`su&nbsp;-&nbsp;$CUBRID_USER&nbsp;-c&nbsp;'printenv&nbsp;CUBRID'`<br /> else<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CUBRID_USER=$WHOAMI<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CUBRID_HOME=$CUBRID<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;export&nbsp;PATH=$PATH:$CUBRID_HOME/bin<br /> fi<br /> <br /> RFNAME=/tmp/.$prog.$CUBRID_USER<br /> ################################################<br /> <br /> sudo_cubrid()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;"$#"&nbsp;-ne&nbsp;1&nbsp;]&nbsp;&amp;&amp;&nbsp;return<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;$WHOAMI&nbsp;=&nbsp;"root"&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;su&nbsp;-&nbsp;$CUBRID_USER&nbsp;-c&nbsp;"$1"&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sh&nbsp;-c&nbsp;"$1"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br /> }<br /> save_IFS()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;_old_IFS="&nbsp;$IFS"&nbsp;#&nbsp;save&nbsp;$IFS<br /> }<br /> <br /> restore_IFS()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;-z&nbsp;"$_old_IFS"&nbsp;]&nbsp;#&nbsp;restore&nbsp;old&nbsp;$IFS<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;then&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unset&nbsp;IFS<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IFS="$_old_IFS"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br /> }<br /> <br /> check_config()<br /> {<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;CHECK&nbsp;ha-mode<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cubrid_conf_file=$CUBRID_HOME/conf/cubrid.conf<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;-r&nbsp;$cubrid_conf_file&nbsp;]&nbsp;||&nbsp;exit<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;eval&nbsp;"$(sed&nbsp;$cubrid_conf_file&nbsp;-n&nbsp;-e&nbsp;'s/&#92;(.*&#92;)&#92;b.*=[&#92;&nbsp;]*&#92;(.*&#92;)/&#92;1="&#92;2"/p')"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;$ha_mode"x"&nbsp;!=&nbsp;"x"&nbsp;]&nbsp;&amp;&amp;&nbsp;[&nbsp;$ha_mode&nbsp;=&nbsp;"yes"&nbsp;-o&nbsp;$ha_mode&nbsp;=&nbsp;"on"&nbsp;-o&nbsp;$ha_mode&nbsp;=&nbsp;"role-change"&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$CUBRID_FAILED<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$CUBRID_SUCCESS<br /> }<br /> <br /> <br /> service_start()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo_cubrid&nbsp;"cubrid&nbsp;service&nbsp;start&nbsp;2&gt;&amp;1&nbsp;&gt;$RFNAME"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;grep&nbsp;-wqs&nbsp;"fail"&nbsp;$RFNAME<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;$RETVAL&nbsp;-ne&nbsp;0&nbsp;]&nbsp;||&nbsp;return&nbsp;$CUBRID_FAILED<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$CUBRID_SUCCESS<br /> }<br /> <br /> service_stop()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo_cubrid&nbsp;"cubrid&nbsp;service&nbsp;stop&nbsp;2&gt;&amp;1&nbsp;&gt;$RFNAME"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;grep&nbsp;-wqs&nbsp;"fail"&nbsp;$RFNAME<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;$RETVAL&nbsp;-ne&nbsp;0&nbsp;]&nbsp;||&nbsp;return&nbsp;$CUBRID_FAILED<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;$CUBRID_SUCCESS<br /> }<br /> <br /> service_status()<br /> {&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;sudo_cubrid&nbsp;"cubrid&nbsp;service&nbsp;status"<br /> }<br /> <br /> start()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_config&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;$RETVAL&nbsp;-eq&nbsp;$CUBRID_SUCCESS&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;service_start<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;$RETVAL&nbsp;-eq&nbsp;$CUBRID_SUCCESS&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;-n&nbsp;$"Starting&nbsp;$prog:&nbsp;"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;service_stop&nbsp;&nbsp;&nbsp;&nbsp;<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;-n&nbsp;$"Starting&nbsp;$prog:&nbsp;"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;failure<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[&nbsp;$WHOAMI&nbsp;=&nbsp;"root"&nbsp;]&nbsp;&amp;&amp;&nbsp;touch&nbsp;/var/lock/subsys/$prog<br /> }<br /> <br /> stop()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_config&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;$RETVAL&nbsp;-eq&nbsp;$CUBRID_SUCCESS&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;service_stop<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;$RETVAL&nbsp;-eq&nbsp;$CUBRID_SUCCESS&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;-n&nbsp;$"Stopping&nbsp;$prog:&nbsp;"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;-n&nbsp;$"Stopping&nbsp;$prog:&nbsp;"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;failure<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> }<br /> <br /> restart()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_config&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;$RETVAL&nbsp;-eq&nbsp;$CUBRID_SUCCESS&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;service_stop<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;service_start<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;$RETVAL&nbsp;-eq&nbsp;$CUBRID_SUCCESS&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;-n&nbsp;$"Restarting&nbsp;$prog:&nbsp;"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;-n&nbsp;$"Restarting&nbsp;$prog:&nbsp;"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;failure<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> }<br /> <br /> status()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_config&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;[&nbsp;$RETVAL&nbsp;-eq&nbsp;$CUBRID_SUCCESS&nbsp;];&nbsp;then<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;service_status<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;RETVAL=$?<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi<br /> }<br /> <br /> case&nbsp;"$1"&nbsp;in&nbsp;<br /> &nbsp;&nbsp;start)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;start&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;<br /> &nbsp;&nbsp;stop)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stop<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;<br /> &nbsp;&nbsp;restart)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;restart<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;<br /> &nbsp;&nbsp;status)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;status<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;*)&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;$"Usage&nbsp;$0&nbsp;{start|stop|restart|status}"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit&nbsp;1<br /> esac<br /> <br /> exit&nbsp;0</div>
<p>&nbsp;</p>
<p>1-2.&nbsp;Copy cubrid file into /etc/init.d/</p>
<p>&nbsp;</p>
<p>1-3. You should modify "CUBRID_USER= " part in the file if you install CUBRID with a different user(Default username: cubrid).&nbsp;</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">###&nbsp;user&nbsp;specific&nbsp;environment&nbsp;##################<br /> CUBRID_USER=cubrid</div>
<p>&nbsp;</p>
<p>1-4. Grant a execution permission by a following command:&nbsp;</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">chmod&nbsp;a+x&nbsp;cubrid</div>
<p>&nbsp;</p>
<p>1-5. Run chkconfig commans as follows:&nbsp;</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">chkconfig&nbsp;--add&nbsp;cubrid<br /> <br /> chkconfig&nbsp;--level&nbsp;0345&nbsp;cubrid&nbsp;on<br /> <br /> chkconfig&nbsp;--list&nbsp;|&nbsp;grep&nbsp;cubrid</div>
<p>&nbsp;</p>
<p>1-6. If your configuration is correct, you will encounter followings on a prompt. Now your script will work on whenever your server starts-up. &nbsp; &nbsp;</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">&nbsp;cubrid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0:on&nbsp;&nbsp;&nbsp;&nbsp;1:off&nbsp;&nbsp;&nbsp;2:on&nbsp;&nbsp;&nbsp;&nbsp;3:on&nbsp;&nbsp;&nbsp;&nbsp;4:on&nbsp;&nbsp;&nbsp;&nbsp;5:on&nbsp;&nbsp;&nbsp;&nbsp;6:off</div>
<p>&nbsp;</p>
<p>1-7. Let's see if your script works correctly.&nbsp;</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">/etc/init.d/cubrid&nbsp;start</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h1>2. Configuration for Autostart when running CUBRID SERVICE START &nbsp;</h1>
<p>CUBRID provides one more convenient feature. You can specify databases, brokers, manageer processes as CUBRID SERVICE. If so, your command "cubrid service start" or "cubrid service stop" will run each of process you specified in cubrid.conf .&nbsp;</p>
<p>To start a database process only, type the following command in the terminal. Remember that all these operations can also be performed in GUI based CUBRID Manager, if you prefer.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="true" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">cubrid server start my_database</div>
<p style="text-align: justify;">&nbsp;</p>
<p style="text-align: justify;">If you use particular databases very often, you may configure CUBRID to auto start them when CUBRID Server is started. The configuration file is located in <span style="font-family: monospace;">$CUBRID/conf/<a target="_self" href="/manual/841/en/cubrid.conf%20Configuration%20File%20and%20Default%20Parameters">cubrid.conf</a></span>. The default locations are <b>C:&#92;CUBRID&#92;conf&#92;cubrid.conf </b>on Windows and <b>/opt/cubrid/conf/cubrid.conf</b> on Linux. Find the line which is commented out like:</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="true" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">#server=foo,bar</div>
<p style="text-align: justify;">&nbsp;</p>
<p style="text-align: justify;">Uncomment this line by removing the hash (<span style="font-family: monospace;">#</span>) sign, and instead of default <span style="font-family: monospace;">foo,bar</span> list your databases separated by commas like:</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="true" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">server=my_database,my_other_database</div>
<p style="text-align: justify;">Next time you restart CUBRID Server, the configured database(s) will be automatically started for you. In fact, each database will be auto started with the same "<span style="font-family: monospace;">cubrid server start</span>" command you usually use to manually start the database.</p>
<p style="text-align: justify;">As a side note, you should know that in order to start a database, the&nbsp;<b style="font-style: italic;">server process</b>&nbsp;must be running (the "server" keyword in "<span style="font-family: monospace;">cubrid server start</span>" command). The <i><b>server process</b></i> is usually automatically started by CUBRID Service upon "<span style="font-family: monospace;">cubrid service start</span>". To make this sure, check if "server" keyword is listed in the following line in the same <span style="font-family: monospace;">cubrid.conf</span> configuration file.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="true" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">service=server,broker,manager</div>]]></description>
                        <pubDate>Fri, 04 May 2012 01:33:26 -0800</pubDate>
                        <category>database</category>
                        <category>start database</category>
                        <category>cubrid.conf</category>
                        <category>configurations</category>
                        <category>CUBRID Service</category>
                                </item>
        										        <item>
            <title>CUBRID Source Code</title>
            <dc:creator>Laura Oh</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-source-code</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-source-code</guid>
                                    <description><![CDATA[<h2>Overview</h2>
<p>CUBRID uses <a target="_self" href="http://subversion.tigris.org/">Subversion</a> to manage its source code at <a target="_self" href="http://sourceforge.net/projects/cubrid/">Sourceforge.net</a>. Instructions on Subversion use can be found at&nbsp;<a target="_self" href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a>.</p>
<h2>Web access</h2>
<p>You may browser the source repository using SF.net's interface at&nbsp;<a target="_self" href="http://cubrid.svn.sourceforge.net/viewvc/cubrid/">http://cubrid.svn.sourceforge.net</a>&nbsp; or at&nbsp;<a href="http://svn.cubrid.org/websvn/">http://svn.cubrid.org/websvn/</a>.&nbsp;</p>
<h2>Anonymous SVN access</h2>
<p>The latest version of CUBRID source code can be checked out anonymously from SVN branch with the following command:</p>
<p>&nbsp;</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="true" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">svn&nbsp;co&nbsp;http://cubrid.svn.sourceforge.net/svnroot/cubrid/cubrid/branches/RB-&lt;CUBRID&nbsp;VERSION&gt;&nbsp;cubrid</div>
<p>Replace <code>&lt;CUBRID VERSION&gt;</code> with the appropriate version number such as <b>8.4.1</b>.&nbsp;Browse the repository at&nbsp;<a target="_self" href="http://cubrid.svn.sourceforge.net/viewvc/cubrid/">http://cubrid.svn.sourceforge.net/viewvc/cubrid/</a>&nbsp;to find available versions.</p>
<h2>Download source code</h2>
<p>Alternatively, you can simply download <b>.tar.gz</b> CUBRID source code from each version at the <a target="_self" href="/?mid=downloads&amp;item=cubrid&amp;os=detect">Downloads page</a>&nbsp;or the <a href="ftp://ftp.cubrid.org/CUBRID_Engine/">CUBRID FTP</a>.</p>
<p>&nbsp;</p>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>]]></description>
                        <pubDate>Mon, 18 Jun 2012 19:07:33 -0800</pubDate>
                        <category>SVN</category>
                        <category>source code</category>
                        <category>CUBRID</category>
                                </item>
        										        <item>
            <title>How to Upgrade CUBRID Safely on Ubuntu</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-upgrade-cubrid-safely-on-ubuntu</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-upgrade-cubrid-safely-on-ubuntu</guid>
                                    <description><![CDATA[<p>In this tutorial, we will focus on users that have installed CUBRID from apt-get. If this is the case, then the databases should be located in /var/opt/cubrid/databases or /opt/cubrid/databases.</p>
<p>If you upgrade from 8.4.0 to 8.4.1 or 8.4.3 for example, you only need to save the databases folder, uninstall and reinstall CUBRID using the following commands:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">mkdir&nbsp;-p&nbsp;/home/user/database_backup<br /> cp&nbsp;-R&nbsp;/var/opt/cubrid/databases&nbsp;/home/user/database_backup<br /> sudo&nbsp;apt-get&nbsp;remove&nbsp;cubrid<br /> sudo&nbsp;apt-get&nbsp;update<br /> sudo&nbsp;apt-get&nbsp;install&nbsp;cubrid<br /> cp&nbsp;-R&nbsp;/home/user/database_backup/*&nbsp;/var/opt/cubrid/databases/</div>
<p>Make sure to adapt "home/user" to your user. You can remove the backup folder database_backup after you start&nbsp;CUBRID&nbsp;and check if the databases are running correctly.</p>
<p><b>Important! </b>Make sure that /var/opt/cubrid/databases/databases.txt file contains the right paths to the database folders.&nbsp;</p>
<p>If you want to perform a completely safe upgrade indepent of the&nbsp;CUBRID&nbsp;version, instead of copying the databases folder like in the above approach, you should use <b>cubrid unloaddb</b>&nbsp;to export all databases in a backup folder, then uninstall&nbsp;CUBRID, update repository and install the new&nbsp;CUBRID&nbsp;version. Finally, you must import the databases into the new&nbsp;CUBRID&nbsp;instance by running&nbsp;<b>cubrid loaddb</b><span style="font-family: mceinline;">.</span></p>]]></description>
                        <pubDate>Fri, 08 Mar 2013 05:10:05 -0800</pubDate>
                        <category>launchpad</category>
                        <category>ubuntu</category>
                        <category>loaddb</category>
                        <category>unloaddb</category>
                                </item>
        										        <item>
            <title>CUBRID Installation Instructions</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-installation-instructions</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-installation-instructions</guid>
                                    <description><![CDATA[<p>There are several ways to install CUBRID Database Server. Based on your OS choose the right installation instructions.</p>
<ul>
<li>[Installing CUBRID on Windows]&nbsp;- Presentation</li>
<li>[Installing CUBRID on Ubuntu]</li>
<li>[Installing CUBRID on Fedora/CentOS]</li>
<li>[Installing CUBRID on Linux using Shell and RPM] - Presentation</li>
<li>[Install CUBRID, PHP Driver, XE CMS on Fedora/CentOS]</li>
<li><a href="/run_cubrid_manager_on_mac" target="_self">Run CUBRID Manager on Mac OS X</a></li>
<li>[Create a CUBRID Database VM with Vagrant and Chef Cookbook under 5 minutes]</li>
<li>[Configure CUBRID HA with Vagrant and Chef Cookbook under 4 minutes]</li>
<li>[Configure CUBRID SHARD with Vagrant and Chef Cookbook under 2 minutes]</li>
<li>[Install CUBRID remotely with knife-solo and Chef Cookbook]</li>
<li>[Getting Started with CUBRID Database AMI (Amazon Machine Image)]</li>
<li><a href="/?mid=downloads&amp;item=virtual_machines&amp;vm_tool=any&amp;vm_os=any&amp;cubrid=any">Download VMware/VirtualBox images with CUBRID installed</a></li>
</ul>]]></description>
                        <pubDate>Tue, 24 Jan 2012 21:27:25 -0800</pubDate>
                        <category>CUBRID</category>
                        <category>installation instructions</category>
                        <category>tutorials</category>
                                </item>
        										        <item>
            <title>Full index of CUBRID Database using Solr DataImportHandler</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=full-index-of-cubrid-database-using-solr-dataimporthandler</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=full-index-of-cubrid-database-using-solr-dataimporthandler</guid>
                                    <description><![CDATA[<p>This tutorial will illustrate an example where a sample data is <span style="font-style: italic;">batch indexed</span> from a CUBRID database and POST'ed into Solr using DataImportHandler. Often it is called a <span style="font-style: italic;">pull approach</span>.</p>
<p>At this point we assume that you have already completed [Using Solr / Lucene for full text search with CUBRID Database on Ubuntu|previous steps] and have the [Create a sample CUBRID Database from the command line|sample data] in your database.</p>
<p>In this tutorial we will create a simple <span style="font-style: italic;">single core</span> server which will be located in <span style="font-weight: bold;">/home/solr/apache-solr-4.0.0/example/cubrid-solr-example</span> directory.</p>
<blockquote class="q4">
<p>If you do not want to copy/paste all of the following codes, you can download <a href="/?module=file&amp;act=procFileDownload&amp;file_srl=606889&amp;sid=631244e94c27e421a926397237d1afef">cubrid-solr-example.zip</a> and extract it under <span style="font-weight: bold;">example/</span> directory. The contents of this archive include all files from this tutorial. <b>Make sure that the lib folder contains the JDBC driver corresponding to your CUBRID server.</b></p>
</blockquote>
<p>First, we need to login to <span style="font-weight: bold;">solr</span> user we have created before and navigate to the <span style="font-style: italic;">example/</span> directory.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">
<p>su - solr<br />cd apache-solr-4.0.0/example/</p>
</div>
<p>Now let's create the home directory structure for our example.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="true" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">mkdir cubrid-solr-example<br />cd cubrid-solr-example<br />mkdir conf lib</div>
<p>This will create the following directory structure.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">/home/solr/apache-solr-4.0.0/example/<br />-----cubrid-solr-example/<br />----------conf/<br />----------lib/</div>
<p>Considering that your are in the home <span style="font-style: italic;">cubrid-solr-example</span> directory, create the main configuration file for solr.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="true" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">touch solr.xml</div>
<p>Save the following into this file. This will instruct Solr to create a single core server.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Xml" editor_component="code_highlighter">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;<br /><br />&lt;solr persistent="false"&gt;<br /><br />&nbsp; &lt;cores adminPath="/admin/cores" defaultCoreName="cubrid-example-core"&gt;<br />&nbsp;&nbsp;&nbsp; &lt;core name="cubrid-example-core" instanceDir="." /&gt;<br />&nbsp; &lt;/cores&gt;<br />&nbsp; <br />&lt;/solr&gt;</div>
<p>Now create a schema file which reflects the database schema of our [Create a sample CUBRID Database from the command line|sample database].</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">cd conf/<br />touch schema.xml</div>
<p>Save the following contents into this file. The following instructs Solr to create a schema for a users table which has 3 columns (id, email, join_date).</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Xml" editor_component="code_highlighter">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;<br /><br />&lt;schema name="tbl_users" version="1.0"&gt;<br /><br />&nbsp;&lt;types&gt;<br />&nbsp;&nbsp;&nbsp; &lt;fieldType name="tint" class="solr.TrieIntField" precisionStep="8" omitNorms="true" positionIncrementGap="0"/&gt;<br />&nbsp;&nbsp;&nbsp; &lt;fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/&gt;<br />&nbsp;&lt;/types&gt;<br /><br />&nbsp;&lt;fields&gt;<br />&nbsp;&nbsp; &lt;field name="id" type="tint" indexed="true" stored="true" multiValued="false" required="true" /&gt; <br />&nbsp;&nbsp; &lt;field name="email" type="string" indexed="true" stored="true" multiValued="false" required="true" /&gt;<br />&nbsp;&nbsp; &lt;field name="join_date" type="tint" indexed="true" stored="true" multiValued="false" required="true" /&gt;<br />&nbsp;&lt;/fields&gt;<br /><br />&nbsp;&lt;uniqueKey&gt;id&lt;/uniqueKey&gt;<br />&nbsp;&lt;defaultSearchField&gt;email&lt;/defaultSearchField&gt;<br /><br />&nbsp;&lt;solrQueryParser defaultOperator="OR"/&gt;<br /><br />&lt;/schema&gt;</div>
<p>Now create a configuration file for this <span style="font-style: italic;">cubrid-example-core</span> in the same directory.</p>
<p>&nbsp;</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">touch&nbsp;solrconfig.xml</div>
<p>&nbsp;</p>
<p>Add the following to this file. Most of the configurations you see below are default settings. But we will stop on <span style="font-weight: bold;">DataImportHandler</span> and explain it a little bit more.</p>
<p><a href="http://wiki.apache.org/solr/DataImportHandler" target="_self">DataImportHandler</a> is used to perform batch indexing of an SQL database table. But it is not a native Solr library, therefore it is not loaded by default. We need to instruct Solr to load it by <span style="font-style: italic;">&lt;lib ...&gt;</span> tag. This handler comes with Solr package by default and is located in the <span style="font-weight: bold;">dist/</span> directory in the root of the package. Therefore the path should be relative to the home directory of your example (in our case <span style="font-style: italic;">cubrid-solr-example/</span>) and <span style="font-weight: bold;">not</span> relative to this solrconfig.xml file.</p>
<p>Further below we create a separate requestHandler for our DataImportHandler which will respond when you navigate to <a href="http://localhost:8983/dataimport" target="_self">http://localhost:8983/dataimport</a> URL. We tell Solr that the configurations for DataImportHandler are located in the <span style="font-style: italic;">/home/solr/apache-solr-4.0.0/example/cubrid-solr-example/conf/data-config.xml</span> file.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Xml" editor_component="code_highlighter">&lt;?xml&nbsp;version="1.0"&nbsp;encoding="UTF-8"&nbsp;?&gt;<br /> <br /> &lt;config&gt;<br /> <br /> &nbsp;&nbsp;&lt;abortOnConfigurationError&gt;${solr.abortOnConfigurationError:true}&lt;/abortOnConfigurationError&gt;<br /> <br /> &nbsp;&nbsp;&lt;luceneMatchVersion&gt;LUCENE_40&lt;/luceneMatchVersion&gt;<br /> <br /> &nbsp;&nbsp;&lt;lib&nbsp;dir="../../dist/"&nbsp;regex="apache-solr-dataimporthandler-&#92;d.*&#92;.jar"&nbsp;/&gt;<br /> <br /> &nbsp;&nbsp;&lt;directoryFactory&nbsp;name="DirectoryFactory"&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class="${solr.directoryFactory:solr.StandardDirectoryFactory}"/&gt;<br /> <br /> &nbsp;&nbsp;&lt;updateHandler&nbsp;class="solr.DirectUpdateHandler2"&nbsp;/&gt;<br /> <br /> &nbsp;&nbsp;&lt;requestDispatcher&nbsp;handleSelect="true"&nbsp;&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&lt;requestParsers&nbsp;enableRemoteStreaming="false"&nbsp;/&gt;<br /> &nbsp;&nbsp;&lt;/requestDispatcher&gt;<br /> <br /> &nbsp;&nbsp;&lt;requestHandler&nbsp;name="standard"&nbsp;class="solr.StandardRequestHandler"&nbsp;default="true"&nbsp;/&gt;<br /> <br /> &nbsp;&nbsp;&lt;requestHandler&nbsp;name="/update"&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class="solr.JsonUpdateRequestHandler"&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;startup="lazy"&nbsp;/&gt;<br /> <br /> &nbsp;&nbsp;&lt;requestHandler&nbsp;name="/admin/"&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class="solr.admin.AdminHandlers"&nbsp;/&gt;<br /> <br /> &nbsp;&nbsp;&lt;requestHandler&nbsp;name="/admin/ping"&nbsp;class="solr.PingRequestHandler"&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&lt;lst&nbsp;name="invariants"&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;str&nbsp;name="qt"&gt;search&lt;/str&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;str&nbsp;name="q"&gt;solrpingquery&lt;/str&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&lt;/lst&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&lt;lst&nbsp;name="defaults"&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;str&nbsp;name="echoParams"&gt;all&lt;/str&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&lt;/lst&gt;<br /> &nbsp;&nbsp;&lt;/requestHandler&gt;<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;&lt;requestHandler&nbsp;name="/dataimport"&nbsp;class="org.apache.solr.handler.dataimport.DataImportHandler"&gt;<br /> &lt;lst&nbsp;name="defaults"&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;str&nbsp;name="config"&gt;data-config.xml&lt;/str&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&lt;/lst&gt;<br /> &nbsp;&nbsp;&lt;/requestHandler&gt;<br /> <br /> &nbsp;&nbsp;&lt;admin&gt;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&lt;defaultQuery&gt;solr&lt;/defaultQuery&gt;<br /> &nbsp;&nbsp;&lt;/admin&gt;<br /> <br /> &lt;/config&gt;</div>
<p>For DataImportHandler to connect and query a database, it requires a  JDBC driver of that database server. CUBRID provides a native <a href="/wiki_apis/entry/cubrid-jdbc-driver" target="_self">JDBC Driver</a>. If you have already installed CUBRID in your system, you can find the JDBC driver in <span style="font-weight: bold;">/jdbc</span> directory. In case of Ubuntu <span style="font-style: italic;">apt-get</span> installation, it is located in <span style="font-weight: bold;">/opt/cubrid/jdbc</span>.</p>
<blockquote class="q4">
<p>If you have not installed CUBRID in your system and plan to connect to a remote CUBRID server, you can download the JDBC driver from the <a href="/?mid=downloads&amp;item=jdbc_driver" target="_self">CUBRID downloads</a> page.</p>
<p><span style="font-weight: bold;">Important:</span> you need to download the right JDBC driver, i.e. if the version of your remote CUBRID server is 8.4.1, then download JDBC driver for 8.4.1.</p>
</blockquote>
<p>Place CUBRID JDBC driver into <span style="font-weight: bold;">/lib</span> directory of <span style="font-style: italic;">cubrid-solr-example</span>. Solr will automatically load any library located in this directory.</p>
<p>Now we need to create this <span style="font-style: italic;">data-config.xml</span> file for DataImportHandler which tells the exact authentication  information, the exact SELECT query to execute to retrieve the data from  the database, etc.</p>
<p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">touch&nbsp;data-config.xml</div>
</p>
<p>In this file we tell DataImportHandler that:</p>
<ul>
<li>it should use CUBRID's JDBC driver;</li>
<li>in the connection URL we indicate that CUBRID server is installed in the <span style="font-style: italic;">localhost</span>, the broker port is <span style="font-style: italic;">33000</span> (default), and the database name is <span style="font-style: italic;">sample_db</span>;</li>
<li>the user name is <span style="font-style: italic;">dba</span>;</li>
<li>no password is needed.</li>
</ul>
<p>Also we indicate:</p>
<ul>
<li> the exact query which should be execute to obtain the data from our database.</li>
<li>name of fields we created before for our Solr server and the corresponding column names of the database table.</li>
</ul>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Xml" editor_component="code_highlighter">&lt;dataConfig&gt;<br />&nbsp;&nbsp;&nbsp; &lt;dataSource type="JdbcDataSource" driver="cubrid.jdbc.driver.CUBRIDDriver" url="jdbc:cubrid:localhost:33000:sample_db" user="dba" password=""/&gt;<br />&nbsp;&nbsp;&nbsp; &lt;document name="users"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;entity name="user" query="select * from tbl_users"&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;field column="ID" name="id" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;field column="EMAIL" name="email" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;field column="JOIN_DATE" name="join_date" /&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/entity&gt;<br />&nbsp;&nbsp;&nbsp; &lt;/document&gt;<br />&lt;/dataConfig&gt;</div>
<p>Finally, you should have the following file structure.</p>
<p>&nbsp;</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="true" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">/home/solr/apache-solr-4.0.0/example/<br /> -----cubrid-solr-example/<br /> ----------conf/<br /> ---------------schema.xml<br /> ---------------solrconfig.xml<br /> ---------------data-config.xml<br /> ----------lib/<br /> ---------------cubrid_jdbc.jar<br /> ----------solr.xml</div>
<p>&nbsp;</p>
<p>To confirm if all the configurations are correct, we can now start our Solr instance.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">cd /home/solr/apache-solr-4.0.0/example<br />java -Dsolr.solr.home="./cubrid-solr-example/" -jar start.jar</div>
<p>This should start Solr on port 8983. Navigate to <a href="http://localhost:8983/solr/dataimport" target="_self">http://localhost:8983/solr/dataimport</a>. You should see an XML output which indicates that the configurations are correct. Otherwise, your Solr instance would not start in which case write to our <a href="/forum" target="_self">CUBRID Forum</a>. We will be glad to help you out.</p>
<p>To import your data from <span style="font-style: italic;">sample_db</span>, first, make sure your database is running.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="true" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">cubrid server start sample_db</div>
<p>Then navigate to <a href="http://localhost:8983/solr/dataimport?command=full-import" target="_self">http://localhost:8983/solr/dataimport?command=full-import</a> to perform full import. If you see an XML output, Solr may have successfully imported all your data from CUBRID database. To confirm this, you can search for data in Solr admin panel at <a href="http://localhost:8983/solr/admin/" target="_self">http://localhost:8983/solr/admin/</a>. In the <span style="font-weight: bold;">Query String</span> field enter a string which exists in your database. Solr should display the related data if such entry exists.</p>
<p>At this point you have learnt how to perform batch index of CUBRID database using DataImportHandler. For more examples, see [Using Solr / Lucene for full text search with CUBRID Database on Ubuntu].</p>]]></description>
                        <pubDate>Tue, 21 Feb 2012 22:49:03 -0800</pubDate>
                        <category>Solr</category>
                        <category>full text search</category>
                        <category>DataImportHandler</category>
                        <category>import</category>
                                </item>
        										        <item>
            <title>Create a CUBRID Database VM with Vagrant and Chef Cookbook under 5 minutes</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=create-a-cubrid-database-vm-with-vagrant-and-chef-cookbook-under-5-minutes</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=create-a-cubrid-database-vm-with-vagrant-and-chef-cookbook-under-5-minutes</guid>
                                    <description><![CDATA[<p>In this tutorial I will show how to create an Ubuntu/CentOS VirtualBox image with CUBRID Database under 5 minutes. In fact, you can use this solution to create multiple&nbsp;development environments (<i>multiple VMs</i>)&nbsp;with different versions of CUBRID installed on each of them, and all these under 5 minutes. It is as easy as:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;up</div>
<p>Also I will show how to install PHP/PDO, Perl and Python drivers along the way. You will also see how to get CUBRID Web Manager working. Remember that all these is completed automatically without your intervention. If you want to see how to do the same and get CUBRID HA and SHARD configured, refer to:</p>
<ul>
<li>[Configure CUBRID HA with Vagrant and Chef Cookbook under 4 minutes]</li>
<li>[Configure CUBRID SHARD with Vagrant and Chef Cookbook under 2 minutes]</li>
</ul>
<h2>Requirements</h2>
<p>Before I explain how and why the above works, I would like to first introduce the tools that you will need for this tutorial:</p>
<ol>
<li><a href="https://www.virtualbox.org/" target="_self">VirtualBox</a>&nbsp;- it is a powerful open source virtualization software similar to VMware Workstation.</li>
<li><a href="http://www.vagrantup.com/" target="_self">Vagrant</a>&nbsp;- this is the key ingredient, the tool which will provide us with a base "<a href="http://docs.vagrantup.com/v1/docs/getting-started/boxes.html" target="_self">box</a>" (<i>a clean Linux OS with a minimal set of software installed</i>) on top of which we will <i>provision</i>, i.e. install different versions of CUBRID Database, Apache Web Server, PHP, and necessary CUBRID drivers.</li>
</ol>
<p>Install both of these tools in your OS (<i>Linux, Windows, Mac OS X</i>). This is all you will need to get started.</p>
<h2>Vagrantfile</h2>
<p><a href="http://docs.vagrantup.com/v1/docs/vagrantfile.html" target="_self">Vagrantfile</a> is a configuration file used by Vagrant. It includes the instructions for <a href="http://docs.vagrantup.com/v1/docs/provisioners/chef_solo.html" target="_self">Chef Solo</a>&nbsp;(<i>an open source systems integration framework</i>)&nbsp;to install the necessary software on top of a <i>base</i> Vagrant box.</p>
<p>I have created this file as well as the whole directory structure for you. You can download <a href="http://sourceforge.net/projects/cubrid/files/CUBRID-AppsTools/CUBRID_Vagrant_VM/cubrid-vagrant-1.8.0.tar.gz/download">cubrid-vagrant-1.8.0.tar.gz</a>&nbsp;(234K)&nbsp;archive to have it (<i>or check the latest version from <a href="http://sourceforge.net/projects/cubrid/files/CUBRID-AppsTools/CUBRID_Vagrant_VM/" target="_self">Sf.net repo</a></i>). It will provide you with a project directory structure to get started.&nbsp;When you extract it, you will see the following directory structure.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;tar&nbsp;-zxf&nbsp;cubrid-vagrant.tar.gz<br /> &nbsp;$&nbsp;ls&nbsp;cubrid-vagrant<br /> &nbsp;cookbooks/<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;apache2/<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;apt/<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;build-essential/<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cubrid<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;perl<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;php<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;python<br /> &nbsp;Vagrantfile</div>
<p>This project already includes seven cookbooks including the one for CUBRID&nbsp;(<i><a href="https://github.com/kadishmal/cubrid-cookbook" target="_self">Github repo</a></i>).&nbsp;You do not have to know how cookbooks work. They are for Chef Solo to know how to install CUBRID and other related software.</p>
<p>If you look into&nbsp;<i>Vagrantfile</i>, you will see the following configurations.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">#&nbsp;-*-&nbsp;mode:&nbsp;ruby&nbsp;-*-<br /> &nbsp;&nbsp;#&nbsp;vi:&nbsp;set&nbsp;ft=ruby&nbsp;:<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;Vagrant::Config.run&nbsp;do&nbsp;|config|<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;All&nbsp;Vagrant&nbsp;configuration&nbsp;is&nbsp;done&nbsp;here.&nbsp;The&nbsp;most&nbsp;common&nbsp;configuration<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;options&nbsp;are&nbsp;documented&nbsp;and&nbsp;commented&nbsp;below.&nbsp;For&nbsp;a&nbsp;complete&nbsp;reference,<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;please&nbsp;see&nbsp;the&nbsp;online&nbsp;documentation&nbsp;at&nbsp;vagrantup.com.<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Every&nbsp;Vagrant&nbsp;virtual&nbsp;environment&nbsp;requires&nbsp;a&nbsp;box&nbsp;to&nbsp;build&nbsp;off&nbsp;of.<br /> &nbsp;&nbsp;&nbsp;&nbsp;config.vm.box&nbsp;=&nbsp;"precise64"&nbsp;#&nbsp;Ubuntu&nbsp;12.04&nbsp;x64<br /> &nbsp;&nbsp;&nbsp;&nbsp;#config.vm.box&nbsp;=&nbsp;"centos63"&nbsp;#&nbsp;CentOS&nbsp;6.3&nbsp;x64<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Assign&nbsp;this&nbsp;VM&nbsp;to&nbsp;a&nbsp;host-only&nbsp;network&nbsp;IP,&nbsp;allowing&nbsp;you&nbsp;to&nbsp;access&nbsp;it<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;via&nbsp;the&nbsp;IP.&nbsp;Host-only&nbsp;networks&nbsp;can&nbsp;talk&nbsp;to&nbsp;the&nbsp;host&nbsp;machine&nbsp;as&nbsp;well&nbsp;as<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;any&nbsp;other&nbsp;machines&nbsp;on&nbsp;the&nbsp;same&nbsp;network,&nbsp;but&nbsp;cannot&nbsp;be&nbsp;accessed&nbsp;(through&nbsp;this<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;network&nbsp;interface)&nbsp;by&nbsp;any&nbsp;external&nbsp;networks.<br /> &nbsp;&nbsp;&nbsp;&nbsp;config.vm.network&nbsp;:hostonly,&nbsp;"10.11.12.13"<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Enable&nbsp;provisioning&nbsp;with&nbsp;chef&nbsp;solo,&nbsp;specifying&nbsp;a&nbsp;cookbooks&nbsp;path,&nbsp;roles<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;path,&nbsp;and&nbsp;data_bags&nbsp;path&nbsp;(all&nbsp;relative&nbsp;to&nbsp;this&nbsp;Vagrantfile),&nbsp;and&nbsp;adding<br /> &nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;some&nbsp;recipes&nbsp;and/or&nbsp;roles.<br /> &nbsp;&nbsp;&nbsp;&nbsp;#<br /> &nbsp;&nbsp;&nbsp;&nbsp;config.vm.provision&nbsp;:chef_solo&nbsp;do&nbsp;|chef|<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;This&nbsp;path&nbsp;will&nbsp;be&nbsp;expanded&nbsp;relative&nbsp;to&nbsp;the&nbsp;project&nbsp;directory<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.cookbooks_path&nbsp;=&nbsp;"cookbooks"<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;specify&nbsp;which&nbsp;version&nbsp;of&nbsp;CUBRID&nbsp;we&nbsp;would&nbsp;like&nbsp;to&nbsp;install<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.json&nbsp;=&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"cubrid"&nbsp;=&gt;&nbsp;{<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #"version"&nbsp;=&gt;&nbsp;"8.4.3",<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#"new_dbs"&nbsp;=&gt;&nbsp;["newtestdb"],<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#"ha_dbs"&nbsp;=&gt;&nbsp;["ha_test_db"],<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#"ha_hosts"&nbsp;=&gt;&nbsp;{"node1"&nbsp;=&gt;&nbsp;"10.11.12.13",&nbsp;"node2"&nbsp;=&gt;&nbsp;"10.11.12.14"}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;"apt"&nbsp;is&nbsp;necessary&nbsp;to&nbsp;perform&nbsp;"apt-get&nbsp;update"&nbsp;command&nbsp;on&nbsp;Ubuntu&nbsp;OS.<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Comment&nbsp;it&nbsp;out&nbsp;if&nbsp;using&nbsp;CentOS.<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"apt"<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;"apache"&nbsp;Web&nbsp;server&nbsp;to&nbsp;run&nbsp;PHP&nbsp;apps<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"apache2"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"apache2::mod_php5"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"apache2::mod_rewrite"<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;install&nbsp;PHP<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"php"<br /> &nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;install&nbsp;CUBRID&nbsp;Database<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid::demodb"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#chef.add_recipe&nbsp;"cubrid::ha"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#chef.add_recipe&nbsp;"cubrid::new_dbs"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid::pdo_cubrid"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid::perl_driver"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid::php_driver"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid::python_driver"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#chef.add_recipe&nbsp;"cubrid::shard"<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid::web_manager"<br /> &nbsp;&nbsp;&nbsp;&nbsp;end<br /> &nbsp;&nbsp;end</div>
<p>All lines which&nbsp;precede&nbsp;with a hash (<code>#</code>) symbol are comments.</p>
<p>Our <i>Vagrantfile</i> says to Chef Solo to:</p>
<ol>
<li>Use <b>apt</b>&nbsp;cookbook to update the Ubuntu OS, which is used as our <i>base</i>&nbsp;box. Comment that line out if creating a CentOS VM.</li>
<li>Use <b>apache2</b> cookbook to install Apache Web Server and its <i>mod_php5</i> and <i>mod_rewrite</i>&nbsp;modules.</li>
<li>Use <b>php</b>&nbsp;cookbook to install PHP 5.3.3.</li>
<li>Use <b>cubrid</b>&nbsp;cookbook to install CUBRID version 9.0.0, its <a href="/wiki_tutorials/entry/getting-started-with-demodb-cubrid-demo-database" target="_self">demodb</a> database, PDO/PHP, Perl and Python drivers, automatically create multiple database, and auto configure CUBRID HA on multi VM environment. Instead of default CUBRID 9.0.0 Database, you can also install other versions like 8.4.3 or 8.4.1. To learn more, refer to&nbsp;<a href="https://github.com/kadishmal/cubrid-cookbook" target="_self">cubrid-cookbook</a>&nbsp;Github repo.</li>
</ol>
<p>If you do not want to install a particular package, simply comment it out.</p>
<p>If necessary, you can extend the above <i>Vagrantfile</i>&nbsp;by adding other cookbooks and their recipes. You can find cookbooks for most software at&nbsp;<a href="https://github.com/opscode-cookbooks" target="_self">https://github.com/opscode-cookbooks</a>. Simply download the necessary cookbook, and place it under <i>cookbooks/</i>&nbsp;directory. Then refer to it by adding one of its recipes to a <i>Vagrantfile</i>. You can also search for cookbooks at the official community site at&nbsp;<a href="http://community.opscode.com/cookbooks" target="_self">http://community.opscode.com/cookbooks</a>.</p>
<h2>Vagrant Box</h2>
<p>Since we are ready to launch our VM and have Vagrant provision it, let's make our last stroke - indicate which OS to use. Vagrant community provides several base boxes:</p>
<ul>
<li><a href="http://files.vagrantup.com/lucid32.box" target="_self">http://files.vagrantup.com/lucid32.box</a>&nbsp;(261MB) - Ubuntu Server 10.04 (Lucid) x86 LTS</li>
<li><a href="http://files.vagrantup.com/lucid64.box" target="_self">http://files.vagrantup.com/lucid64.box</a>&nbsp;(280MB)&nbsp;- Ubuntu Server 10.04 (Lucid) x64 LTS</li>
<li><a href="http://files.vagrantup.com/precise32.box" target="_self">http://files.vagrantup.com/precise32.box</a>&nbsp;(299MB) -&nbsp;&nbsp;Ubuntu Server 12.04 (Precise) x86 LTS</li>
<li><a href="http://files.vagrantup.com/precise64.box" target="_self">http://files.vagrantup.com/precise64.box</a>&nbsp;(323MB) -&nbsp;&nbsp;Ubuntu Server 12.04 (Precise) x64 LTS</li>
</ul>
<p>There are dozens more community-made boxes at&nbsp;<a href="http://www.vagrantbox.es/" target="_self">http://www.vagrantbox.es/</a>. You can download other Linux distributions from there. For example, here is a CentOS box from the community.</p>
<ul>
<li><a href="https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box" target="_self">https://dl.dropbox.com/u/7225008/Vagrant/CentOS-6.3-x86_64-minimal.box</a>&nbsp;(310MB) - CentOS 6.3 x64 minimal</li>
</ul>
<p>In order to indicate which box to use, you need to run the following command specifying the URL where to download the box. In this tutorial we will use Ubuntu Server 12.04 x64 and name it <b>precise64</b>. This is&nbsp;an arbitrary name that we chose to distinguish this box from other boxes which we may potentially install later. This name is used in our&nbsp;<i>Vagrantfile</i>&nbsp;as a value for&nbsp;<code>config.vm.box</code> configuration parameter.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant&nbsp;box&nbsp;add&nbsp;precise64&nbsp;http://files.vagrantup.com/precise64.box</div>
<p>You can add multiple boxes. They will be stored by Vagrant at <i>~/.vagrant/boxes</i> directory for your later use.</p>
<h2>Start Up Vagrant</h2>
<p>Now, let's start Vagrant:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;cd&nbsp;cubrid-vagrant<br /> $&nbsp;vagrant&nbsp;up<br /> [default]&nbsp;VM&nbsp;already&nbsp;created.&nbsp;Booting&nbsp;if&nbsp;it's&nbsp;not&nbsp;already&nbsp;running...<br /> [default]&nbsp;Clearing&nbsp;any&nbsp;previously&nbsp;set&nbsp;forwarded&nbsp;ports...<br /> [default]&nbsp;Forwarding&nbsp;ports...<br /> [default]&nbsp;--&nbsp;22&nbsp;=&gt;&nbsp;2222&nbsp;(adapter&nbsp;1)<br /> [default]&nbsp;Creating&nbsp;shared&nbsp;folders&nbsp;metadata...<br /> [default]&nbsp;Clearing&nbsp;any&nbsp;previously&nbsp;set&nbsp;network&nbsp;interfaces...<br /> [default]&nbsp;Preparing&nbsp;network&nbsp;interfaces&nbsp;based&nbsp;on&nbsp;configuration...<br /> [default]&nbsp;Booting&nbsp;VM...<br /> [default]&nbsp;Waiting&nbsp;for&nbsp;VM&nbsp;to&nbsp;boot.&nbsp;This&nbsp;can&nbsp;take&nbsp;a&nbsp;few&nbsp;minutes.<br /> [default]&nbsp;VM&nbsp;booted&nbsp;and&nbsp;ready&nbsp;for&nbsp;use!<br /> [default]&nbsp;Configuring&nbsp;and&nbsp;enabling&nbsp;network&nbsp;interfaces...<br /> [default]&nbsp;Mounting&nbsp;shared&nbsp;folders...<br /> [default]&nbsp;--&nbsp;v-root:&nbsp;/vagrant<br /> [default]&nbsp;--&nbsp;v-csc-1:&nbsp;/tmp/vagrant-chef-1/chef-solo-1/cookbooks<br /> [default]&nbsp;Running&nbsp;provisioner:&nbsp;Vagrant::Provisioners::ChefSolo...<br /> [default]&nbsp;Generating&nbsp;chef&nbsp;JSON&nbsp;and&nbsp;uploading...<br /> [default]&nbsp;Running&nbsp;chef-solo...<br /> ....</div>
<p>This will continue for a while. On my computer it takes <b>less than five minutes</b> to provision everything from the ground up.</p>
<h3>Host IP</h3>
<p>As you can notice from <i>Vagrantfile</i>, we have set <b>10.11.12.13</b> as the IP address of our VM.&nbsp;You can use this IP to connect to CUBRID from <a href="/wiki_tools/entry/cubrid-query-browser" target="_self">CUBRID Query Browser</a> or <a href="/wiki_tools/entry/cubrid-manager" target="_self">CUBRID Manager</a> administration tools.</p>
<p>To test if Apache was successfully installed, navigate to&nbsp;<b><a href="http://10.11.12.13:8080/" target="_self">http://10.11.12.13</a></b>&nbsp;in your browser. You should see Apache's default "<b>It works!</b>" message.</p>
<h3>Connecting to a demodb database</h3>
<p><b>Recipe:&nbsp;</b><a href="https://github.com/kadishmal/cubrid-cookbook#cubrid-demodb-database" target="_self">demodb</a></p>
<p>Since, in <i>Vagrantfile</i>&nbsp;we have asked Chef Solo to install the <a href="/wiki_tutorials/entry/getting-started-with-demodb-cubrid-demo-database" target="_self">demodb</a> database,&nbsp;you may want to test your first database connection with it. The default database username is <b>dba</b>&nbsp;with an empty (<code>''</code>) password.</p>
<h3>Testing PHP and PDO drivers</h3>
<p><b>Recipe: </b><a href="https://github.com/kadishmal/cubrid-cookbook#cubrid-pdo-driver" target="_self">pdo_cubrid</a><br /><b>Recipe:</b>&nbsp;<a href="https://github.com/kadishmal/cubrid-cookbook#cubrid-php-driver" target="_self">php_driver</a></p>
<p>Run the following command to see if CUBRID PHP and PDO driver have been successfully installed.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;pecl&nbsp;list<br /> Installed&nbsp;packages,&nbsp;channel&nbsp;pecl.php.net:<br /> =========================================<br /> Package&nbsp;&nbsp;&nbsp;&nbsp;Version&nbsp;&nbsp;&nbsp;&nbsp;State<br /> CUBRID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9.0.0.0001&nbsp;stable<br /> PDO_CUBRID&nbsp;9.0.0.0001&nbsp;stable</div>
<p>&nbsp;</p>
<h3>Testing the Python driver</h3>
<p><b>Recipe:&nbsp;</b><a href="https://github.com/kadishmal/cubrid-cookbook#cubrid-python-driver">python_driver</a></p>
<p>Run the following command inside your VM to see if CUBRID Python driver has been successfully installed.</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false">$&nbsp;pip&nbsp;freeze<br />CUBRID-Python==9.0.0.0001</div>
<p>&nbsp;</p>
<h3>Testing the Perl driver</h3>
<p><b>Recipe:&nbsp;</b><a href="https://github.com/kadishmal/cubrid-cookbook#cubrid-perl-driver">perl_driver</a></p>
<p>Run the following command inside your VM to see if CUBRID Perl driver has been successfully installed.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;cpan&nbsp;-l<br /> DBD::cubrid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9.0.0.0001&nbsp;9.000000001&nbsp;&nbsp;CUBRID/DBD-cubrid-9.0.0.0001.tar.gz</div>
<h3>Testing CUBRID Web Manager</h3>
<p><b>Recipe:</b> <a href="https://github.com/kadishmal/cubrid-cookbook#cubrid-web-manager" target="_self">web_manager</a></p>
<p>If you added <b>web_manager</b>&nbsp;recipe, you can access CUBRID Web Manager at <a href="https://10.11.12.13:8282" target="_self">https://10.11.12.13:8282</a>. Notice <b>HTTPS</b>&nbsp;and <b>8282</b>&nbsp;port.&nbsp;The default username and password to connect to CUBRID Manager Server are <b>admin</b>/<b>admin</b>. Once you login for the first time, CWM will prompt you to change the password. Visit <a href="/wiki_tools/entry/cubrid-web-manager" target="_self">CWM Wiki</a> for more information and tutorials.</p>
<h3>Establish SSH connection</h3>
<p>You can connect to this VirtualBox VM using a shortcut command like:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;ssh</div>
<p>That's all! It will login under&nbsp;<b>vagrant</b>&nbsp;user automatically. You will have full access to the underlying OS, and can perform&nbsp;<b>sudo</b>&nbsp;operations with no password.</p>
<h3>Stop VM</h3>
<p>To gracefully power off the VM, run the following command:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;halt</div>
<h3>Start VM</h3>
<p>To start the VM, run the same command we ran to bring up this VM.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;up</div>
<h3>Change Vagrantfile configurations</h3>
<p>When you had enough time to play with this VM, you may now want to extend it by installing additional software, or changing the host IP, forwarding host ports to guest ports, or doing&nbsp;<a href="http://docs.vagrantup.com/v1/docs/vagrantfile.html" target="_self">lots of other things</a>. Once you have made changes, you need to reload your VM.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;reload</div>
<p>This will simply reload your VM with the new configurations, new software, etc. If some of the software is already installed during the previous boot, Vagrant will not skip them. So, this process is relatively quick than building VM from scratch.</p>
<h3>Delete VM</h3>
<p>When you are done playing with this VM, you may finally decide to delete it. You can do this by running the following command:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;destroy</div>
<p>Next time you hit <code>vagrant up</code>&nbsp;command, it will rebuild the VM from ground up.</p>
<h2>Conclusion</h2>
<p>Now you're ready to develop your applications based on CUBRID Database. At any time, you can clone this project, including the Vagrantfile and cookbooks directory, and start up a fresh VM with different versions of CUBRID.</p>
<p>We have create two more related tutorials where you can learn how to create multiple VMs automatically with CUBRID installed on each of them and configure CUBRID HA and CUBRID SHARD. Refer to these tutorials.</p>
<ul>
<li>[Configure CUBRID HA with Vagrant and Chef Cookbook under 4 minutes]</li>
<li>[Configure CUBRID SHARD with Vagrant and Chef Cookbook under 2 minutes]</li>
</ul>
<p>If you have questions, feel free to ask at <a href="/questions" target="_self">CUBRID Q&amp;A</a> site, <a href="/forum" target="_self">forum</a>, our <a href="http://www.facebook.com/cubrid" target="_self">Facebook</a> page, or <a href="http://twitter.com/cubrid" target="_self">Twitter</a>.</p>
<p>If you have issues or feature requests to&nbsp;<b>cubrid-cookbook</b>, <a href="https://github.com/kadishmal/cubrid-cookbook/issues/new" target="_self">create a new issue</a> at its Github repo.</p>]]></description>
                        <pubDate>Wed, 02 Jan 2013 00:16:27 -0800</pubDate>
                        <category>installation instructions</category>
                        <category>VM</category>
                        <category>Vagrant</category>
                        <category>Chef</category>
                        <category>cookbook</category>
                                </item>
        										        <item>
            <title>Install CUBRID remotely with knife-solo and Chef Cookbook</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=install-cubrid-remotely-with-knife-solo-and-chef-cookbook</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=install-cubrid-remotely-with-knife-solo-and-chef-cookbook</guid>
                                    <description><![CDATA[<p>This tutorial is a part of <a href="https://github.com/kadishmal/cubrid-cookbook">CUBRID Chef Cookbook</a>&nbsp;series where I show how to install CUBRID Database, its drivers and tools, and configure High-Availability and Database Sharding with a single command.</p>
<p>Unlike in previuos tutorials, in this tutorial I will not use <a href="/wiki_tutorials/entry/create-a-cubrid-database-vm-with-vagrant-and-chef-cookbook-under-5-minutes">Vagrant</a>. Instead, I will show how to install CUBRID on a remote Linux server using <a href="https://github.com/matschaffer/knife-solo">knife-solo</a>, another great command line tool which allows to <em>cook</em>&nbsp;(i.e. install) cookbooks on remote machines. It's really easy, you will see!</p>
<h2>Requirements</h2>
<ol>
<li>A remote Linux server which you can SSH. It can be a local virtual machine.</li>
<li><a href="https://github.com/matschaffer/knife-solo">knife-solo</a> installed via gem or source code on your working machine.</li>
</ol>
<h2>Getting Started</h2>
<p>I will assume that you have already created a remote Linux server which you can connect to via SSH. Therefore I will directly show how to install knife-solo on your local development machine.</p>
<h3>Install knife-solo prerequisites</h3>
<p><strong>knife-solo</strong> is available in RubyGems repository, therefore it can be installed via gem. But in this tutorial we will install <strong>knife-solo</strong> from its source code because the knife-solo gem on RubyGems is old. Actually it's just because the latest code in Github has not been released yet.</p>
<p>To build and install knife-solo from the source code, we need <strong>gem</strong> and <strong>bundler</strong>&nbsp;programs. If they&nbsp;are already installed on your working machine, you can proceed to the next step. If they are not, you can install them as shown below.</p>
<h4>Debian based Linux</h4>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">sudo&nbsp;apt-get&nbsp;install&nbsp;rubygems&nbsp;libxslt-dev&nbsp;libxml2-dev&nbsp;unzip git<br /> sudo&nbsp;gem&nbsp;install&nbsp;bundler&nbsp;rdoc-data<br /> sudo&nbsp;rdoc-data&nbsp;--install</div>
<p>This will install <strong>gem</strong> program, XML libraries which&nbsp;<strong>bundler</strong> program depends on,&nbsp;<strong>unzip</strong>&nbsp;necessary to extract knife-solo source code from ZIP archive, <strong>git</strong>&nbsp;necessary to download cookbooks,&nbsp;<strong>bundler</strong>&nbsp;and <strong>rdoc-data</strong>&nbsp;gems.</p>
<h4>RPM based Linux</h4>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">sudo&nbsp;yum&nbsp;install&nbsp;rubygems&nbsp;ruby-devel&nbsp;libxslt-devel&nbsp;libxml2-devel&nbsp;unzip&nbsp;git&nbsp;wget<br /> &nbsp;sudo&nbsp;gem&nbsp;install&nbsp;bundler&nbsp;rdoc-data<br /> &nbsp;sudo&nbsp;rdoc-data&nbsp;--install</div>
<h3>Build knife-solo</h3>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">wget&nbsp;https://github.com/matschaffer/knife-solo/archive/master.zip<br /> unzip&nbsp;master*<br /> cd&nbsp;knife-solo-master<br /> sudo&nbsp;bundle<br /> sudo&nbsp;bundle&nbsp;exec&nbsp;rake&nbsp;install</div>
<p>This will download the source ZIP from <a href="https://github.com/matschaffer/knife-solo">knife-solo Github repo</a>, etract it, build the source, and install the generated <strong>knife-solo</strong> gem.</p>
<h3>Check knife-solo</h3>
<p>Type the following command to check if knife-solo has been successfully installed. You should see something like:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">~$&nbsp;gem&nbsp;list&nbsp;|&nbsp;grep&nbsp;knife<br /> knife-solo&nbsp;(0.2.0.pre2)</div>
<h3>Prepare the working directory structure</h3>
<p>Once knife-solo is ready, we go and create a directory structure where we will be working.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">cd<br /> mkdir&nbsp;cubrid-knife<br /> cd&nbsp;cubrid-knife<br /> knife&nbsp;solo&nbsp;init&nbsp;.</div>
<p>This will create a <strong>cubrid-knife</strong>&nbsp;directory in your user home directory where knife-solo will initialize the working directory. The directory structure that knife-solo will create looks as follows:</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">/cookbooks<br /> /data_bags<br /> /nodes<br /> /roles<br /> /site-cookbooks<br /> solo.rb</div>
<h3>Prepare the remote server</h3>
<p>Once we have initialized the working directory on our local working machine, we need to <strong>prepare</strong> our remote server. For this run <code>knife solo prepare</code> command by specifying your remote server username and IP. In this case, my remote server username is <strong>user</strong>, and remote server IP is <strong>192.168.85.138</strong>. By default SSH port number which knife-solo will use to connect to your remote server is <strong>22</strong>. If it is different from the default value, you can specify it with additional <code>-p</code> option.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">~$&nbsp;knife&nbsp;solo&nbsp;prepare&nbsp;user@192.168.85.138<br /> WARNING:&nbsp;No&nbsp;knife&nbsp;configuration&nbsp;file&nbsp;found<br /> Bootstrapping&nbsp;Chef...<br /> Enter&nbsp;the&nbsp;password&nbsp;for&nbsp;user@192.168.85.138:&nbsp;<br /> --2013-02-11&nbsp;23:02:58--&nbsp;&nbsp;https://www.opscode.com/chef/install.sh<br /> Resolving&nbsp;www.opscode.com&nbsp;(www.opscode.com)...&nbsp;184.106.28.83<br /> Connecting&nbsp;to&nbsp;www.opscode.com&nbsp;(www.opscode.com)|184.106.28.83|:443...&nbsp;connected.<br /> HTTP&nbsp;request&nbsp;sent,&nbsp;awaiting&nbsp;response...&nbsp;200&nbsp;OK<br /> Length:&nbsp;6471&nbsp;(6.3K)&nbsp;[application/x-sh]<br /> Saving&nbsp;to:&nbsp;`install.sh'<br /> <br /> 100%[======================================&gt;]&nbsp;6,471&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;--.-K/s&nbsp;&nbsp;&nbsp;in&nbsp;0s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> <br /> 2013-02-11&nbsp;23:02:59&nbsp;(956&nbsp;MB/s)&nbsp;-&nbsp;`install.sh'&nbsp;saved&nbsp;[6471/6471]<br /> <br /> <br /> Downloading&nbsp;Chef&nbsp;&nbsp;for&nbsp;ubuntu...<br /> Installing&nbsp;Chef&nbsp;<br /> Selecting&nbsp;previously&nbsp;unselected&nbsp;package&nbsp;chef.<br /> (Reading&nbsp;database&nbsp;...&nbsp;24087&nbsp;files&nbsp;and&nbsp;directories&nbsp;currently&nbsp;installed.)<br /> Unpacking&nbsp;chef&nbsp;(from&nbsp;.../tmp.Afy1f2L1/chef__amd64.deb)&nbsp;...<br /> Setting&nbsp;up&nbsp;chef&nbsp;(11.2.0-1.ubuntu.11.04)&nbsp;...<br /> Thank&nbsp;you&nbsp;for&nbsp;installing&nbsp;Chef!<br /> Generating&nbsp;node&nbsp;config&nbsp;'nodes/192.168.85.138.json'...</div>
<p>This will:</p>
<ol>
<li>prepare the remote Linux server by installing a <a href="http://wiki.opscode.com/display/chef/Installing+Omnibus+Chef+Client+on+Linux+and+Mac">Chef Client</a>;</li>
<li>generate a <strong>nodes/192.168.85.138.json</strong>&nbsp;configuration file for this particular remote server with an empty <strong>runlist</strong> which means no cookbook will be installed until we populate the <strong>runlist</strong> manually.<br />
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">{"run_list":[]}&nbsp;</div>
</li>
</ol>
<h3>Download necessary cookbooks</h3>
<p>Now we can go and download all cookbooks we want to install on our remote Linux server. In this tutorial we will install the latest version of CUBRID Database Server, PHP, Python, and Perl drivers.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">cd&nbsp;~/cubrid-knife<br /> git&nbsp;init<br /> git&nbsp;submodule&nbsp;add&nbsp;https://github.com/kadishmal/cubrid-cookbook.git&nbsp;cookbooks/cubrid<br /> git&nbsp;submodule&nbsp;add&nbsp;https://github.com/opscode-cookbooks/build-essential.git&nbsp;cookbooks/build-essential<br /> git&nbsp;submodule&nbsp;add&nbsp;https://github.com/opscode-cookbooks/mysql.git&nbsp;cookbooks/mysql<br /> git&nbsp;submodule&nbsp;add&nbsp;https://github.com/opscode-cookbooks/openssl.git&nbsp;cookbooks/openssl<br /> git&nbsp;submodule&nbsp;add&nbsp;https://github.com/opscode-cookbooks/perl.git&nbsp;cookbooks/perl<br /> git&nbsp;submodule&nbsp;add&nbsp;https://github.com/opscode-cookbooks/php.git&nbsp;cookbooks/php<br /> git&nbsp;submodule&nbsp;add&nbsp;https://github.com/opscode-cookbooks/python.git&nbsp;cookbooks/python<br /> git&nbsp;submodule&nbsp;add&nbsp;https://github.com/opscode-cookbooks/yum.git&nbsp;cookbooks/yum<br /> git&nbsp;submodule&nbsp;add&nbsp;https://github.com/opscode-cookbooks/xml.git&nbsp;cookbooks/xml</div>
<p>This will clone each cookbook under <strong>cookbooks/</strong>&nbsp;directory.</p>
<h3>Choose which cookbook to install</h3>
<p>Once we have downloaded the cookbook, we need to tell knife-solo that we want to cook a particular cookbook. For this we need to add the&nbsp;cookbook name to the <strong>runlist</strong>. Edit the&nbsp;<strong>nodes/192.168.85.138.json</strong>&nbsp;file as shown below.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">{"run_list":[<br /> &nbsp;&nbsp;"cubrid",<br /> &nbsp;&nbsp;"cubrid::demodb",<br /> &nbsp;&nbsp;"cubrid::pdo_cubrid",<br /> &nbsp;&nbsp;"cubrid::perl_driver",<br /> &nbsp;&nbsp;"cubrid::php_driver",<br /> &nbsp;&nbsp;"cubrid::python_driver",<br /> &nbsp;&nbsp;"cubrid::web_manager"<br /> ]}</div>
<p>This will tell knife-solo, which will tell to Chef installed on the remote server, to install CUBRID Database, its <a href="/wiki_tutorials/entry/getting-started-with-demodb-cubrid-demo-database">demodb</a> database, PHP/PDO, Perl, and Python drivers, as well as CUBRID Web Manager, all from <strong>cubrid</strong> cookbook that we have downloaded.</p>
<h3>Cook the remote server</h3>
<p>Now as we are ready to cook our remote Linux server, let's do it.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">~$&nbsp;knife&nbsp;solo&nbsp;cook&nbsp;user@192.168.85.138<br /> Checking&nbsp;Chef&nbsp;version...<br /> Enter&nbsp;the&nbsp;password&nbsp;for&nbsp;user@192.168.85.138:&nbsp;<br /> user@192.168.85.138's&nbsp;password:&nbsp;<br /> user@192.168.85.138's&nbsp;password:&nbsp;<br /> user@192.168.85.138's&nbsp;password:&nbsp;<br /> <br /> Starting&nbsp;Chef&nbsp;Client,&nbsp;version&nbsp;11.2.0<br /> Compiling&nbsp;Cookbooks...<br /> Converging&nbsp;58 resources<br /> ...<br /> Chef&nbsp;Client&nbsp;finished,&nbsp;48 resources&nbsp;updated</div>
<p>Bingo! You have installed CUBRID and all the necessary drivers and even a Web Manager on your remote server.</p>
<h3>Testing CUBRID Web Manager</h3>
<p>Let's access CUBRID Web Manager at <a href="https://192.168.85.138:8282">https://192.168.85.138:8282</a>. Notice <strong>HTTPS</strong> and <strong>8282</strong> port. The default username and password to connect to CUBRID Manager Server are <strong>admin</strong>/<strong>admin</strong>. Once you login for the first time, CWM will prompt you to change the password. Visit <a href="/wiki_tools/entry/cubrid-web-manager">CWM Wiki</a> for more information and tutorials.</p>
<h2>Questions?</h2>
<p>If you have questions, feel free to ask at <a href="/wiki_tutorials/entry/questions">CUBRID Q&amp;A</a> site, <a href="/wiki_tutorials/entry/forum">forum</a>, our <a href="http://www.facebook.com/cubrid">Facebook</a> page, <a href="http://twitter.com/cubrid">Twitter</a>, or <a href="http://webchat.freenode.net/?channels=cubrid">online chat</a>.</p>
<p>If you have issues or feature requests to <strong>cubrid-cookbook</strong>, <a href="https://github.com/kadishmal/cubrid-cookbook/issues/new">create a new issue</a> at its Github repo.</p>]]></description>
                        <pubDate>Tue, 12 Feb 2013 00:17:38 -0800</pubDate>
                        <category>installation instructions</category>
                        <category>cookbook</category>
                        <category>knife-solo</category>
                        <category>VM</category>
                        <category>Chef</category>
                                </item>
        										        <item>
            <title>Change database user password</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=change-database-user-password</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=change-database-user-password</guid>
                                    <description><![CDATA[<p>To change your database user password, execute the following SQL.</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="true" collapse="false" first_line="1" code_type="Sql" editor_component="code_highlighter">ALTER USER user_name PASSWORD 'any_password_here_in_single_quotes';</div>
<p>You may execute it using <a target="_self" href="/?mid=wiki_tutorials&amp;act=TS&amp;category=wiki&amp;is_keyword=CSQL">CSQL</a> command line SQL Interpreter or <a target="_self" href="/wiki_tools/entry/cubrid-manager">CUBRID Manager</a>.</p>
<h3>CSQL Example</h3>
<p>Before changing the password, make sure your database has been [Start or Autostart CUBRID Database|started].</p>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Sql" editor_component="code_highlighter">~$ csql -u dba demodb<br />csql&gt; ALTER USER dba PASSWORD 'my_new_pass';<br />Current transaction has been committed.<br />1 command(s) successfully processed.<br />csql&gt;</div>
<blockquote class="q4">
<p><b><span style="color: #ff0000;">Remember</span></b>&nbsp;that in order to change a user password you need to be logged in as an admin user (or a user who has a permission to change a user password). In our case, <b>dba</b>&nbsp;is an admin user. Otherwise, you will get an error saying "<i>UDPATE authorization failure</i>".</p>
</blockquote>
<p>Alternatively, you can <a target="_self" href="/questions/235456#answer-236467">set the database user password at the database creation time</a>.</p>
<div style="display: none;" id="endic_ext_wrapper"></div>
<div style="display: none;" id="endic_ext_wrapper"></div>]]></description>
                        <pubDate>Tue, 29 May 2012 21:10:35 -0800</pubDate>
                        <category>CSQL</category>
                        <category>user management</category>
                        <category>permissions</category>
                                </item>
        										        <item>
            <title>[Solved] Chef: NameError: Cannot find a resource for converge_by on centos</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=solved-chef-nameerror-cannot-find-a-resource-for-converge_by-on-centos</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=solved-chef-nameerror-cannot-find-a-resource-for-converge_by-on-centos</guid>
                                    <description><![CDATA[<p>I was testing <a href="https://github.com/kadishmal/cubrid-cookbook">CUBRID Chef Cookbook</a>&nbsp;on CentOS 6.3 today using <a href="/wiki_tutorials/entry/create-a-cubrid-database-vm-with-vagrant-and-chef-cookbook-under-5-minutes">Vagrant</a> tool when I encountered the following error with Chef 10.12.0:</p>
<p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">FATAL:&nbsp;NameError:&nbsp;python_pip[virtualenv]&nbsp;(python::virtualenv&nbsp;line&nbsp;23)&nbsp;had&nbsp;an&nbsp;error:&nbsp;NameError:&nbsp;Cannot&nbsp;find&nbsp;a&nbsp;resource&nbsp;for&nbsp;converge_by&nbsp;on&nbsp;centos&nbsp;version&nbsp;6.3</div>
</p>
<h2>Solution</h2>
<p>The solution to this problem occured to be trivial:&nbsp;<strong>converge_by</strong>&nbsp;resource has been introduced quite recently in a newer version of Chef. Therefore a simple update to Chef solved this problem.</p>
<p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="false" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">sudo&nbsp;gem&nbsp;update&nbsp;chef&nbsp;ohai&nbsp;--no-ri&nbsp;--no-rdoc</div>
</p>
<p>And the error is gone!</p>]]></description>
                        <pubDate>Tue, 05 Feb 2013 23:57:05 -0800</pubDate>
                        <category>Chef</category>
                        <category>Vagrant</category>
                        <category>cookbook</category>
                        <category>CentOS</category>
                                </item>
        										        <item>
            <title>Error Messages and Troubleshooting</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=error-messages-and-troubleshooting</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=error-messages-and-troubleshooting</guid>
                                    <description><![CDATA[<table cellpadding="0" bordercolor="#545454" cellspacing="0" border="2" style="width: 720px; table-layout: fixed; word-wrap: break-word;">
<thead>
<tr>
<th>No</th><th>error message</th><th>state</th><th>component</th><th>version</th><th>cause(extract posting)</th><th>solution</th>
</tr>
</thead>
<tbody>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">ERROR [CA001] [CUBRID][CUBRID ODBC Driver]Transaction(index1, dba@localhost|20383) has been unilaterally aborted by the system.<br /></span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">During Inserting records</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Occurs when DB server is forcely terminated.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">There are various reasons which terminated server or causes disconnection. (EX: deadlock) <br />Please check the logs if a problem occurs at the moment. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">2</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">-2003 Cannot communicate with broker </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;"> When CUBRID Manager's JDBC version is incompatible with DB server version.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CM</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 R2.2</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">JDBC driver should be same as server version</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">choose aright version of JDBC driver in CUBRID Manager and retry to connect</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">3</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">A network read/write error occurred for socket 5 associated with your transaction (index 2, root@master|17705)</span></td>
<td>
<p style="line-height: 1.2;">Cannot start server after deleting 170,000 rows by DELETE ALL statement.</p>
<a href="http://www.cubrid.com/zbxe/88072">
<p>&nbsp;</p>
</a></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">When DB process is terminated abnormally, the previous logs remains still unclearly. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">On the console, run the following commands. <br />1) csql -S DB_NAME<br /><br />2)  cubrid emergency_patchlog DB_NAME<br /><br />3) cubrid emergency_patchlog -r DB_NAME</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">4</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">serial object delete error</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Cannot DROP SERIAL when deleting a table. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 R3.0</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">A bug was found in CUBRID 8.3.0 or lower versions. SERIAL should be dropped with a table together.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">A bug fixed. <br />As long as you are an owner of objects, SERIALs drops when deleting a table. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">5</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Cannot connect to master server... bad file descriptor </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">On Windows7 32 bits, cannot start DB server.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Among cubrid service, cub_master seems not running</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">On the console, <br />1) cubrid service stop<br />2) cubrid service start<br />See if every process is on. <br />3) cubrid server start<br />See if a process is not running, see the log file (*_master) in  CUBRID/log/ directory and server logs( DB_NAME*) in CUBRID/log/server directory </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">6</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">C:&#92;CUBRID&#92;databases&#92;<db_name>&#92;backup&#92;<db_name>_backup_lv0 is a backup of database <db_name><db_name>created on Mon Apr 11 15:41:49 2011 instead of given database C:&#92;CUBRID&#92;DATABA~1&#92;<db_name>&#92;<db_name> created on Wed Apr 20 16:13:47 2011</db_name></db_name></db_name></db_name></db_name></db_name></span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">After DB backup in the old version, I removed CUBRID in the system. Then I installed CUBRID server and tried restoring. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  R3.1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">The error occurs when restoring a backup file which cannot read in a new version.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Althugh you have only DB backup file without DB and other files, you can restore only when DB server version and file directory is as same as old environment.</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">7</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">ERROR  -673  0  1  Your connection to the server has been closed since the server is going down immediately</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">After creating a DB, I cannot create a table even if I logged-in</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  R3.1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">This error occurs when the DB server is terminated.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">On the console, run a command. <br />cubrid server start</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">8</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">@ cubrid master start ++ cubrid master start: success<br />@ cubrid broker start ++ cubrid broker is running.<br />@ cubrid manager server start bind: Address already in use bind: Address already in use ++ cubrid manager server start: fail</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">I messed up installation. I installed CUBRID new version while curbid service is on runnning. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  R2.2 </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Linux account that you installed a old CUBRID is not same as that of a new version. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">On the console, run a following command. <br />ps -ef | grep cub_<br /><br />Then kill cubridrelated processes.<br /></span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;"> </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;"> </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;"> </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">10</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Unable to mount disk volume "directory/file(lgar)"... . No such file or directory</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;"> lgar files are not deleted after cubrid backup -r option. The error occurs when trying backup after moving log files.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">In When DB process is terminated abnormally, the previous logs remains still unclearly. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;"> On the console, <br />1) cubrid service stop<br />2) cubrid service start<br />See if every process is on. <br />3) cubrid server start<br />See if a process is not running, see the log file (*_master) in  CUBRID/log/ directory and server logs( DB_NAME*) in CUBRID/log/server directory </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">11</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">SqlMapClient operation; uncategorized SQLException for SQL []; SQL state [null]; error code [-670]</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;"> When a specific method is executed, an error occurs</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Framework</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">-</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Error code: 670 is "Operation would have caused one or more unique constraint violations"</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">A certain SQL violates UNIQUE constraints. Search SQL causing -670 error under  $CUBRID/log/broker/sql_log/ </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">12</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">-2147467259 : Your transaction (index 23, dba@localhost|28478) has been unilaterally aborted by the system.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  3.0</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Occurs when DB server is forcely terminated.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">There are various reasons which terminated server or causes disconnection. (EX: deadlock)  Avoid deadlock with short transaction and low isolation level.</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">13</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Attempt to execute the query when not all the parameters are binded</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">During SELECT execution, an error occurs.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Occurs when the number of parameters are not matched to your binding values. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">When binding values, it should one to one match to parameters in the SQL.</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">14</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">ERROR -33 5 47 Last out of space notification for volumes with temporary data as the main storage purpose. Total number of pages = 20480, total number of free pages = -25</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">I have found an error in the server log file. The fast query turns slower all of sudden. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">-</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">DB temp volume is out of space.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Temp volume is mostly used to execute JOIN, Sorting.  <br />Run a following command on the console. <br />cubrid addvoldb -p temp DB_NAME </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">15</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Server no longer responding.... Resource temporarily unavailable *** <br /><br />Unable to mount log disk volume/file "/data/cubrid/db_svr2/db_lgat".... <br />No such file or directory<br /><br />Your connection to the server has been closed since the server is going down immediately.<br /><br />CLIENT = svr1:copylogdb(21448), EID = 2 Has been interrupted.<br /><br />CLIENT = svr1:copylogdb(21448), EID = 3 Server communications error: connection status: CONN_CLOSING</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">After upgrading to 8.3.1, cannot connect to DB.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine, HA</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  R3.1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">In the conf, there is &lt;common&gt; section and &lt;db&gt; section. <br />Your server conf file says log_page_buffer paraeter is located in &lt;db&gt; section however it is supposed to be &lt;common&gt; section. <br />Since HA process cannot read &lt;db&gt; section parameters, they couldn't boot up and the master server stays as "to-be-active' state. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Edit cubrid.conf file. <br />Put log_page_buffer parameter to &lt;common&gt; section and then restart server. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">16</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;"> Can't start up the distributor database. ############ Stopped by error... ############<br />Cannot make connection to master server.<br /><br />getting local host by name for host "TEST-S". Host not found.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine, HA</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  3.0</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">The host names belonging to HA nodes shouldbe configured correctly. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">See the /etc/hosts file if host name is correctly registered.</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">17</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">This object is in a zombie state</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Occurs in the ASP application having a logic of loop 1 loop 2 end end </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine, ASP</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 3.1 patch1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Error occurs when the 1st query is closed  automatically when the 2nd query is running in the nested query.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Set AutoCommit=False and <br />create 2 connections to execute a query on each. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">18</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">cubrid.jdbc.driver.CUBRIDException: Attempt to access a closed ResultSet. at cubrid.jdbc.driver.CUBRIDResultSet.checkIsOpen(CUBRIDResultSet.java:1648) at cubrid.jdbc.driver.CUBRIDResultSet.findColumn(CUBRIDResultSet.java:670) at cubrid.jdbc.driver.CUBRIDResultSet.getString(CUBRIDResultSet.java:559) at jeemin.Test1.main(Test1.java:28)</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Occurs in the JDBC application having a loop</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine, Java</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  R2</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Error occurs when the 1st ResultSet is closed in the loop</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">When using a nested query, set connection.setAutoCommit(false)</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">19</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">-899 Stored procedure execute error: java.lang.NullPointerException</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Occurs when executing Java Stored Procedure. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine, Java Store Procedure</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Procedure information should match to class file and function names. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Check if a simple typo exists in your procedure, comparing with class files and function names.</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">20</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Java VM is not running</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Occurs when executing Java Stored Procedure.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine, Java Store Procedure</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">JAVA VM is not running. See if jvm.dll setting. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">See JAVA_HOME and PATH settings if jvm.dll is in PATH. <br />After setting, you should restart cubrid. <br /><br />cubrid service stop<br />cubrid service start</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">21</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Warning: Error: DBMS, 0, Unknown DBMS error </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;"> I can connect to DB via CUBRID Manager, but not my PHP application.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine, PHP</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Error occurs when cannot conenct to a DB. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Start a DB and see if your connection information9broker IP and port) is correct in your PHP. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">22</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Warning -&gt; Current user(0) does not match CUBRID user(501).    Server may have unpredictable behavior. Continuing... Warning -&gt; Current user(0) does not match CUBRID user(501).    Server may have unpredictable behavior. Continuing... Error : Server[pid=2546] already running. Error : Server[pid=2549] already running. ++ cubrid manager server start: fail</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;"> When I start cubrid manager, error occurred. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CM</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 3.0</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">See the Linux account and CUBRID installation account with permission.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Check the user account info of "cub_" processes and set a right user permission. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">23</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">.  Failed to connect to database server, 'UPS', on the followiong host(s): localhost compactdb : Failed to connect to database server, 'UPS', on the following host(s):localhost.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">When run compactdb via CUBRID Manager, it failed.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CM</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  3.1 patch 1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Bug only in CUBRID Manager. You can run command on console.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">If DB is offline, cubrid compactdb -S &lt;DB_NAME&gt;<br /><br />If DB is online,<br />cubrid compactdb  &lt;DB_NAME&gt;</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">24</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Cannot get a connection. Check the status of broker and DB server. </span></td>
<td>
<p style="line-height: 1.2;"><span style="font-family: 나눔고딕; font-size: x-small;">After I upgraded DB server vesion, DB Log-in failed via CUBRID Manager</span></p>
</td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CM</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  R3.1 1002</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">JDBC version used in CUBRID Manager should be same as DB server's version.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Find a&nbsp;right version of JDBC and set it in CM. <br /><a href="http://ftp.cubrid.org/CUBRID_Drivers/JDBC_Driver/">http://ftp.cubrid.org/CUBRID_Drivers/JDBC_Driver/</a></span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">25</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Cannot get a connection. Check the status of broker and DB server. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">I can log-in to DB via local CM however I cannot connect to the DB via a remote CM.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CM</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CM in a remote cannot get thru DB server. See the Firewall in CUBRID DB server host.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Disable or re-set the firewall and check CUBRID and CUBRD Manager&nbsp;using ports are all open. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">26</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/cubrid.so' - libcascci.so.8: cannot open shared object file: No such file or directory in Unknown on line 0</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">I cannot load the PHP module successfully.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">PHP</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">-</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">If you build PHP module, Linux user should be as same as CUBRID Installation user.&nbsp;</span></td>
<td>
<p style="line-height: 1.2;"><span style="font-family: 나눔고딕; font-size: x-small;">See the tutorial how to build PHP module, it is easy to use PECL </span></p>
<p style="line-height: 1.2;"><span style="font-family: 나눔고딕; font-size: x-small;"><a href="/wiki_apis/entry/php_api_build_guide">http://www.cubrid.org/wiki_apis/entry/php_api_build_guide</a>&nbsp;</span></p>
</td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">27</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">NativeException: java.lang.ClassNotFoundException: cubrid/jdbc/driver/CUBRIDDriver </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Class.forName("cubrid.jdbc.driver.CUBRIDDriver") cannot find a driver. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Java</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  R2.2.3002 </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">See&nbsp;if &nbsp;JAVA class path is correctly configured.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">$ CUBRID / jdbc / cubrid_jdbc.jar should be set to CLASSPATH. See the manual.</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">28</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">PHP Warning:  Unknown(): Unable to load dynamic library './cubird.so' - ./cubird.so: cannot open shared object file: No such file or directory in Unknown on line 0</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Doesn't work with CUBRID PHP driver.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">PHP</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">1. See if extension_dir is correctly configured in the php.ini. <br />2. CUBRID php module should link with libcascci.so (CCI driver). Your&nbsp;PHP cannot&nbsp;find CCI in the system</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">1. extension_dir should address "cubrid.so" file. <br />2. cubrid.so refers to libcascci.so. See if cubrid.so links with libcascci.so by "ldd cubrid.so" command</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">29</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">main.c:(.text+0x69): undefined reference to `cci_connect_3_0'</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">When building the source, error occurs.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CCI</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008  R3.1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">The option for CCI driver can be added</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Use the option, -L$CUBRID/lib-lcascci </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">30</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">/usr/bin/ld: cannot find -lcascci</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">When running $ gcc -L$CUBRID/lib-lcascci a.c -o a, cannot find CCI library</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CCI</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 R3.1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Error occurs since the library was not found.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">1)&nbsp; Check $CUBRID/lib directory if libcascci.so exists. <br />2) Check if CUBRID environment variables are correctly configured.</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">31</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Attempt to access a closed ResultSet(PreparedStatement)</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">To keep using a ResultSet in the following queries, error occurs.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Engine</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">ResultSet to fetch has been already closed. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">The prior ResultSet was closed because cutoCommit is true. If you re-use the 1st ResultSet, change the setting to "False" and add Commit/Rollback in the end for each transaction. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">32</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">PHP Startup: Unable to load dynamic library </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">I have already set php.ini, but I cannot execute queries.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">PHP</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 R4.0</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">*.dll file cannot be loaded.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Check your PHP version and OS version. In the directory, only a right version of PHP driver should exist. <br /><a href="http://ftp.cubrid.org/CUBRID_Drivers/PHP_Driver/">http://ftp.cubrid.org/CUBRID_Drivers/PHP_Driver/</a></span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">33</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Backup is already running. Backup cannot be run by two processes.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">When trying DB backup in CURBID Manager, error occurs.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Windows 2008</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 R2.2</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">While DB bakcup is already running, you cannot perform backup at the same time.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">1. Check if other DBA or&nbsp;automated script has already run DB backup. 2. If not, kill a prior backup process. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">34</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Cannot create enough threads for 'max_clients=100'.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">In&nbsp;cubrid.conf, I configured java_stored_procedure=yes to use Java stored procedure. Then, error occurs.&nbsp;</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CentOS</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 R4.0</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">In the 32bit server, it can possibly limit due to lack of memory.&nbsp; </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">1. Change the server to 64bit<br />2.&nbsp;Run a command to limit memory stack size: <br />ulmit -s 5120&nbsp;&nbsp;<br />3. Set max_clients in cubrid.conf to lower value.&nbsp;</span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">35</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">mktemp: invalid option -- p Usage: mktemp [-d] [-q] [-u] template tar: ../CUBRID-product.tar: Cannot open: tar: Error is not recoverable: exiting now</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">During CUBRID DB server installation, error occurs. &nbsp;</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Linux</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 R4.1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">In your system, there is no mktemp library. </span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Check if the library is installed in your system with a command: <br />pm -qa | grep mktemp<br />If not exists, add or upgrade your OS. </span></td>
</tr>
<tr align="CENTER">
<td><span style="font-family: 나눔고딕; font-size: x-small;">36</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">configure: error: /home/cubrid/CUBRID/lib/libcascci.so Please set CUBRID base install dir with --with-cubrid=DIR</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">During CUBRID PHP driver installation, error occurs.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CentOS</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">CUBRID 2008 R4.1</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">OS bit, CUBRID bit, PHP bit mismatches.</span></td>
<td><span style="font-family: 나눔고딕; font-size: x-small;">Chekc if the bit of OS / CUBRID / PHP is all same. <br /><a href="http://ftp.cubrid.org/">http://ftp.cubrid.org/</a></span></td>
</tr>
</tbody>
</table>
<table cellpadding="0" bordercolor="#545454" cellspacing="0" border="2" style="width: 720px; table-layout: fixed; word-wrap: break-word;">
<tbody>
</tbody>
</table>
<p><span style="font-family: 나눔고딕; font-size: x-small;">
<p>&nbsp;</p>
</span></p>]]></description>
                        <pubDate>Thu, 12 Apr 2012 04:45:07 -0800</pubDate>
                        <category>error_message</category>
                        <category>Error codes</category>
                                </item>
        										        <item>
            <title>Configure CUBRID HA with Vagrant and Chef Cookbook under 4 minutes</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=configure-cubrid-ha-with-vagrant-and-chef-cookbook-under-4-minutes</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=configure-cubrid-ha-with-vagrant-and-chef-cookbook-under-4-minutes</guid>
                                    <description><![CDATA[<p>This is a follow up tutorial for [Create a CUBRID Database VM with Vagrant and Chef Cookbook under 5 minutes]. Therefore I will assume you have read the previous tutorial as this one will be a continuation of it.</p>
<p>In this tutorial I will show how to create multiple VMs automatically with CUBRID installed on each of them and have them configured in one HA group. I will tell you that with Vagrant and Chef Cookbook it is as easy as running <code>vagrant up</code> and waiting for 4-5 minutes until everything gets set up.</p>
<h2>Requirements</h2>
<p>Requirements are the same as in the first tutorial. Refer to it for details. In short, you need VirtualBox and Vagrant installed.</p>
<h2>Vagrantfile</h2>
<p>If you have not already downloaded <a href="http://sourceforge.net/projects/cubrid/files/CUBRID-AppsTools/CUBRID_Vagrant_VM/cubrid-vagrant-1.5.1.tar.gz/download" target="_self">cubrid-vagrant-1.5.1.tar.gz</a> (211KB), do it now (<i>or check the latest version from <a href="https://sourceforge.net/projects/cubrid/files/CUBRID-AppsTools/CUBRID_Vagrant_VM/" target="_self">Sf.net repo</a></i>). You will find everything ready for you in that archive. Refer to the [Create a CUBRID Database VM with Vagrant and Chef Cookbook under 5 minutes |previous tutorial] for details on what is included.</p>
<p>Now for this tutorial to configure CUBRID HA on multiple VMs, we will add a few more configuration options to our <i>Vagrantfile</i>&nbsp;which comes by default in that archive.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">#&nbsp;-*-&nbsp;mode:&nbsp;ruby&nbsp;-*-<br /> #&nbsp;vi:&nbsp;set&nbsp;ft=ruby&nbsp;:<br /> <br /> Vagrant::Config.run&nbsp;do&nbsp;|config|<br /> &nbsp;&nbsp;config.vm.box_url&nbsp;=&nbsp;"http://files.vagrantup.com/precise64.box"<br /> &nbsp;&nbsp;config.vm.box&nbsp;=&nbsp;"precise64"&nbsp;#&nbsp;Ubuntu&nbsp;12.04&nbsp;x64<br /> <br /> &nbsp;&nbsp;config.vm.define&nbsp;:node1&nbsp;do&nbsp;|node1_config|<br /> &nbsp;&nbsp;&nbsp;&nbsp;node1_config.vm.host_name&nbsp;=&nbsp;"node1"<br /> &nbsp;&nbsp;&nbsp;&nbsp;node1_config.vm.network&nbsp;:hostonly,&nbsp;"10.11.12.13"<br /> &nbsp;&nbsp;end<br /> <br /> &nbsp;&nbsp;config.vm.define&nbsp;:node2&nbsp;do&nbsp;|node2_config|<br /> &nbsp;&nbsp;&nbsp;&nbsp;node2_config.vm.host_name&nbsp;=&nbsp;"node2"<br /> &nbsp;&nbsp;&nbsp;&nbsp;node2_config.vm.network&nbsp;:hostonly,&nbsp;"10.11.12.14"<br /> &nbsp;&nbsp;end<br /> <br /> &nbsp;&nbsp;config.vm.customize&nbsp;["modifyvm",&nbsp;:id,&nbsp;"--memory",&nbsp;800]<br /> <br /> &nbsp;&nbsp;config.vm.provision&nbsp;:chef_solo&nbsp;do&nbsp;|chef|<br /> &nbsp;&nbsp;&nbsp;&nbsp;chef.cookbooks_path&nbsp;=&nbsp;"cookbooks"<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;chef.json&nbsp;=&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"cubrid"&nbsp;=&gt;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"version"&nbsp;=&gt;&nbsp;"8.4.3",<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ha_dbs"&nbsp;=&gt;&nbsp;["ha_test_db"],<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ha_hosts"&nbsp;=&gt;&nbsp;{"node1"&nbsp;=&gt;&nbsp;"10.11.12.13",&nbsp;"node2"&nbsp;=&gt;&nbsp;"10.11.12.14"}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid"<br /> &nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid::ha"<br /> &nbsp;&nbsp;end<br /> end</div>
<p>I have removed the comments this time so that you can see the real code more prominently.</p>
<h3>Number of VMs</h3>
<p>The first thing to take care in this scenario is to define how many VMs (<i>hosts</i>) we would like to run in this HA environment. No matter how many, each host will run an independent CUBRID Server node. Later all these hosts will join in one <a href="/manual/843/en/Groups%20and%20Nodes" target="_self">HA group</a>&nbsp;and provide auto failover between themselves.</p>
<p>In the above <i>Vagrantfile</i>&nbsp;you can notice the following lines:</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">config.vm.define&nbsp;:node1&nbsp;do&nbsp;|node1_config|<br /> &nbsp;&nbsp;&nbsp;node1_config.vm.host_name&nbsp;=&nbsp;"node1"<br /> &nbsp;&nbsp;&nbsp;node1_config.vm.network&nbsp;:hostonly,&nbsp;"10.11.12.13"<br /> &nbsp;end<br /> <br /> &nbsp;config.vm.define&nbsp;:node2&nbsp;do&nbsp;|node2_config|<br /> &nbsp;&nbsp;&nbsp;node2_config.vm.host_name&nbsp;=&nbsp;"node2"<br /> &nbsp;&nbsp;&nbsp;node2_config.vm.network&nbsp;:hostonly,&nbsp;"10.11.12.14"<br /> &nbsp;end</div>
<p>This means that we want Vagrant to build for us <b>two</b> VMs. The first VM should be distinguished by <b>node1</b>&nbsp;name and should be assigned <b>10.11.12.13</b> IP address. The second VM will have a hostname <b>node2</b>&nbsp;with an IP <b>10.11.12.14</b>. In this example both hostname and IP are arbitrary, i.e. you can set your own, but you should remember to set IP within the same netmask (<i>refer to <a href="http://docs.vagrantup.com/v1/docs/host_only_networking.html" target="_self">Multiple Networks in Vagrant</a> for details</i>).</p>
<p>This is how you define the number of VMs to start up. The first VM which gets configured and started will become <b>"master"</b>&nbsp;in CUBRID HA, while other VM hosts will become <b>"slaves"</b>.</p>
<h3>VM memory size</h3>
<p>In this example we set each VM to have 800MB RAM. This is enough, though you can set lower or higher values.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">config.vm.customize&nbsp;["modifyvm",&nbsp;:id,&nbsp;"--memory",&nbsp;800]</div>
<p>If you need to have different memory on each VM, you can do so by specifying this same property when you <i>define</i> each VM.</p>
<h3>Configure CUBRID HA</h3>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">chef.json&nbsp;=&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;"cubrid"&nbsp;=&gt;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"version"&nbsp;=&gt;&nbsp;"8.4.3",<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ha_dbs"&nbsp;=&gt;&nbsp;["ha_test_db"],<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"ha_hosts"&nbsp;=&gt;&nbsp;{"node1"&nbsp;=&gt;&nbsp;"10.11.12.13",&nbsp;"node2"&nbsp;=&gt;&nbsp;"10.11.12.14"}<br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> }<br /> <br /> chef.add_recipe&nbsp;"cubrid"<br /> chef.add_recipe&nbsp;"cubrid::ha"</div>
<ol>
<li>First of all, you need to add "<b>cubrid::ha</b>" recipe to have CUBRID HA configured.</li>
<li>Second, you need to provide&nbsp;a list of hosts and IPs which should join the same HA group. For this override <code>ha_hosts</code> attribute. These hosts and IPs <b>must</b>&nbsp;be identical to those you have defined for each VM above.</li>
<li>Then, optionally, you can override <code>ha_dbs</code> attribute by providing an array of database names to create and sync in HA. By default it will create one database called <b>testdb</b>.</li>
<li>Also, you can&nbsp;optionally&nbsp;override <code>ha_group</code> attribute which defaults to <b>cubrid</b>. This is the HA group all hosts will join. You can set any arbitrary value.</li>
</ol>
<p>That is all you need to configure CUBRID HA. Now let's go and bring up CUBRID HA.</p>
<h2>Vagrant Box</h2>
<p>I will assume that you have already added <b>precise64</b> (<i>Ubuntu 12.04 LTS x64</i>) Vagrant box. If you haven't, see the [Create a CUBRID Database VM with Vagrant and Chef Cookbook under 5 minutes|previous tutorial].</p>
<h2>Start Up Vagrant</h2>
<p>Run the following command to start Vagrant:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;up</div>
<p>Wait some 4-5 minutes and you will have your VMs up and running in HA environment.</p>
<h2>Test CUBRID HA</h2>
<h3>Validate CUBRID HA</h3>
<p>Let's first validate and see if CUBRID HA has been properly configured.</p>
<h4>Open SSH connection</h4>
<p>For this we will open SSH connection and login to the first <b>node1</b>&nbsp;VM. Remember, the first VM which got started becomes <b>master</b>&nbsp;while the rest become <b>slaves</b>.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;ssh&nbsp;node1<br /> Welcome&nbsp;to&nbsp;Ubuntu&nbsp;12.04&nbsp;LTS&nbsp;(GNU/Linux&nbsp;3.2.0-23-generic&nbsp;x86_64)<br /> <br /> &nbsp;*&nbsp;Documentation:&nbsp;&nbsp;https://help.ubuntu.com/<br /> <br /> 100&nbsp;packages&nbsp;can&nbsp;be&nbsp;updated.<br /> 50&nbsp;updates&nbsp;are&nbsp;security&nbsp;updates.<br /> <br /> Welcome&nbsp;to&nbsp;your&nbsp;Vagrant-built&nbsp;virtual&nbsp;machine.<br /> Last&nbsp;login:&nbsp;Thu&nbsp;Jan&nbsp;&nbsp;3&nbsp;06:46:49&nbsp;2013&nbsp;from&nbsp;10.0.2.2<br /> vagrant@node1:~$</div>
<p>To connect to other nodes, simply change the node name as:</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;ssh&nbsp;node2</div>
<h4>Check CUBRID Service status</h4>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node1:~$&nbsp;cubrid&nbsp;service&nbsp;status<br /> @&nbsp;cubrid&nbsp;master&nbsp;status<br /> ++&nbsp;cubrid&nbsp;master&nbsp;is&nbsp;running.<br /> @&nbsp;cubrid&nbsp;server&nbsp;status<br /> &nbsp;HA-Server&nbsp;ha_test_db&nbsp;(rel&nbsp;8.4,&nbsp;pid&nbsp;1423)<br /> @&nbsp;cubrid&nbsp;broker&nbsp;status<br /> &nbsp;&nbsp;NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PID&nbsp;&nbsp;PORT&nbsp;&nbsp;AS&nbsp;&nbsp;JQ&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;REQ&nbsp;&nbsp;TPS&nbsp;&nbsp;QPS&nbsp;&nbsp;&nbsp;&nbsp;LONG-T&nbsp;&nbsp;&nbsp;&nbsp;LONG-Q&nbsp;&nbsp;ERR-Q<br /> ================================================================================<br /> *&nbsp;query_editor&nbsp;&nbsp;1641&nbsp;30000&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;0/60.0&nbsp;&nbsp;&nbsp;&nbsp;0/60.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br /> *&nbsp;broker1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1651&nbsp;33000&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;0/60.0&nbsp;&nbsp;&nbsp;&nbsp;0/60.0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br /> @&nbsp;cubrid&nbsp;manager&nbsp;server&nbsp;status<br /> ++&nbsp;cubrid&nbsp;manager&nbsp;server&nbsp;is&nbsp;running.<br /> vagrant@node1:~$</div>
<p>We can notice that CUBRID Service is running and our <b>ha_test_db</b>&nbsp;database has been successfully started. You should see the same result if you execute this command on other nodes.</p>
<h4>Check CUBRID Heartbeat status</h4>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node1:~$&nbsp;cubrid&nbsp;heartbeat&nbsp;status<br /> @&nbsp;cubrid&nbsp;heartbeat&nbsp;list<br /> <br /> &nbsp;HA-Node&nbsp;Info&nbsp;(current&nbsp;node1,&nbsp;state&nbsp;master)<br /> &nbsp;&nbsp;&nbsp;Node&nbsp;node2&nbsp;(priority&nbsp;2,&nbsp;state&nbsp;slave)<br /> &nbsp;&nbsp;&nbsp;Node&nbsp;node1&nbsp;(priority&nbsp;1,&nbsp;state&nbsp;master)<br /> <br /> <br /> &nbsp;HA-Process&nbsp;Info&nbsp;(master&nbsp;1224,&nbsp;state&nbsp;master)<br /> &nbsp;&nbsp;&nbsp;Applylogdb&nbsp;ha_test_db@localhost:/opt/cubrid/databases/ha_test_db_node2&nbsp;(pid&nbsp;1559,&nbsp;state&nbsp;registered)<br /> &nbsp;&nbsp;&nbsp;Copylogdb&nbsp;ha_test_db@node2:/opt/cubrid/databases/ha_test_db_node2&nbsp;(pid&nbsp;1557,&nbsp;state&nbsp;registered)<br /> &nbsp;&nbsp;&nbsp;Server&nbsp;ha_test_db&nbsp;(pid&nbsp;1230,&nbsp;state&nbsp;registered_and_active)<br /> <br /> vagrant@node1:~$&nbsp;</div>
<ol>
<li>Notice that our <b>node1</b>&nbsp;states that it is <i>master</i>&nbsp;while <b>node2</b>&nbsp;is <i>slave</i>.</li>
<li>We can also notice that <a href="/manual/843/en/Processes" target="_self">Applylogdb</a> and <a href="/manual/843/en/Processes" target="_self">Copylogdb</a> HA processes have been successfully started.</li>
</ol>
<p>These are two main indicators that CUBRID Heartbeat is running.</p>
<p>If we run the same command on <b>node2</b>, we will see a little bit different picture:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node2:~$&nbsp;cubrid&nbsp;heartbeat&nbsp;status<br /> @&nbsp;cubrid&nbsp;heartbeat&nbsp;list<br /> <br /> &nbsp;HA-Node&nbsp;Info&nbsp;(current&nbsp;node2,&nbsp;state&nbsp;slave)<br /> &nbsp;&nbsp;&nbsp;Node&nbsp;node2&nbsp;(priority&nbsp;2,&nbsp;state&nbsp;slave)<br /> &nbsp;&nbsp;&nbsp;Node&nbsp;node1&nbsp;(priority&nbsp;1,&nbsp;state&nbsp;master)<br /> <br /> <br /> &nbsp;HA-Process&nbsp;Info&nbsp;(master&nbsp;1257,&nbsp;state&nbsp;slave)<br /> &nbsp;&nbsp;&nbsp;Applylogdb&nbsp;ha_test_db@localhost:/opt/cubrid/databases/ha_test_db_node1&nbsp;(pid&nbsp;1592,&nbsp;state&nbsp;registered)<br /> &nbsp;&nbsp;&nbsp;Copylogdb&nbsp;ha_test_db@node1:/opt/cubrid/databases/ha_test_db_node1&nbsp;(pid&nbsp;1590,&nbsp;state&nbsp;registered)<br /> &nbsp;&nbsp;&nbsp;Server&nbsp;ha_test_db&nbsp;(pid&nbsp;1263,&nbsp;state&nbsp;registered)<br /> <br /> vagrant@node2:~$</div>
<h4>Check HA mode</h4>
<p>As a final stroke, let's check the HA mode of each node.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node1:~$&nbsp;cubrid&nbsp;changemode&nbsp;ha_test_db@localhost<br /> The&nbsp;server&nbsp;`ha_test_db@localhost''s&nbsp;current&nbsp;HA&nbsp;running&nbsp;mode&nbsp;is&nbsp;active.</div>
<p>We can see that the <i>master</i><b> node1</b>&nbsp;is in <b>active</b> mode. For other options, refer to <a href="/manual/843/en/Servers" target="_self">Servers in CUBRID HA</a>.</p>
<p>When we run the same command on the slave node, we will see that it is in <b>standby</b>&nbsp;mode:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node2:~$&nbsp;cubrid&nbsp;changemode&nbsp;ha_test_db@localhost<br /> The&nbsp;server&nbsp;`ha_test_db@localhost''s&nbsp;current&nbsp;HA&nbsp;running&nbsp;mode&nbsp;is&nbsp;standby.</div>
<h3>Insert sample data</h3>
<p>To confirm that replication works in CUBRID HA, let's create a sample table and insert some data.</p>
<div editor_component="code_highlighter" code_type="Sql" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">CREATE&nbsp;TABLE&nbsp;ha_table(<br /> &nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;INTEGER&nbsp;AUTO_INCREMENT&nbsp;PRIMARY&nbsp;KEY,<br /> &nbsp;&nbsp;&nbsp;&nbsp;f_name&nbsp;VARCHAR(20)&nbsp;NOT&nbsp;NULL<br /> );<br /> <br /> INSERT&nbsp;INTO&nbsp;ha_table&nbsp;(f_name)&nbsp;VALUES&nbsp;('Zorro'),&nbsp;('Guppy'),&nbsp;('Watchman');</div>
<p>Execute these queries in your favorite tool. You can use CUBRID Manager, CUBRID Query Browser administration tools, or CSQL command line tool. In this example I will use CSQL on our <i>master</i><b>&nbsp;node1</b>:</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node1:~$&nbsp;csql&nbsp;-u&nbsp;dba&nbsp;ha_test_db@localhost<br /> <br /> CUBRID&nbsp;SQL&nbsp;Interpreter<br /> <br /> <br /> Type&nbsp;`;help'&nbsp;for&nbsp;help&nbsp;messages.<br /> <br /> csql&gt;&nbsp;CREATE&nbsp;TABLE&nbsp;ha_table(<br /> csql&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;INTEGER&nbsp;AUTO_INCREMENT&nbsp;PRIMARY&nbsp;KEY,<br /> csql&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;f_name&nbsp;VARCHAR(20)&nbsp;NOT&nbsp;NULL<br /> csql&gt;&nbsp;);<br /> SQL&nbsp;statement&nbsp;execution&nbsp;time:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.002845&nbsp;sec<br /> <br /> Current&nbsp;transaction&nbsp;has&nbsp;been&nbsp;committed.<br /> <br /> 1&nbsp;command(s)&nbsp;successfully&nbsp;processed.<br /> csql&gt;&nbsp;<br /> csql&gt;&nbsp;INSERT&nbsp;INTO&nbsp;ha_table&nbsp;(f_name)&nbsp;VALUES&nbsp;('Zorro'),&nbsp;('Guppy'),&nbsp;('Watchman');<br /> <br /> 3&nbsp;rows&nbsp;affected.<br /> SQL&nbsp;statement&nbsp;execution&nbsp;time:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.001594&nbsp;sec<br /> <br /> Current&nbsp;transaction&nbsp;has&nbsp;been&nbsp;committed.<br /> <br /> 1&nbsp;command(s)&nbsp;successfully&nbsp;processed.<br /> csql&gt;&nbsp;SHOW&nbsp;TABLES;<br /> <br /> ===&nbsp;&lt;Result&nbsp;of&nbsp;SELECT&nbsp;Command&nbsp;in&nbsp;Line&nbsp;1&gt;&nbsp;===<br /> <br /> &nbsp;&nbsp;Tables_in_ha_test_db@localhost<br /> ======================<br /> &nbsp;&nbsp;'ha_table'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> <br /> <br /> 1&nbsp;rows&nbsp;selected.<br /> SQL&nbsp;statement&nbsp;execution&nbsp;time:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.018776&nbsp;sec<br /> <br /> Current&nbsp;transaction&nbsp;has&nbsp;been&nbsp;committed.<br /> <br /> 1&nbsp;command(s)&nbsp;successfully&nbsp;processed.<br /> csql&gt;&nbsp;SELECT&nbsp;*&nbsp;FROM&nbsp;ha_table;<br /> <br /> ===&nbsp;&lt;Result&nbsp;of&nbsp;SELECT&nbsp;Command&nbsp;in&nbsp;Line&nbsp;1&gt;&nbsp;===<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;f_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> ===================================<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;'Zorro'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;'Guppy'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;'Watchman'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> <br /> <br /> 3&nbsp;rows&nbsp;selected.<br /> SQL&nbsp;statement&nbsp;execution&nbsp;time:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.003838&nbsp;sec<br /> <br /> Current&nbsp;transaction&nbsp;has&nbsp;been&nbsp;committed.<br /> <br /> 1&nbsp;command(s)&nbsp;successfully&nbsp;processed.<br /> csql&gt;&nbsp;;ex<br /> vagrant@node1:~$&nbsp;</div>
<p>We can notice that all queries have been successfully executed on <i>master</i><b>&nbsp;node1</b>.</p>
<p>Now, let's see if these statements have been applied to <i>slave</i><b> node2</b>.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node2:~$&nbsp;csql&nbsp;-u&nbsp;dba&nbsp;ha_test_db@localhost<br /> <br /> CUBRID&nbsp;SQL&nbsp;Interpreter<br /> <br /> <br /> Type&nbsp;`;help'&nbsp;for&nbsp;help&nbsp;messages.<br /> <br /> csql&gt;&nbsp;SHOW&nbsp;TABLES;<br /> <br /> ===&nbsp;&lt;Result&nbsp;of&nbsp;SELECT&nbsp;Command&nbsp;in&nbsp;Line&nbsp;1&gt;&nbsp;===<br /> <br /> &nbsp;&nbsp;Tables_in_ha_test_db@localhost<br /> ======================<br /> &nbsp;&nbsp;'ha_table'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> <br /> <br /> 1&nbsp;rows&nbsp;selected.<br /> SQL&nbsp;statement&nbsp;execution&nbsp;time:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.016050&nbsp;sec<br /> <br /> Current&nbsp;transaction&nbsp;has&nbsp;been&nbsp;committed.<br /> <br /> 1&nbsp;command(s)&nbsp;successfully&nbsp;processed.<br /> csql&gt;&nbsp;SELECT&nbsp;*&nbsp;FROM&nbsp;ha_table;<br /> <br /> ===&nbsp;&lt;Result&nbsp;of&nbsp;SELECT&nbsp;Command&nbsp;in&nbsp;Line&nbsp;1&gt;&nbsp;===<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;id&nbsp;&nbsp;f_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> ===================================<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;'Zorro'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2&nbsp;&nbsp;'Guppy'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3&nbsp;&nbsp;'Watchman'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /> <br /> <br /> 3&nbsp;rows&nbsp;selected.<br /> SQL&nbsp;statement&nbsp;execution&nbsp;time:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.004936&nbsp;sec<br /> <br /> Current&nbsp;transaction&nbsp;has&nbsp;been&nbsp;committed.<br /> <br /> 1&nbsp;command(s)&nbsp;successfully&nbsp;processed.<br /> csql&gt;&nbsp;;ex<br /> vagrant@node1:~$&nbsp;</div>
<p>We can see that all statements are successfully replicated on the <b>slave node2</b>.</p>
<h3>Shutdown master node to initiate failover</h3>
<p>Now, let's see if <i>master</i>&nbsp;role&nbsp;will successfully be delegated from <b>node1</b>&nbsp;to <b>node2</b>&nbsp;as a result of a&nbsp;failover.&nbsp;For this to work we will manually power off our <b>node1</b>&nbsp;VM.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;halt&nbsp;node1</div>
<p>Then check again the heartbeat status on <b>node2</b>.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node2:~$&nbsp;cubrid&nbsp;heartbeat&nbsp;status<br /> @&nbsp;cubrid&nbsp;heartbeat&nbsp;list<br /> <br /> &nbsp;HA-Node&nbsp;Info&nbsp;(current&nbsp;node2,&nbsp;state&nbsp;master)<br /> &nbsp;&nbsp;&nbsp;Node&nbsp;node2&nbsp;(priority&nbsp;2,&nbsp;state&nbsp;master)<br /> &nbsp;&nbsp;&nbsp;Node&nbsp;node1&nbsp;(priority&nbsp;1,&nbsp;state&nbsp;unknown)<br /> <br /> <br /> &nbsp;HA-Process&nbsp;Info&nbsp;(master&nbsp;1190,&nbsp;state&nbsp;master)<br /> &nbsp;&nbsp;&nbsp;Applylogdb&nbsp;ha_test_db@localhost:/opt/cubrid/databases/ha_test_db_node1&nbsp;(pid&nbsp;1525,&nbsp;state&nbsp;registered)<br /> &nbsp;&nbsp;&nbsp;Copylogdb&nbsp;ha_test_db@node1:/opt/cubrid/databases/ha_test_db_node1&nbsp;(pid&nbsp;1523,&nbsp;state&nbsp;registered)<br /> &nbsp;&nbsp;&nbsp;Server&nbsp;ha_test_db&nbsp;(pid&nbsp;1196,&nbsp;state&nbsp;registered_and_active)<br /> <br /> vagrant@node2:~$</div>
<p>Bingo! Now <b>node2</b>&nbsp;is <i>master</i>, while the state of <b>node1</b>&nbsp;is <i>unknown</i><b>.</b></p>
<h3>Revive node1 and put it to standby (slave)</h3>
<p>Now let's revive <b>node1</b>&nbsp;which was previously powered off, then check its heartbeat status.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">~$&nbsp;vagrant&nbsp;up&nbsp;node1<br /> ....<br /> ~$&nbsp;vagrant&nbsp;ssh&nbsp;node1<br /> ....<br /> vagrant@node1:~$&nbsp;cubrid&nbsp;heartbeat&nbsp;status<br /> @&nbsp;cubrid&nbsp;heartbeat&nbsp;list<br /> <br /> &nbsp;HA-Node&nbsp;Info&nbsp;(current&nbsp;node1,&nbsp;state&nbsp;slave)<br /> &nbsp;&nbsp;&nbsp;Node&nbsp;node2&nbsp;(priority&nbsp;2,&nbsp;state&nbsp;master)<br /> &nbsp;&nbsp;&nbsp;Node&nbsp;node1&nbsp;(priority&nbsp;1,&nbsp;state&nbsp;slave)<br /> <br /> <br /> &nbsp;HA-Process&nbsp;Info&nbsp;(master&nbsp;1613,&nbsp;state&nbsp;slave)<br /> &nbsp;&nbsp;&nbsp;Applylogdb&nbsp;ha_test_db@localhost:/opt/cubrid/databases/ha_test_db_node2&nbsp;(pid&nbsp;1948,&nbsp;state&nbsp;registered)<br /> &nbsp;&nbsp;&nbsp;Copylogdb&nbsp;ha_test_db@node2:/opt/cubrid/databases/ha_test_db_node2&nbsp;(pid&nbsp;1946,&nbsp;state&nbsp;registered)<br /> &nbsp;&nbsp;&nbsp;Server&nbsp;ha_test_db&nbsp;(pid&nbsp;1619,&nbsp;state&nbsp;registered)<br /> <br /> vagrant@node1:~$</div>
<p>Correct! <b>node1</b>&nbsp;became slave in our HA group.</p>
<h2>Conclusion</h2>
<p>In this tutorial you have learnt how to&nbsp;create multiple VMs automatically with CUBRID installed on each of them and have them configured in one HA group. As you can see, Vagrant along with Chef cookbook allow us to work with CUBRID Database and other software very easily. It is so much convenient and saves so much of our time. Now creating a development environment is no more painful.</p>
<p>Now as you know how to setup CUBRID HA environment, you can proceed to configuring CUBRID SHARD multi VM environment. Refer to:</p>
<ul>
<li>[Configure CUBRID SHARD with Vagrant and Chef Cookbook under 2 minutes]</li>
</ul>
<p>If you have questions, feel free to ask at <a href="/questions" target="_self">CUBRID Q&amp;A</a> site, <a href="/forum" target="_self">forum</a>, our <a href="http://www.facebook.com/cubrid" target="_self">Facebook</a> page, or <a href="http://twitter.com/cubrid" target="_self">Twitter</a>.&nbsp;If you have issues or feature requests to <b>cubrid-cookbook</b>, <a href="https://github.com/kadishmal/cubrid-cookbook/issues/new" target="_self">create a new issue</a> at its Github repo.</p>]]></description>
                        <pubDate>Fri, 04 Jan 2013 00:19:00 -0800</pubDate>
                        <category>installation instructions</category>
                        <category>HA</category>
                        <category>VM</category>
                        <category>Vagrant</category>
                        <category>cookbook</category>
                                </item>
        										        <item>
            <title>Configure CUBRID SHARD with Vagrant and Chef Cookbook under 2 minutes</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=configure-cubrid-shard-with-vagrant-and-chef-cookbook-under-2-minutes</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=configure-cubrid-shard-with-vagrant-and-chef-cookbook-under-2-minutes</guid>
                                    <description><![CDATA[<p>This is the third tutorial in <a href="/?mid=wiki_tutorials&amp;act=TS&amp;category=wiki&amp;is_keyword=Vagrant" target="_self">Vagrant/Chef</a> series where I would like to show how to install CUBRID Database in multi VM environment and automatically configure the database sharding. If you haven't read the previous tutorials, at least read [Create a CUBRID Database VM with Vagrant and Chef Cookbook under 5 minutes] to learn about Vagrant and Chef cookbook we will be using in this tutorial.</p>
<p>In this tutorial you will learn how to create multiple VMs automatically with CUBRID installed on each of them and configured CUBRID SHARD for database sharding. I will tell you that with Vagrant and Chef Cookbook it is as easy as running <code>vagrant up</code> and waiting for less than 2 minutes until everything gets set up.</p>
<p>If you want to learn more about CUBRID SHARD refer to <a href="/blog/cubrid-life/database-sharding-the-right-way-easy-reliable-open-source/" target="_self">Database Sharding the Right Way: Easy, Reliable, and Open source</a>&nbsp;we have presented at HighLoad++ 2012 conference.</p>
<h2>Requirements</h2>
<p>Requirements are the same as in the first tutorial. Refer to it for details. In short, you need <b>VirtualBox</b> and <b>Vagrant</b> installed.</p>
<h2>Vagrantfile</h2>
<p>If you have not already downloaded <a href="http://sourceforge.net/projects/cubrid/files/CUBRID-AppsTools/CUBRID_Vagrant_VM/cubrid-vagrant-1.7.0.tar.gz/download" target="_self">cubrid-vagrant-1.7.0.tar.gz</a> (226KB), do it now (<i>or check the latest version from <a href="https://sourceforge.net/projects/cubrid/files/CUBRID-AppsTools/CUBRID_Vagrant_VM/" target="_self">Sf.net repo</a></i>). You will find everything ready for you in that archive. Refer to the [Create a CUBRID Database VM with Vagrant and Chef Cookbook under 5 minutes |previous tutorial] for details on what is included.</p>
<p>Now for this tutorial to configure CUBRID HA on multiple VMs, we will add a few more configuration options to our <i>Vagrantfile</i>&nbsp;which comes by default in that archive.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">#&nbsp;-*-&nbsp;mode:&nbsp;ruby&nbsp;-*-<br /> #&nbsp;vi:&nbsp;set&nbsp;ft=ruby&nbsp;:<br /> <br /> Vagrant::Config.run&nbsp;do&nbsp;|config|<br /> &nbsp;&nbsp;#config.vm.box_url&nbsp;=&nbsp;"http://files.vagrantup.com/precise64.box"<br /> &nbsp;&nbsp;config.vm.box&nbsp;=&nbsp;"precise64"&nbsp;#&nbsp;Ubuntu&nbsp;12.04&nbsp;x64<br /> <br /> &nbsp;&nbsp;config.vm.define&nbsp;:node1&nbsp;do&nbsp;|node1_config|<br /> &nbsp;&nbsp;&nbsp;&nbsp;node1_config.vm.host_name&nbsp;=&nbsp;"node1"<br /> &nbsp;&nbsp;&nbsp;&nbsp;node1_config.vm.network&nbsp;:hostonly,&nbsp;"10.11.12.13"<br /> &nbsp;&nbsp;end<br /> <br /> &nbsp;&nbsp;config.vm.define&nbsp;:node2&nbsp;do&nbsp;|node2_config|<br /> &nbsp;&nbsp;&nbsp;&nbsp;node2_config.vm.host_name&nbsp;=&nbsp;"node2"<br /> &nbsp;&nbsp;&nbsp;&nbsp;node2_config.vm.network&nbsp;:hostonly,&nbsp;"10.11.12.14"<br /> &nbsp;&nbsp;end<br /> <br /> &nbsp;&nbsp;config.vm.customize&nbsp;[!"modifyvm",&nbsp;:id,&nbsp;"--memory",&nbsp;800]<br /> <br /> &nbsp;&nbsp;config.vm.provision&nbsp;:chef_solo&nbsp;do&nbsp;|chef|<br /> &nbsp;&nbsp;&nbsp;&nbsp;chef.cookbooks_path&nbsp;=&nbsp;"cookbooks"<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;chef.json&nbsp;=&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"cubrid"&nbsp;=&gt;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"version"&nbsp;=&gt;&nbsp;"8.4.3",<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"shard_db"&nbsp;=&gt;&nbsp;"sharddb",<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"shard_hosts"&nbsp;=&gt;&nbsp;[!<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{"node1"&nbsp;=&gt;&nbsp;"10.11.12.13"},<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{"node2"&nbsp;=&gt;&nbsp;"10.11.12.14"}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid"<br /> &nbsp;&nbsp;&nbsp;&nbsp;chef.add_recipe&nbsp;"cubrid::shard"<br /> &nbsp;&nbsp;end<br /> end</div>
<p>I have removed the comments this time so that you can see the real code more prominently. In the <i>Vagrantfile</i>&nbsp;inside the archive you can see all the comments.</p>
<h3>Number of VMs</h3>
<p>The first thing to take care in this scenario, just like when [Configure CUBRID HA with Vagrant and Chef Cookbook under 4 minutes|configuring HA] is to define how many VMs (<i>hosts</i>) we would like to run in this CUBRID SHARD environment. No matter how many, each host will run an independent CUBRID Server node and have a database which will serve as one of the shards of the "single logical" database.</p>
<p>In the above <i>Vagrantfile</i>&nbsp;you can notice the following lines:</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">config.vm.define&nbsp;:node1&nbsp;do&nbsp;|node1_config|<br /> &nbsp;&nbsp;&nbsp;node1_config.vm.host_name&nbsp;=&nbsp;"node1"<br /> &nbsp;&nbsp;&nbsp;node1_config.vm.network&nbsp;:hostonly,&nbsp;"10.11.12.13"<br /> &nbsp;end<br /> <br /> &nbsp;config.vm.define&nbsp;:node2&nbsp;do&nbsp;|node2_config|<br /> &nbsp;&nbsp;&nbsp;node2_config.vm.host_name&nbsp;=&nbsp;"node2"<br /> &nbsp;&nbsp;&nbsp;node2_config.vm.network&nbsp;:hostonly,&nbsp;"10.11.12.14"<br /> &nbsp;end</div>
<p>This means that we want Vagrant to build for us <b>two</b> VMs. The first VM should be distinguished by <b>node1</b>&nbsp;name and should be assigned <b>10.11.12.13</b> IP address. The second VM will have a hostname <b>node2</b>&nbsp;with an IP <b>10.11.12.14</b>. In this example both hostname and IP are arbitrary, i.e. you can set your own, but you should remember to set IP within the same netmask (<i>refer to <a href="http://docs.vagrantup.com/v1/docs/host_only_networking.html" target="_self">Multiple Networks in Vagrant</a> for details</i>).</p>
<p>This is how you define the number of VMs to start up. Unlike with [Configure CUBRID HA with Vagrant and Chef Cookbook under 4 minutes|HA configuration] where the first VM which gets started becomes a&nbsp;<b>"master"</b>&nbsp;node, in CUBRID SHARD the last node to be configured will start the CUBRID SHARD Service and serve as a SHARD Broker. This is the case because in order to start the SHARD Service all shard nodes must be up. Thus, configuring starting the SHARD Service on the last node will ensure us that all previous nodes are up.</p>
<h3>VM memory size</h3>
<p>In this example we set each VM to have 800MB RAM. This is enough, though you can set lower or higher values.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">config.vm.customize&nbsp;[!"modifyvm",&nbsp;:id,&nbsp;"--memory",&nbsp;800]</div>
<p>If you need to have different memory on each VM, you can do so by specifying this same property when you <i>define</i> each VM.</p>
<h3>Configure CUBRID SHARD</h3>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">chef.json&nbsp;=&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;"cubrid"&nbsp;=&gt;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"version"&nbsp;=&gt;&nbsp;"8.4.3",<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"shard_db"&nbsp;=&gt;&nbsp;"sharddb",<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"shard_hosts"&nbsp;=&gt;&nbsp;[!<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{"node1"&nbsp;=&gt;&nbsp;"10.11.12.13"},<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{"node2"&nbsp;=&gt;&nbsp;"10.11.12.14"}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> }<br /> <br /> chef.add_recipe&nbsp;"cubrid"<br /> chef.add_recipe&nbsp;"cubrid::shard"</div>
<ol>
<li>First of all, you need to add "<b>cubrid::shard</b>" recipe to have CUBRID SHARD configured.</li>
<li>Second, you need to provide&nbsp;a database name via&nbsp;<code>shard_db</code>&nbsp;attribute&nbsp;which you want to create and have it shared among all nodes.</li>
<li>Third, you need to provide a list of hosts and IPs where each database shard will be located. For this override <code>shard_hosts</code> attribute. These hosts and IPs <b>must</b>&nbsp;be identical to those you have defined for each VM above.</li>
<li>You can&nbsp;optionally&nbsp;override <code>shard_broker_port</code>&nbsp;attribute which defaults to <b>45011</b>.</li>
<li>Also optionally you can specify&nbsp;<code>shard_user</code>&nbsp;and&nbsp;<code>shard_user_password</code>&nbsp;attributes if you want to create a specific database user for your sharded database. By default, a&nbsp;<b>shard</b>&nbsp;user will be created with <b>shard123</b>&nbsp;password.</li>
</ol>
<p>That is all you need to configure CUBRID SHARD. Now let's go and bring up our CUBRID SHARD.</p>
<h2>Vagrant Box</h2>
<p>I will assume that you have already added <b>precise64</b> (<i>Ubuntu 12.04 LTS x64</i>) Vagrant box. If you haven't, see the [Create a CUBRID Database VM with Vagrant and Chef Cookbook under 5 minutes|first tutorial].</p>
<h2>Start Up Vagrant</h2>
<p>Run the following command to start Vagrant:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;up</div>
<p>Wait about 2 minutes and you will have your VMs up and running in CUBRID SHARD configured.</p>
<h2>Test CUBRID SHARD</h2>
<h3>Validate CUBRID SHARD</h3>
<p>Let's first validate and see if CUBRID SHARD has been properly configured.</p>
<h4>Open SSH connection</h4>
<p>For this we will open SSH connection and login to the last&nbsp;<b>node2</b>&nbsp;VM because on this node the SHARD Broker is configured. Remember that the last VM which gets started will start the CUBRID SHARD Service.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;ssh&nbsp;node2<br /> Welcome&nbsp;to&nbsp;Ubuntu&nbsp;12.04&nbsp;LTS&nbsp;(GNU/Linux&nbsp;3.2.0-23-generic&nbsp;x86_64)<br /> <br /> &nbsp;*&nbsp;Documentation:&nbsp;&nbsp;https://help.ubuntu.com/<br /> <br /> 100&nbsp;packages&nbsp;can&nbsp;be&nbsp;updated.<br /> 50&nbsp;updates&nbsp;are&nbsp;security&nbsp;updates.<br /> <br /> Welcome&nbsp;to&nbsp;your&nbsp;Vagrant-built&nbsp;virtual&nbsp;machine.<br /> Last&nbsp;login:&nbsp;Tue&nbsp;Jan&nbsp;15&nbsp;06:47:07&nbsp;2013&nbsp;from&nbsp;10.0.2.2<br /> vagrant@node2:~$</div>
<p>To connect to other nodes, simply change the node name as:</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;vagrant&nbsp;ssh&nbsp;node1</div>
<h4>Check CUBRID shard status</h4>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">$&nbsp;cubrid&nbsp;shard&nbsp;status&nbsp;-f<br /> @&nbsp;cubrid&nbsp;shard&nbsp;status<br /> %&nbsp;shard&nbsp;&nbsp;-&nbsp;shard_cas&nbsp;[!12366,45011]&nbsp;/opt/cubrid/log/broker//shard.err&nbsp;<br /> &nbsp;JOB&nbsp;QUEUE:0,&nbsp;AUTO_ADD_APPL_SERVER:ON,&nbsp;SQL_LOG_MODE:ALL:100000,&nbsp;SLOW_LOG:ON<br /> &nbsp;LONG_TRANSACTION_TIME:60.00,&nbsp;LONG_QUERY_TIME:60.00,&nbsp;SESSION_TIMEOUT:300<br /> &nbsp;KEEP_CONNECTION:ON,&nbsp;ACCESS_MODE:RW,&nbsp;MAX_QUERY_TIMEOUT:0<br /> ----------------------------------------------------------------------------------------------------------------------------------------------------------<br /> PROXY_ID&nbsp;SHARD_ID&nbsp;&nbsp;&nbsp;CAS_ID&nbsp;&nbsp;&nbsp;PID&nbsp;&nbsp;&nbsp;QPS&nbsp;&nbsp;&nbsp;LQS&nbsp;PSIZE&nbsp;STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LAST&nbsp;ACCESS&nbsp;TIME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DB&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HOST&nbsp;&nbsp;&nbsp;LAST&nbsp;CONNECT&nbsp;TIME&nbsp;&nbsp;&nbsp;&nbsp;SQL_LOG_MODE&nbsp;<br /> ----------------------------------------------------------------------------------------------------------------------------------------------------------<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;12374&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;55088&nbsp;IDLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2013/01/15&nbsp;04:32:21&nbsp;&nbsp;&nbsp;&nbsp;sharddb@node1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node1&nbsp;2013/01/15&nbsp;04:32:21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1&nbsp;12375&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;55088&nbsp;IDLE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2013/01/15&nbsp;04:32:21&nbsp;&nbsp;&nbsp;&nbsp;sharddb@node2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;node2&nbsp;2013/01/15&nbsp;04:32:21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&nbsp;</div>
<p>We can notice that CUBRID SHARD Service is running and our <b>sharddb</b>&nbsp;database has been successfully started on both <b>node1</b>&nbsp;and <b>node2</b>. You can also notice that the SHARD Broker is listening on port <b>45011</b>.</p>
<p>If you execute this command on other nodes, you will <b>not</b>&nbsp;see similar result because they are not configured to serve as a SHARD Broker, though they can be and in that case they can serve as a Broker failover solution.</p>
<h3>Create a common database schema</h3>
<p>If you have already read&nbsp;<a href="/blog/cubrid-life/database-sharding-the-right-way-easy-reliable-open-source/" target="_self">Database Sharding the Right Way: Easy, Reliable, and Open source</a>, you should know that in order to insert and retrieve data from multiple shards, we need to have identical table schema on all shards. Those tables which are present only on some of the shards will not be sharded, in which case they will be just like any other ordinary tables.</p>
<p>So, let's create a common table on all our nodes to store our blog posts.</p>
<div editor_component="code_highlighter" code_type="Sql" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">CREATE&nbsp;TABLE&nbsp;posts&nbsp;(<br /> post_id&nbsp;INT PRIMARY&nbsp;KEY,<br /> post_title&nbsp;VARCHAR(255)&nbsp;NOT&nbsp;NULL<br /> );</div>
<p>Execute this query in your favorite tool. You can use CUBRID Manager, CUBRID Query Browser administration tools, or CSQL command line tool. In this example I will use CSQL on our<b>&nbsp;node1</b>. Remember that you need to execute this query on all nodes to have identical schema.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node1:~$&nbsp;csql&nbsp;-u&nbsp;shard&nbsp;sharddb@localhost<br /> Enter&nbsp;Password&nbsp;:&nbsp;<br /> <br /> CUBRID&nbsp;SQL&nbsp;Interpreter<br /> <br /> <br /> Type&nbsp;`;help'&nbsp;for&nbsp;help&nbsp;messages.<br /> <br /> csql&gt;&nbsp;CREATE&nbsp;TABLE&nbsp;posts&nbsp;(<br /> csql&gt;&nbsp;post_id&nbsp;INT&nbsp;PRIMARY&nbsp;KEY,<br /> csql&gt;&nbsp;post_title&nbsp;VARCHAR(255)&nbsp;NOT&nbsp;NULL<br /> csql&gt;&nbsp;);<br /> SQL&nbsp;statement&nbsp;execution&nbsp;time:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0.008398&nbsp;sec<br /> <br /> Current&nbsp;transaction&nbsp;has&nbsp;been&nbsp;committed.<br /> <br /> 1&nbsp;command(s)&nbsp;successfully&nbsp;processed.<br /> csql&gt;&nbsp;;ex<br /> vagrant@node1:~$</div>
<h3>Update shard_key.txt configuration file</h3>
<p>Since we have create a new table which we want to shard between multiple nodes, we need to specify which of the columns of this table must be used as <code>shard_key</code> to identify the <code>shard_id</code>. For this we need to update the <b>shard_key.txt</b> configuration file in <i>/opt/cubrid/conf/</i> directory on <b>node2</b>&nbsp;where our SHARD Service is started.</p>
<div editor_component="code_highlighter" code_type="Plain" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">#<br /> #&nbsp;Cookbook&nbsp;Name::&nbsp;cubrid<br /> #&nbsp;Templates::&nbsp;shard_keys.txt<br /> #<br /> [!%post_id]<br /> #min	max	shard_id<br /> 0	31	0<br /> 32	63	1<br /> 64	95	0<br /> 96	127	1<br /> 128	159	0<br /> 160	191	1<br /> 192	223	0<br /> 224	255	1</div>
<p>The above will instruct CUBRID to use <code>post_id</code>&nbsp;column as the&nbsp;<code>shard_key</code>&nbsp;for our table. You can define one shard key for each table.</p>
<p>By default CUBRID SHARD will use 256 modulus sharding strategy. You can define you own or even feed CUBRID SHARD with an external library which calculates the sharding id. In the above example, all records where&nbsp;<code>post_id</code>&nbsp;is between 0 and 31 inclusive will be stored in shard 0, in our case it's <b>node1</b>. All records where&nbsp;<code>post_id</code>&nbsp;is between 32 and 63 inclusive will be stored in shard 1, in our case it's&nbsp;<b>node2</b>. This goes on from 0 up to 255 (<i>modulus - 1</i>). These&nbsp;<code>shard_id</code>&nbsp;and&nbsp;<b>host_name</b>&nbsp;mappings are defined in <b>shard_connection.txt</b>&nbsp;configuration file in&nbsp;<i>/opt/cubrid/conf/</i>&nbsp;directory in case you wonder.</p>
<p>Once we have updated the shard_key.txt configuration file, we need to restart our SHARD Service.</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">vagrant@node2:~$&nbsp;cubrid&nbsp;shard&nbsp;restart<br /> @&nbsp;cubrid&nbsp;shard&nbsp;stop<br /> ++&nbsp;cubrid&nbsp;shard&nbsp;stop:&nbsp;success<br /> @&nbsp;cubrid&nbsp;shard&nbsp;start<br /> ++&nbsp;cubrid&nbsp;shard&nbsp;start:&nbsp;success</div>
<h3>Insert sample data</h3>
<p>Now, let's insert data by connecting to our SHARD Broker on port 45011. For this we will write a short Java program which will establish a database connection using CUBRID JDBC driver.</p>
<div editor_component="code_highlighter" code_type="Java" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">import&nbsp;cubrid.jdbc.driver.CUBRIDConnection;<br /> import&nbsp;cubrid.jdbc.driver.CUBRIDPreparedStatement;<br /> import&nbsp;cubrid.jdbc.driver.CUBRIDResultSet;<br /> <br /> import&nbsp;java.sql.*;<br /> <br /> public&nbsp;class&nbsp;SHARDBrokerInsertExample&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;static&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Class.forName("cubrid.jdbc.driver.CUBRIDDriver");<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(ClassNotFoundException&nbsp;e)&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;RuntimeException(e);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;CUBRIDConnection&nbsp;connect()&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connection&nbsp;conn&nbsp;=&nbsp;null;<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;conn&nbsp;=&nbsp;DriverManager.getConnection("jdbc:cubrid:10.11.12.14:45011:sharddb:::?charSet=utf8",&nbsp;"shard",&nbsp;"shard123");<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Connected!");<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(&nbsp;Exception&nbsp;e&nbsp;)&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.err.println("Error:&nbsp;"&nbsp;+&nbsp;e.getMessage());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;(CUBRIDConnection)conn;<br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;void&nbsp;printdata(ResultSet&nbsp;rs)&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResultSetMetaData&nbsp;rsmd&nbsp;=&nbsp;null;<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;rsmd&nbsp;=&nbsp;rs.getMetaData();<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;numberofColumns&nbsp;=&nbsp;rsmd.getColumnCount();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Number&nbsp;of&nbsp;columns:&nbsp;"&nbsp;+&nbsp;numberofColumns);<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(int&nbsp;j&nbsp;=&nbsp;1;&nbsp;j&nbsp;&lt;=&nbsp;numberofColumns;&nbsp;++j&nbsp;)&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.print(rsmd.getColumnName(j)&nbsp;+&nbsp;",&nbsp;");<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("");<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(rs.next&nbsp;())&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for(int&nbsp;j&nbsp;=&nbsp;1;&nbsp;j&nbsp;&lt;=&nbsp;numberofColumns;&nbsp;++j&nbsp;)&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.print(rs.getString(j)&nbsp;+&nbsp;"&nbsp;&nbsp;");<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("");<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(&nbsp;Exception&nbsp;e&nbsp;)&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.err.println("SQLException&nbsp;:&nbsp;"&nbsp;+&nbsp;e.getMessage());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;public&nbsp;static&nbsp;void&nbsp;main(String[!]&nbsp;args)&nbsp;throws&nbsp;Exception&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CUBRIDConnection&nbsp;conn&nbsp;=&nbsp;null;<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;conn&nbsp;=&nbsp;connect();<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;try&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;sql&nbsp;=&nbsp;"INSERT&nbsp;INTO&nbsp;posts&nbsp;VALUES&nbsp;(/*+&nbsp;shard_key&nbsp;*/&nbsp;?,&nbsp;?)";<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CUBRIDPreparedStatement&nbsp;preStmt&nbsp;=&nbsp;(CUBRIDPreparedStatement)conn.prepareStatement(sql);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.setInt(1,&nbsp;1);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.setString(2,&nbsp;"SHARD&nbsp;0:&nbsp;Post&nbsp;1&nbsp;Title");<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.executeInsert();<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.setInt(1,&nbsp;32);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.setString(2,&nbsp;"SHARD&nbsp;1:&nbsp;Post&nbsp;2&nbsp;Title");<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.executeInsert();<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.setInt(1,&nbsp;128);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.setString(2,&nbsp;"SHARD&nbsp;0:&nbsp;Post&nbsp;3&nbsp;Title");<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.executeInsert();<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.setInt(1,&nbsp;224);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.setString(2,&nbsp;"SHARD&nbsp;1:&nbsp;Post&nbsp;4&nbsp;Title");<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;preStmt.executeInsert();<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String&nbsp;selectSql&nbsp;=&nbsp;"SELECT&nbsp;*&nbsp;FROM&nbsp;posts&nbsp;WHERE&nbsp;post_id&nbsp;=&nbsp;/*+&nbsp;shard_key&nbsp;*/&nbsp;128";<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Statement&nbsp;stmt&nbsp;=&nbsp;conn.createStatement();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ResultSet&nbsp;rs&nbsp;=&nbsp;stmt.executeQuery(selectSql);<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printdata(rs);<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stmt.close();<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;conn.close();<br /> <br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.out.println("Connection&nbsp;is&nbsp;closed");<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;catch&nbsp;(&nbsp;Exception&nbsp;e&nbsp;)&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.err.println("SQLException&nbsp;:&nbsp;"&nbsp;+&nbsp;e.getMessage());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;System.err.println(e);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;finally&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(&nbsp;conn&nbsp;!=&nbsp;null&nbsp;)&nbsp;conn.close();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;}<br /> }</div>
<p>There are two important things in this code which relate to database sharding.</p>
<ol>
<li>When inserting a record, give a <b>hint</b>&nbsp;to SHARD Broker which of the columns should be used as&nbsp;<code>shard_key</code>&nbsp;to identify the&nbsp;<code>shard_id</code>. This is done by adding&nbsp;<code>/*+ shard_key */</code>&nbsp;SQL hint to the&nbsp;<code>INSERT</code>&nbsp;query before the value or the placeholder as shown above.</li>
<li>Likewise, when selecting a data, give a&nbsp;<b>hint</b>&nbsp;to SHARD Broker which of the columns should be used as&nbsp;<code>shard_key</code>. This is done by adding&nbsp;<code>/*+ shard_key */</code>&nbsp;SQL hint to the&nbsp;<code>SELECT</code>&nbsp;query&nbsp;in&nbsp;<code>WHERE</code>&nbsp;clause&nbsp;before the value or the placeholder as shown above.</li>
</ol>
<p>If you compile and run this program, you will see the following output:</p>
<div editor_component="code_highlighter" code_type="Bash" first_line="1" collapse="false" nogutter="false" style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">Connected!<br /> Number&nbsp;of&nbsp;columns:&nbsp;2<br /> post_id,&nbsp;post_title,&nbsp;<br /> 128&nbsp;&nbsp;SHARD&nbsp;0:&nbsp;Post&nbsp;3&nbsp;Title&nbsp;&nbsp;<br /> Connection&nbsp;is&nbsp;closed</div>
<h2>Conclusion</h2>
<p>In this tutorial you have learnt how to&nbsp;create multiple VMs automatically with CUBRID installed on each of them and configured CUBRID SHARD. As you can see, Vagrant along with Chef cookbook allow us to work with CUBRID Database and other software very easily. It is so much convenient and saves so much of our time. Now creating a development environment is no more painful.</p>
<p>If you have questions, feel free to ask at <a href="/questions" target="_self">CUBRID Q&amp;A</a> site, <a href="/forum" target="_self">forum</a>, our <a href="http://www.facebook.com/cubrid" target="_self">Facebook</a> page, or <a href="http://twitter.com/cubrid" target="_self">Twitter</a>.&nbsp;If you have issues or feature requests to <b>cubrid-cookbook</b>, <a href="https://github.com/kadishmal/cubrid-cookbook/issues/new" target="_self">create a new issue</a> at its Github repo.</p>]]></description>
                        <pubDate>Tue, 15 Jan 2013 00:23:23 -0800</pubDate>
                        <category>installation instructions</category>
                        <category>Sharding</category>
                        <category>Vagrant</category>
                        <category>cookbook</category>
                        <category>VM</category>
                                </item>
        										        <item>
            <title>How to Get PHP Version</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-get-php-version</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-get-php-version</guid>
                                    <description><![CDATA[<p>If you don't know yet how you can obtain the PHP version, we will guide now by presenting a couple of approaches.</p>
<p>Method #1. Obtain the values from "php -info". If you have <a target="_self" href="http://gnuwin32.sourceforge.net/packages/grep.htm">grep</a> installed, you can simply run:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="true" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">php&nbsp;-info&nbsp;|&nbsp;grep&nbsp;"PHP&nbsp;Version"<br /> php&nbsp;-info&nbsp;|&nbsp;grep&nbsp;"Architecture"<br /> php&nbsp;-info&nbsp;|&nbsp;grep&nbsp;"PHP&nbsp;Extension&nbsp;Build"</div>
<p>The first command returns the PHP version (ex. 5.3.6), the second returns the PHP architecture (x86 for 32 bit or x64 for 64 bit) and the last command returns the build type. You should look for TS or NTS and VC6 or VC9 on Windows.</p>
<p>If you do not have grep installed you can output the result into a file using the command:</p>
<div style="border: #666 1px dotted; border-left: #2AE 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nogutter="true" collapse="false" first_line="1" code_type="Bash" editor_component="code_highlighter">php&nbsp;-info&nbsp;&gt;&nbsp;phpinfo.txt</div>
<p>Then, just check the <em>phpinfo.txt</em> file created and look for PHP Version, Architecture and PHP Extension Build.</p>
<p>Now that you know the version, architecture and PHP Extension Build, all that remains is to download the&nbsp;<a target="_self" href="/?mid=downloads&amp;item=php_driver&amp;os=detect&amp;php=detect&amp;driver=detect">CUBRID PHP driver</a>&nbsp;that corresponds to your system&nbsp;and install it using the procedure below:</p>
<p>You will see a&nbsp;<b>php_cubrid.dll</b>&nbsp;file inside the archive on Windows. On Linux it is <strong>cubrid.so</strong>.</p>
<ul>
<li>Copy this library&nbsp;to the default PHP extensions folder (usually located at <b>C:&#92;Program Files (x86)&#92;PHP&#92;ext</b>).</li>
<li>Set your system environment. Check if the environment variable <b>PHPRC</b> is "C:&#92;Program Files (x86)&#92;PHP&rdquo; and system variable path is added with &ldquo;<b>%PHPRC%</b>&rdquo; and &ldquo;<b>%PHPRC&#92;ext</b>&rdquo;.</li>
<li>
<p>Edit <b>php.ini</b> (C:&#92;Program Files (x86)&#92;PHP&#92;php.ini) and add the following two lines at the end of the php.ini file.</p>
</li>
<div style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;" nocontrols="false" nogutter="false" collapse="false" first_line="1" code_type="Plain" editor_component="code_highlighter">[!PHP_CUBRID]<br /> extension=php_cubrid.dll</div>
<li>If you have installed <b>CUBRID 64 bit version</b>, but you are running <b>PHP 32 bit version</b>, then you must also copy the 32 bit version of <b>cascci.dll</b>&nbsp;<a target="_self" href="/?mid=downloads&amp;item=cci_driver&amp;os=detect&amp;ostype=any">available here</a>&nbsp;to the&nbsp;location<b>&nbsp;</b>where PHP is installed (<b>C:&#92;Program Files (x86)&#92;PHP</b>). Only cascci.dll needs to be copied from the contents of the archive.</li>
<li>Restart your Web Server.</li>
</ul>]]></description>
                        <pubDate>Wed, 31 Oct 2012 06:21:25 -0800</pubDate>
                        <category>php</category>
                        <category>version</category>
                        <category>phpinfo</category>
                                </item>
        										        <item>
            <title>How to Run a SQL Script / File</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-run-a-sql-script-file</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=how-to-run-a-sql-script-file</guid>
                                    <description><![CDATA[<p>There are several ways to run queries from a SQL file. One of the easiest ways is run scripts directly using the CSQL command line interpreter. Assuming the script you want to run is named "insert_commands.sql", the following commands should be ran within csql:</p>
<div editor_component="code_highlighter" code_type="Plain" title="" first_line="1" collapse="false" highlight="" nogutter="false" style="border:#666 1px dotted;border-left:#2AE 5px solid;padding:5px;background:#FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">;CL<br />
;READ&nbsp;insert_commands.sql<br />
;RU&nbsp;</div>

<p></p>

<p>The first command, clears the command line buffer (;CLear). The second reads the sql script into the command line buffer (;REAd). The last command executes the commands in the command line buffer (;RUn).</p>
<p>Note: If you want the script to run quicker, then you should set autocommit to off. To do this, before running the ;RU command, you should run:</p>
<div editor_component="code_highlighter" code_type="Plain" title="" first_line="1" collapse="false" highlight="" nogutter="true" style="border:#666 1px dotted;border-left:#2AE 5px solid;padding:5px;background:#FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">;AU&nbsp;off</div>

<p>This command disables autocommit. Due to this reason, after you run the sql script, in order to commit your changes made, you MUST run:</p>
<p></p>
<div editor_component="code_highlighter" code_type="Plain" title="" first_line="1" collapse="false" highlight="" nogutter="true" style="border:#666 1px dotted;border-left:#2AE 5px solid;padding:5px;background:#FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">;commit</div>
<p>;commit (or ;co) commits all changes made.</p>

<p>If you still encounter problems and you are not able to run a SQL script or import a SQL file, please contact us by posting a message in our <a href="http://www.cubrid.org/questions" target="_self">Q&amp;A</a> site.</p>]]></description>
                        <pubDate>Sat, 27 Oct 2012 22:45:33 -0800</pubDate>
                        <category>run sql script</category>
                        <category>SQL</category>
                        <category>autocommit</category>
                                </item>
        										        <item>
            <title>Important Facts to Know about CUBRID</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=important-facts-to-know-about-cubrid</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=important-facts-to-know-about-cubrid</guid>
                                    <description><![CDATA[<p>All database systems are different one way or another. But utilizing best practices and recommendations are equally important on all systems. To improve your experience with CUBRID, we would like to provide you with a list of important facts about CUBRID. Learning them will help you better understand CUBRID, better tune the server configurations, better optimize your SQL queries and therefore improve the performance of your applications.</p>

<blockquote class="q4"><p>The below list is not exhaustive. Gradually we will be adding more tips. If you have additional recommendations based on your experience which you think would be helpful to other CUBRID users, please write them in the comments below. We will add your recommendations to this list.</p>

</blockquote>

<h3>License</h3><p>CUBRID is distributed under the terms of GPL v2+. However its APIs are available under New BSD. Reason? Give users complete freedom over how they use the APIs and their source code.</p>

<p>We want &nbsp;to ensure that the new features, fixes and other improvements made by third-party developers to the Core Engine are open so that all CUBRID community users could benefit, by distributing the client libraries under the terms of BSD we want to provide OEMs, VARs, and ISVs full control of their products. Developers embedding CUBRID APIs in their applications are required neither to open their source code nor to purchase the commercial license (actually we do not have one). This is one of the most essential benefits developers can experience with CUBRID.</p>

<h3>SQL in CUBRID</h3>
<p>SQL syntax in CUBRID is very similar to MySQL and even Oracle. In fact, there is over 90% SQL compatibility between CUBRID and MySQL. You can execute most of your existing SQL statements in CUBRID without any modifications. With every new release we add more functions and data types to increase MySQL compatibility.</p>

<p>Despite almost full SQL compatibility, there are some syntax elements which are different in CUBRID:</p>

<ul>
<li><code>CREATE TABLE IF NOT EXISTS</code> syntax is not supported yet.</li>
<li>Though CUBRID fully supports&nbsp;<code>ALTER TABLE ... RENAME TO</code>&nbsp;as does MySQL, you can use a much cleaner and easier syntax&nbsp;<code>RENAME TABLE ...</code>.</li>
</ul>
<p>An interesting note is that CUBRID supports <b>Hierarchical Queries</b> compatible with Oracle syntax.</p>

<p></p>

<h3>CUBRID is not a fork</h3>
<p>CUBRID is <b>not</b> a fork of MySQL (or any other DBMS, for that matters), therefore it does not have anything similar like Storage Engines, e.g.&nbsp;<code>ENGINE=InnoDB</code> part in <code>CREATE TABLE</code> statement. So, if your SQL includes it, just remove it.</p>

<h3>Reserved Words</h3>
<p>Take a quick look at the <a href="/manual/90/en/Reserved%20Words" target="_self">reserved words</a> in CUBRID. If your project uses any of them as table or column names, you need to always quote them using backticks (<code>``</code>), double quotes (<code>""</code>) or square brackets (<code>[]</code>), whenever they are referenced.</p>

<p>Besides these, there are some <b><i>unescapable reserved words</i></b>. They are the data type name such as INT, VARCHAR etc. You cannot use these words as identifiers, i.e. as names of your tables. The reason lies behind CUBRID's architecture. As you know CUBRID is a relational database but it also supports objects. This allows users to <b>create tables where columns' data type can be another table</b>. See the following example:</p>

<p></p>

<div editor_component="code_highlighter" code_type="Sql" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">create table t1 (a int);<br />create table t2 (b t1);</div>

<p></p>

<p>Here <b>t1</b> table can be a column type of column <b>b</b> in table <b>t2</b>. So considering this feature, look at this example below:</p>

<p></p>

<div editor_component="code_highlighter" code_type="Sql" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">create table "int" (a int);<br />create table "t2 (b int);</div>

<p></p>

<p>If we allow a table to have a name like "int", then we have a problem: <b>what is the type of column b in t2? Is it the table "int", or just the basic type INT?</b></p>

<p>This creates an ambiguity. This is why in CUBRID data type names are not allowed to be table names.</p>

<h3 id="database">Database in CUBRID</h3><p></p>

<ol>
<li>Every database in CUBRID <b>must be explicitly started</b> before working with them. By default they are stopped. See [Start or Autostart CUBRID Database] for more info.</li>
<li>As of version 8.4.3, database names in CUBRID should not exceed 17 characters.</li>
<li>CUBRID does not allow to create or drop a database from within the SQL query. Command line <code>cubrid createdb</code>, <code>cubrid deletedb</code> utilities or <a href="/wiki_tools" target="_self">CUBRID GUI Tools</a> should be used to accomplish this task.</li>
</ol>
<p></p>

<h3>Data Types</h3>
<p>As of version 9.0.0 CUBRID does not support <code>UNSIGNED</code>, <code>BOOL</code>&nbsp;data types, if you want to use them.&nbsp;<code>ENUM</code>&nbsp;is supported since <a href="/blog/news/announcing-cubrid-9-0-with-3x-performance-increase-and-sharding-support/" target="_self">9.0.0</a>.&nbsp;The rest will be implemented in the future versions. See <a href="/cubrid_mysql_oracle_data_type_mapping" target="_self">CUBRID vs. MySQL vs. Oracle Data Type Mapping</a> for more information on recommended data type mapping.</p>

<p>In 8.4.1. if you set <code>SYS_TIMESTAMP</code> as a <code>DEFAULT</code> value of a <code>TIMESTAMP</code> column when creating a table, the <code>TIMESTAMP</code> value <b>at the point of</b> <code>CREATE TABLE</code> <b>will be set as default</b>, <b>NOT</b> the time at which the data is INSERTed. Therefore, in order to set the current time and not the time when the table was created, you must specify the <code>SYS_TIMESTAMP</code> value for the <code>VALUES</code> of the <code>INSERT</code> statement when entering data.</p>

<p>In 9.0.0&nbsp;<code>SYS_TIMESTAMP</code>/&nbsp;<code>SYSDATE</code>&nbsp;set as <code>DEFAULT</code>&nbsp;values will be based on the time/date of the query execution.</p>

<h3>User Defined Data Types</h3><p>In CUBRID users can create columns with custom data type. One table can be a data type for a column in another table. See an example given in the <b>Reserved Words</b> section above.</p>

<h3>Data Type Boundaries</h3>
<p>Also pay attention to permitted [CUBRID RDBMS Size Limits|maximum and minimum] values for data types.</p>

<h3 id="lob">Large Objects</h3>

<ol>
<li>In CUBRID [Working with CUBRID BLOB / CLOB Data Types|Large Objects (BLOB/CLOB)] are stored outside the database on the external storage while the references to those files are stored in database columns.</li>
<li>Since they are stored on the external disk, LOB data cannot be indexed. See the <a href="/manual/841/en/Creating%20and%20Altering%20Columns" target="_self">manual</a> for more info.</li>
<li>Likewise, UNIQUE index cannot be created.</li>
<li>Columns with LOB data type cannot be <code>NOT NULL</code> and cannot have <code>DEFAULT</code> value.</li>
</ol>
<p></p>

<h3>Indexing in CUBRID</h3>
<p></p>
<p>CUBRID uses <a href="/cubrid_query_tuning" target="_self">B+tree indexes</a> to improve search performance</p>
<p></p>
<ol>
<li>Works great for equality operator (<code>=</code>).</li>
<li>Since indexes are represented as trees, Key range scan allows to significantly improve the search performance if WHERE clause contains range conditions (<code>&lt;</code>, <code>&gt;</code>, <code>&lt;=</code>, <code>&gt;=</code>, <code>=</code>). If Range conditions are not defined, the Optimizer will attempt to perform sequential table scan.</li>
<li>Try to avoid using irregular conditions such as <code>&lt;&gt;</code>, <code>!=</code>, or <code>NULL</code>, since the Optimizer will not be able to take the full advantage of the index tree, and instead will perform a sequential scan.</li>
<li><a href="/cubrid_covering_index" target="_self">Covering Index</a> is magic. Use it to improve the search performance.</li>
<li>If possible, utilize <code>LIMIT</code> clauses to take advantage of <b>Key limit optimizations</b>.</li>
<li>Learn about <b>In-place Sorting</b> feature in CUBRID to improve the performance of <code>ORDER BY</code> statements.</li>
<li>Use <code>COUNT(*)</code> instead of <code>COUNT(col_name)</code>, unless you really know what you are doing.</li>
<li>Index names in CUBRID are <b>unique per table</b>. For better readability, you can indicate in an index name the <i>name of the table</i> the index belongs to like <code>pk_tableName_col1Name_col2Name_etc</code>.</li>
<li>LOB data cannot be indexed in CUBRID.</li>
<li>Avoid creating indexes on columns where values can exceed <b>16KB</b>. For more information refer to <b>Page Storage Structure</b> section of <a href="/blog/dev-platform/how-sql-update-is-performed-in-cubrid-rdbms/" target="_self">How SQL UPDATE is performed in CUBRID RDBMS</a>.</li>
<li>Try to avoid low-selectivity edges (eg. indexes on columns where there are very few distinct values like <i>gender</i>). Since in CUBRID indexes are stored in B+tree, in low-selectivity case, same value records (eg. records where <i>gender = 'M'</i>) will be stored in the same index node. If there are too many records which cannot fit into one page, CUBRID will need to maintain Overflow OID page for them. If the number of separate overflow pages increase, it will affect the performance as there will be a burden to navigate between these additional links. For more, refer to <b>Overflow OID</b> section in the same <i>How SQL UPDATE is performed in CUBRID RDBMS</i> blog.</li>
<li>If you have created an index and would like to UPDATE/DELETE/INSERT a new data, try to use random inserts to avoid key locking. Refer to <b>Key Lock</b> section of <i>How SQL UPDATE is performed in CUBRID RDBMS</i> blog.</li>
</ol>
<p></p>

<h3>Click Counter</h3>
<p></p>

<p></p>
<p>Take advantage of CUBRID’s unique <a href="/cubrid_click_counter" target="_self">Click Counter</a> feature. For example, instead of executing two separate SQL statements like:</p>
<p></p>
<div editor_component="code_highlighter" code_type="Sql" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(./modules/editor/components/code_highlighter/code.png) no-repeat top right;)">
SELECT article FROM article_table WHERE article_id = 130,987;<br />
UPDATE article_table SET read_count = read_count + 1 WHERE article_id = 130,987;
</div>
<p>… in CUBRID you can execute only one:</p>
<p></p>
<div editor_component="code_highlighter" code_type="Sql" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(./modules/editor/components/code_highlighter/code.png) no-repeat top right;)">
SELECT article, INCR(read_count) FROM article_table WHERE article_id = 130,987</div>
<p>This will help you avoid expensive lock of the working record generated by <code>UPDATE</code> operation.</p>

<h3>AUTO_INCREMENT</h3>

<p><code>AUTO_INCREMENT</code> in CUBRID is implemented as <code><a href="/cubrid_serial" target="_self">SERIALS</a></code>&nbsp;which are not affected by transaction rollback. This is different from how it is implemented in MySQL. In practice, developers do not care about the implementation details. But with&nbsp;<code><a href="/cubrid_serial" target="_self">SERIALS</a></code>&nbsp;implementation you can, for example, control the step of the increment or set the initial value. It is good to know what you can do in CUBRID. We have blogged about this in details in <a href="/blog/cubrid-comparison/things-to-understand-when-moving-from-mysql-to-cubrid/" target="_self">Things to Understand When Moving from MySQL to CUBRID</a>. Please refer to this document.</p>

<h3>Foreign Keys</h3><p><a href="/manual/90/en/Constraint%20Definition" target="_self">Foreign keys</a> in CUBRID <b>must</b>&nbsp;reference <code>PRIMARY KEY</code>&nbsp;columns of referenced tables. In other words, you cannot reference non-primary key columns.&nbsp;Also, if the parent table has a compound primary key, i.e. PK that consists of multiple columns, all these columns must be referenced in the FOREIGN KEY and&nbsp;in the same order. Referencing only some of them is not allowed. How can a child record have multiple referenced parent records after all?</p>

<h3>User Management</h3><p></p>

<ul>
<li>In CUBRID, the smallest <i>grant unit of authorization</i> is a <b>table</b>. This means that CUBRID does not support authorizations at the column level. Refer to <a href="/intro_cubrid_security" target="_self">Introduction to CUBRID Security</a> for more information.</li>
<li>Also, in CUBRID there is a concept of <b>users</b> and <b>groups</b>. Any user can represent a group which will mean that any group member will inherit all the privileges of this group. The parent user which became a group is still a user, i.e. you can use it to connect. Thus, <i>grouping</i> in CUBRID allows to delegate all the privileges of one user to other users.</li>
<li>To learn more, we recommend to look at <i><a href="/?mid=questions&amp;tag=user" target="_self">user management</a></i> related questions and answers.</li>
</ul>
<h3 id="ha">Native High-Availability feature</h3><p>Did you know that CUBRID has its own built-in High-Availability feature? Oh, yes, it does. In fact, CUBRID HA is one of the main reasons why Enterprise solution providers choose CUBRID over other open source RDBMS. It is based on transaction log replication, and provides very accurate and predictable fail-over and fail-back features based on CUBRID Hearbeat. You can configure HA environment in three copy modes for transaction log replication: synchronous, semi-synchronous, and asynchronous modes.</p>

<p>With CUBRID HA, it is possible to build multi <i><b>Master:Slave</b></i> services. There is also Master:Slave:Replica configuration. <span style="font-family: Arial, sans-serif; text-align: left; ">This configuration will provide </span><em style="font-family: Arial, sans-serif; text-align: left; ">much lower networking and disk I/O loads</em><span style="font-family: Arial, sans-serif; text-align: left; "> for </span><em style="font-family: Arial, sans-serif; text-align: left; ">heavy read loaded Web services, </em><span style="font-family: Arial, sans-serif; text-align: left; ">than the </span><em style="font-family: Arial, sans-serif; text-align: left; ">single master and multiple slaves</em><span style="font-family: Arial, sans-serif; text-align: left; "> configuration does.</span></p>

<p>For small size Web services whose primary goal is to lower the cost, developers can configure multiple slaves in a single server. This configuration will allow to gather all (or some) slave databases on a single host. Thus, it will be possible to allocate a single physical machine for multiple slave databases, each of which are separately replicated from their own master databases. Refer to <a href="/cubrid_ha_oscon" target="_self">OSCON</a> conference presentation material to see how you can develop your service architecture.</p>

<p>To learn more about CUBRID HA, read <a href="/blog/cubrid-story/overview-of-new-high-availability-features-in-cubrid-3-2/" target="_self">Overview of New High-Availability Features in CUBRID 8.4.0</a> as well as <a href="/cubrid_ha_process" target="_self">How CUBRID HA Works?</a> Also you are highly encouraged to view our <a href="/cubrid_ha_oscon" target="_self">OSCON</a> and <a href="http://www.slideshare.net/cubrid/growing-in-the-wild-the-story-by-cubrid-database-developers" target="_self">RIT++</a> conference presentation materials. You will find very interesting information about CUBRID there.</p>

<p>If you want to try CUBRID HA, see how to [Configure CUBRID HA with Vagrant and Chef Cookbook under 4 minutes].</p>

<h3 id="sharding">Native Database Sharding feature</h3><p>This is something no open source RDBMS can offer you for free. We have developed a native CUBRID SHARD feature which will be released with CUBRID 8.4.3 in October, 2012. All open source! All completely free!</p>

<p>Refer to <a href="/blog/cubrid-life/database-sharding-with-cubrid/" target="_self">Database Sharding with CUBRID</a> to get a sneak peek of how will CUBRID SHARD work. We have also posted a blog about the <a href="/blog/dev-platform/database-sharding-platform-at-nhn/" target="_self">difference between CUBRID SHARD and Spock Proxy for MySQL</a>. We will publish the manual how to setup CUBRID SHARD along with the official announcement. Stay tuned!</p>

<div id="endic_ext_wrapper" style="display: none; "></div>

<div id="endic_ext_wrapper" style="display: none; "></div>

<div id="endic_ext_wrapper" style="display: none; "></div>]]></description>
                        <pubDate>Tue, 14 Feb 2012 01:00:30 -0800</pubDate>
                        <category>tutorials</category>
                        <category>HA</category>
                        <category>Sharding</category>
                                </item>
        										        <item>
            <title>Install Apache Solr on Ubuntu</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=install-apache-solr-on-ubuntu</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=install-apache-solr-on-ubuntu</guid>
                                    <description><![CDATA[<p>Installing Apache Solr on Ubuntu is quite easy. In fact, it does not require any installation. All you will need to do is just download and extract the package. But before you proceed, make sure you have already [Install Apache Tomcat on Ubuntu|installed Tomcat] which is necessary to access Solr from the browser.<br /></p>

<p>To make further management of Solr server easy, we will first create a separate user for it.</p>

<p></p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">sudo adduser solr</div>

<p></p>

<p>You will be asked to enter a password for <span style="font-weight: bold;">solr</span> user as well as additional information which you can ignore by simply pressing Enter. Once done, login to this user. When password is prompted, enter the password you have just created.<br /></p>

<p></p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">su - solr</div>

<p></p>

<p>Once you are logged in, you will be in <span style="font-weight: bold;">/home/solr</span> directory.<br /></p>

<p>Now download the <a target="_self" href="http://www.apache.org/dyn/closer.cgi/lucene/solr">latest version of Apache Solr</a> from the official site. On that site you will be given a list of mirror sites to download the installation package. Click on one of them. You will see a list of several versions of Solr. Choose the latest one. Copy the URL of the file (<span style="font-weight: bold;">*.tgz</span>) and download it from the terminal as shown below.</p>

<p></p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">wget http://mirror.apache-kr.org/lucene/solr/4.0.0/apache-solr-4.0.0.tgz</div>

<p></p>

<p>Extract the package.</p>

<p></p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">tar xzf apache-solr-4.0.0.tgz</div>

<p></p>

<p>All files will be extracted to <span style="font-weight: bold;">apache-solr-4.0.0/</span> directory. This is all you need to continue to work with Solr. To configure Solr server to connect to a CUBRID Database, see the <a href="/wiki_tutorials/entry/full-index-of-cubrid-database-using-solr-dataimporthandler" target="_self">next tutorial</a>.<br /></p>]]></description>
                        <pubDate>Mon, 20 Feb 2012 02:13:39 -0800</pubDate>
                        <category>Solr</category>
                        <category>installation instructions</category>
                        <category>ubuntu</category>
                                </item>
        										        <item>
            <title>Install Apache Tomcat on Ubuntu</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=install-apache-tomcat-on-ubuntu</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=install-apache-tomcat-on-ubuntu</guid>
                                    <description><![CDATA[<p><a target="_self" href="http://tomcat.apache.org/">Apache Tomcat</a> is a Web container that allows to serve Java Servlets (such as [Using Solr / Lucene for full text search with CUBRID Database on Ubuntu|Solr full-text search server]) and JSP (Java Server Pages) Web applications. More information can be found on Tomcat official site.<br /></p>

<p>In this tutorial you will learn how to install Tomcat 7 on Ubuntu 11.10. To install Tomcat type the following command in the terminal.</p>

<p></p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">sudo apt-get install tomcat7</div>

<p></p>

<p>This will install Tomcat on port 8080 (default) and autostart it (also it will be set to autostart on system reboot). To see if installation went successfully, navigate to <a target="_self" href="http://localhost:8080">http://localhost:8080</a> in your browser. You should see a default page which displays "<b>It works!</b>".</p>

<p>To have Apache Solr work with Tomcat, you do not need to configure anything. Default settings will work out of the box. If necessary, you can refer to <a target="_self" href="https://help.ubuntu.com/11.04/serverguide/C/tomcat.html">Ubuntu Documentation for Tomcat</a>.<br /></p>

<h2>Stop/Start Tomcat</h2><p>If you need to stop or start Tomcat, run the following respectively:</p>

<p></p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;">~$ sudo service tomcat7 stop<br />~$ sudo service tomcat7 start</div>

<div id="endic_ext_wrapper" style="display: none; "></div>]]></description>
                        <pubDate>Mon, 20 Feb 2012 01:41:23 -0800</pubDate>
                        <category>Tomcat</category>
                        <category>Java</category>
                        <category>Solr</category>
                        <category>ubuntu</category>
                                </item>
        										        <item>
            <title>Installing CUBRID on Fedora/CentOS</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=installing-cubrid-on-fedoracentos</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=installing-cubrid-on-fedoracentos</guid>
                                    <description><![CDATA[<p>To install CUBRID on Fedora or Ce using <b>yum</b>&nbsp;command, we need to tell Yum where to look for CUBRID packages. First, visit one of the following links depending on your OS.</p>

<p></p>
<ul>
<li>CentOS:&nbsp;<a href="/?mid=yum_repository&amp;os=centos&amp;cubrid=8.4.3" target="_self">http://www.cubrid.org/?mid=yum_repository&amp;os=centos&amp;cubrid=8.4.3</a></li>
<li>Fedora:&nbsp;<a href="/?mid=yum_repository&amp;os=fedora&amp;cubrid=8.4.3" target="_self">http://www.cubrid.org/?mid=yum_repository&amp;os=fedora&amp;cubrid=8.4.3</a></li>
<li>Full Tutorial:&nbsp;<a href="/cubrid_yum_repositories">http://www.cubrid.org/cubrid_yum_repositories</a>
</li>
</ul>
<p></p>

<p>There choose CUBRID version. You will be given a list of links for your particular version.&nbsp;</p>

<h2>CUBRID 8.4.3</h2>

<p>Since CUBRID 8.4.3 there are only 2 repositories and you must choose according to your OS and version:</p>
<ul>
<li>For Fedora 15 and above:<br />
<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="true" nocontrols="false" style="border:#666 1px dotted;border-left:#2AE 5px solid;padding:5px;background:#FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;" title="" highlight="">sudo rpm&nbsp;-ivh http://yumrepository.cubrid.org/cubrid_repo_settings/8.4.3/cubridrepo-8.4.3-1.fc15.noarch.rpm</div>

</li>
<li>For Fedora 13/14 and Centos 6.0 and above:<br />
<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="true" nocontrols="false" style="border:#666 1px dotted;border-left:#2AE 5px solid;padding:5px;background:#FAFAFA url('./modules/editor/components/code_highlighter/code.png') no-repeat top right;" title="" highlight="">sudo rpm&nbsp;-ivh http://yumrepository.cubrid.org/cubrid_repo_settings/8.4.3/cubridrepo-8.4.3-1.el6.noarch.rpm</div>
</li>
</ul>

<h2>CUBRID 8.4.1 and below</h2>
<p>For example, the following link is provided for Fedora 17 where <b>fc17</b>&nbsp;means this OS version. Other versions will have <b>fc16, fc15</b>, etc.</p>

<div style="background: url(&quot;/modules/editor/components/code_highlighter/code.png&quot;) no-repeat right top rgb(250, 250, 250); border-width: 1px 1px 1px 5px; border-style: dotted dotted dotted solid; border-color: rgb(102, 102, 102) rgb(102, 102, 102) rgb(102, 102, 102) rgb(34, 170, 238); padding: 5px;" nocontrols="false" nogutter="false" collapse="false" first_line="1" description="" file_path="" code_type="Bash" editor_component="code_highlighter">sudo rpm -i http://yumrepository.cubrid.org/cubrid_repo_settings/8.4.1/cubridrepo-8.4.1-1.fc17.noarch.rpm</div>

<p>Or CentOS example where <b>el6.2</b> means CentOS version 6.2:</p>

<div style="background: url(&quot;/modules/editor/components/code_highlighter/code.png&quot;) no-repeat right top rgb(250, 250, 250); border-width: 1px 1px 1px 5px; border-style: dotted dotted dotted solid; border-color: rgb(102, 102, 102) rgb(102, 102, 102) rgb(102, 102, 102) rgb(34, 170, 238); padding: 5px;" nocontrols="false" nogutter="false" collapse="false" first_line="1" description="" file_path="" code_type="Bash" editor_component="code_highlighter">sudo rpm -i http://yumrepository.cubrid.org/cubrid_repo_settings/8.4.1/cubridrepo-8.4.1-1.el6.2.noarch.rpm</div>

<h2>Installing CUBRID</h2>

<p>Executing the above command will tell Yum where to look for CUBRID packages.</p>

<p>Now, you can install CUBRID by running:</p>

<div style="background: url(&quot;/modules/editor/components/code_highlighter/code.png&quot;) no-repeat right top rgb(250, 250, 250); border-width: 1px 1px 1px 5px; border-style: dotted dotted dotted solid; border-color: rgb(102, 102, 102) rgb(102, 102, 102) rgb(102, 102, 102) rgb(34, 170, 238); padding: 5px;" nocontrols="false" nogutter="false" collapse="false" first_line="1" description="" file_path="" code_type="Bash" editor_component="code_highlighter">yum install cubrid</div>

<p>To complete the installation and set the CUBRID PATH variables, reboot your OS or logout and login again. Until rebooting you must run ". /etc/profile.d/cubrid.sh" to set the PATH variables every time you open a new terminal window.</p>

<p><b>Optional:</b>&nbsp;If you want to install the demodb sample database, run the command:</p>

<div editor_component="code_highlighter" code_type="Bash" file_path="" description="" first_line="1" collapse="false" nogutter="false" nocontrols="false" style="border: #666666 1px dotted; border-left: #22aaee 5px solid; padding: 5px; background: #FAFAFA url(/modules/editor/components/code_highlighter/code.png) no-repeat top right;">&nbsp;sudo yum install cubrid-demodb</div>

<a name="installation_notes"></a>
<h2>Installation Notes</h2>
<ul>
<li>CUBRID is installed in /usr/share/cubrid.</li>
<li>The configuration files are placed in /etc/cubrid.</li>
<li>Variable files (such as logs or databases) are stored in /var/cubrid.</li>
<li>Binaries can be found in /usr/bin and /usr/sbin, while libraries in /usr/lib.</li>
<li>The path variables $CUBRID and $CUBRID_DATABASES are set in the file /etc/profile.d/cubrid.sh.</li>
<li><b>If you run a CUBRID service command, you can view its output in /var/cubrid/tmp/service.cubrid.</b></li>
<li>CUBRID is set to automatically start on boot and the service file is located at /etc/init.d/cubrid.</li>
<li>On Fedora 15+, there is also a <b>systemd </b>file located at /usr/lib/systemd/system/cubrid.service</li>
<li><b>Highly Important!&nbsp;</b>cubrid or standalone csql commands can be only ran as cubrid user (which has no password). To connect as this user, use "sudo su -s $SHELL cubrid".</li>
</ul>]]></description>
                        <pubDate>Tue, 24 Jan 2012 20:56:36 -0800</pubDate>
                        <category>CUBRID</category>
                        <category>installation instructions</category>
                        <category>CentOS</category>
                        <category>Fedora</category>
                        <category>tutorials</category>
                                </item>
        										        <item>
            <title>CUBRID RDBMS Size Limits</title>
            <dc:creator>Esen Sagynov</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-rdbms-size-limits</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=cubrid-rdbms-size-limits</guid>
                                    <description><![CDATA[<p>When working with databases, it is important to understand what the upper and lower bounds are for its data types, database and table size, rows, etc. More than that, it's always good to know if you intend to compare it with other database systems. In this page you can see a table with all the MAX and MIN limitations set in the CUBRID RDBMS.</p>

<table>
<thead>
  <tr>
    <th class="">Constituent</th>
    <th class="">Max</th>
    <th class="">Min</th>
    <th class="">Remarks</th>
  </tr>
</thead>
<tbody>
  <tr>
    <td class="">Database</td>
    <td class="">unlimited</td>
    <td class=""></td>
    <td class=""></td>
  </tr>
  <tr>
    <td class="">Table</td>
    <td class="">unlimited</td>
    <td class=""></td>
    <td class=""></td>
  </tr>
  <tr>
    <td class="">Row</td>
    <td class="">unlimited</td>
    <td class=""></td>
    <td class=""></td>
  </tr>
  <tr>
    <td class="">Columns per Row</td>
    <td class="">6400</td>
    <td class=""></td>
    <td class=""></td>
  </tr>
  <tr>
    <td class="">Database Name Length</td>
    <td class="">16</td>
    <td class=""></td>
    <td class=""></td>
  </tr>
  <tr>
    <td class="">Column Name Length</td>
    <td class="">254</td>
    <td class=""></td>
    <td class=""></td>
  </tr>
  <tr>
    <td class="">Indexes per table</td>
    <td class="">unlimited</td>
    <td class=""></td>
    <td class=""></td>
  </tr>
  <tr>
    <td class="">[Working with CUBRID BLOB / CLOB Data Types|BLOB/CLOB]</td>
    <td class="">unlimited</td>
    <td class=""></td>
    <td class=""></td>
  </tr>
  <tr>
    <td class="">NUMBER</td>
    <td class="">64 bits</td>
    <td class=""> </td>
    <td class=""></td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/DATE" target="_self">DATE</a></td>
    <td class="">12/31/9999</td>
    <td class="">01/01/0001</td>
    <td class="">00/00/0000 is also allowed for MySQL compatibility.</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/TIME" target="_self">TIME</a></td>
    <td class="">23:59:59</td>
    <td class="">00:00:00</td>
    <td class="">0:0:0 is not allowed.</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/TIMESTAMP" target="_self">TIMESTAMP</a></td>
    <td class="">2038-01-19 03:14:07 (GMT)</td>
    <td class="">1970-01-01 00:00:01 (GMT)</td>
    <td class="">'0000-00-00 00:00:00' is allowed for MySQL compatibility.</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/DATETIME" target="_self">DATETIME</a></td>
    <td class="">9999-12-31 23:59:59.999 (GMT)</td>
    <td class="">0001-01-01 00:00:00.000 (GMT)</td>
    <td class="">'0000-00-00 00:00:00' is allowed for MySQL compatibility.</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/SHORT%7CSMALLINT" target="_self">SHORT<br />SMALLINT</a></td>
    <td class="">+32,767</td>
    <td class="">-32,768</td>
    <td class="">exact numeric</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/INT%7CINTEGER" target="_self">INT<br />INTEGER</a></td>
    <td class="">+2,147,483,647</td>
    <td class="">-2,147,483,648</td>
    <td class="">exact numeric</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/BIGINT" target="_self">BIGINT</a></td>
    <td class="">+9,223,372,036,854,775,807</td>
    <td class="">-9,223,372,036,854,775,808</td>
    <td class="">exact numeric</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/NUMERIC%7CDECIMAL" target="_self">NUMERIC<br />DECIMAL</a></td>
    <td class="xe_selected_cell">precision <b>p : 38</b><br />scale <b>s : 38</b></td>
    <td class="xe_selected_cell">precision <b>p : 1</b><br />scale <b>s : 0</b></td>
    <td class="xe_selected_cell">exact numeric</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/FLOAT%7CREAL" target="_self">FLOAT<br />REAL</a></td>
    <td class="xe_selected_cell">+3.402823466E+38<br />(ANSI/IEEE 754-1985 standard)</td>
    <td class="xe_selected_cell">-3.402823466E+38<br />(ANSI/IEEE 754-1985 standard)</td>
    <td class="xe_selected_cell">approximate numeric<br />floating point : 7</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/DOUBLE%7CDOUBLE%20%20PRECISION" target="_self">DOUBLE<br />DOUBLE PRECISION</a></td>
    <td class="xe_selected_cell">+1.7976931348623157E+308<br />(ANSI/IEEE 754-1985 standard) </td>
    <td class="xe_selected_cell">-1.7976931348623157E+308<br />(ANSI/IEEE 754-1985 standard) </td>
    <td class="xe_selected_cell">approximate numeric<br />floating point : 15</td>
  </tr>
  <tr>
    <td class=""><a href="/manual/841/en/MONETARY" target="_self">MONETARY</a></td>
    <td class="">+3.402823466E+38</td>
    <td class="">-3.402823466E+38</td>
    <td class="">approximate numeric</td>
  </tr>
</tbody>
</table>]]></description>
                        <pubDate>Sun, 12 Feb 2012 17:48:02 -0800</pubDate>
                        <category>Data Types</category>
                        <category>SQL</category>
                                </item>
        										        <item>
            <title>Common Microsoft Errors</title>
            <dc:creator>CUBRID</dc:creator>
            <link>http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=common-microsoft-errors</link>
            <guid isPermaLink="true">http://www.cubrid.org/?mid=wiki_tutorials&amp;entry=common-microsoft-errors</guid>
                                    <description><![CDATA[<p>When you install or configure the OLEDB Driver or ADO.NET Driver, you may encounter certain Microsoft standard error codes that we would like to list here in order to help you comprehend what the problem.</p>

<p></p>

<ul>
<li><b>0x80004005</b> - Access Denied Error - caused by not having enough rights to run the file. For example, when running regsvr32 CUBRIDProvider.dll without having administrator rights, you will encounter this error.</li>
<li><b>0x80070005</b>&nbsp;- Permission Denied Error - same solution as above.</li>
<li><b>0x80029c4a</b>&nbsp;- Can't Load Library Error - the dll you are trying to load is looking for a library that it cannot find. The most probable case with CUBRID is that the file <b>cascci.dll</b>&nbsp;could not be found. You can download this file from our <a href="/?mid=downloads&amp;item=cci_driver&amp;os=detect&amp;ostype=any" target="_self">CCI Driver Download</a> page. Make sure that the CCI driver version matches the ADO.NET or OLEDB Driver version.</li>
</ul>
<p></p>

<p>If you still face problems understanding the error, please post the issue in our <a href="/forum" target="_self">forum</a> or on our <a href="/questions" target="_self">q&amp;a site</a>.</p>]]></description>
                        <pubDate>Mon, 05 Nov 2012 05:04:00 -0800</pubDate>
                        <category>oledb</category>
                        <category>ado.net</category>
                                </item>
            </channel>
</rss>
