<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Balu on Medium]]></title>
        <description><![CDATA[Stories by Balu on Medium]]></description>
        <link>https://medium.com/@bala529?source=rss-b9d577ab29fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hkO3xWGBVHq2EeV9.jpeg</url>
            <title>Stories by Balu on Medium</title>
            <link>https://medium.com/@bala529?source=rss-b9d577ab29fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 03:01:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@bala529/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[MySQL Master-Slave setup — practice]]></title>
            <link>https://medium.com/@bala529/mysql-master-slave-setup-practice-676e1fa5d627?source=rss-b9d577ab29fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/676e1fa5d627</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Balu]]></dc:creator>
            <pubDate>Thu, 02 Jun 2016 19:14:57 GMT</pubDate>
            <atom:updated>2016-06-03T01:33:32.279Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A basic practice tutorial of setup and understanding about the setup environment</em>.</p><p><strong>Note</strong>: This is not an enterprise setup tutorial.</p><blockquote>This is a very basic tutorial of setting up Master-Slave configuration for MySQL database system.</blockquote><p>We must understand why we need a <strong>MASTER-slave</strong> setup for a back-end database and how it looks as an architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/524/1*t3afE6XumWMXhUGtgzVZQA.png" /><figcaption><a href="https://www.percona.com/blog/wp-content/uploads/2009/11/replication1.png">https://www.percona.com/blog/wp-content/uploads/2009/11/replication1.png</a></figcaption></figure><p>The above configuration explains a very simple master-slave setup. The clients or web apps which is used by end-users rely on MySQL back-end database.</p><p>Imagine a situation where there is only one master server serving the data input/output(<strong>I/O</strong>), there is a table being accessed to write on the MySQL master and there is a query to read the same table at the same time. In this situation, the read query will be held back until the write lock of previous write query is released. This will make the I/O interaction between Clients/web apps to be very slow. Eventually it makes the system look very slow at the end-user.</p><p>In order to overcome, this we introduce a copy of the database setup on the master and put it on slave(<strong>REPLICATION</strong>). Here, we can direct all read queries to slave server, so that there is less read traffic at the master server, which will make the system look very snappy. There is no I/O wait or I/O latency to read a table or to write a table, as the write queries can be directed to Master server.</p><p>The above explanation is one of the reasons to setup two servers, one as backup and other as master. The other reason includes high availability of database, when the master fails.</p><p>Lets look at how, this architecture can be setup in terms of today’s cloud infrastructure. To understand how it can be setup in today’s infrastructure, we must see how it would have been deployed around 10 years back.</p><p>We would buy two servers, lets say a mid-range server. And lets install a Linux Operating System(OS), something like Ubuntu server/Cent OS(it can be any flavor of your choice). Once the OS is setup, we would make sure that the network settings are done rite, which makes these two server to communicate with each other. Now once all this is done, we would install MySQL on both servers and sync between them as a master-slave configuration.</p><p>Now, lets look at how it can be done in today’s tech. Today there is not need to buy such big servers, order them from vendors and scratch our head to connect it with the organisations network. It used to take a lot of time. Today, if you want to setup this configuration, you would swing by any of the famous cloud providers website, swipe your credit card and within maximum time of 30 minutes you are ready with your MySQL master-slave configuration which is ready to be used in production. You do not even have to care about the network settings, just drop a simple setting on the cloud providers dashboard that you want to connect between these two servers and you are done. You will be provided with two IP address of these two servers with an operating system already installed and setup. All you have to do is to setup the MySQL master and slave configuration by login into these servers using the IP address.</p><blockquote>Now, that we have understood the agility of today’s deployment setup, the important part to learn is to setup master-slave configuration, which is not changed even after 10 years.</blockquote><p>Lets practice this setup on our laptop with a virtual machine setup. Before this practice, we must consider the configuration of your laptop. Each virtual machine you spawn on your machine, it will take at-least one core of CPU, at-least 1 GB of RAM and at-least 10 GB of secondary storage. So if you spin up two of these virtual machines, it is going to take away at-least 2 GB of RAM and 2 cores of CPU and secondary storage doesn&#39;t really matter now a days.</p><p>If you have a laptop machine, with 6 GB of RAM and at least 4 cores of CPU, then you can go ahead with this practice on your machine. If not, you might have to think of alternatives or go ahead with a slow performance of your machine.</p><p>Lets divide the practice into machine and network setup of the environment and then the actual MySQL setup itself.</p><h3><strong>FIRST PART: Machine and network setup</strong></h3><ol><li>We are choosing Ubuntu server as our choice of one of the most commonly used servers even in enterprise environments for the OS setup. So please download an ISO file of this OS from <a href="http://www.ubuntu.com/download/server"><em>here</em></a><em>.</em></li><li>Lets make sure that you have Virtual Box setup on your machine. You can download Virtual Box from <a href="https://www.virtualbox.org/wiki/Downloads"><em>here</em></a><em>. </em>To setup a virtual machine you can follow <a href="http://www.howtogeek.com/56158/beginner-how-to-create-a-virtual-machine-in-windows-7-using-virtual-pc/"><em>this</em></a><em> </em>very simple tutorial for windows<em>.</em></li><li>Once you are ready with a virtual box installed on your machine, you can spin up the Ubuntu server ISO virtual machine and start the installation of the Ubuntu server. There is only one change to make int he network settings of the virtual machine, you must put the virtual machine to Bridged network.</li><li>Once you start the virtual machine, you will asked several questions on the installation preferences, like name of the host(master and slave would be easy), password and account name/password, time zone etc. Approximately this is going to take 15 to 25 mins depending on the power of your machine.</li><li>Once you have been prompted for a restart on your Ubuntu machines, you are presented with a command line interface(CLI). Login with your username and password.</li><li>First thing to setup a Ubuntu machine is to update the machine with software repositories, so that you can download and setup MySQL from the internet. the command is</li></ol><p><em>sudo apt-get update</em></p><p>7. Now, lets note down the IP address of each machines, once update process if done on both machines. Lets say its something like 192.168.0.15 and 192.168.0.16. To test the network connectivity between these two servers, lets ping each other. From one machine, ping 192.168.0.16 and from the other ping 192.168.0.15. If you get the reply then you are done with setup.</p><p>If the above steps are complete then, your machine and network is setup.</p><p>The second part or the main part of this practice is the MySQL master slave setup. Before we proceed to this point, just to make sure that if something fails, we should be able to come back to this point in no time. We will take a snapshot of the current working state of these two Ubuntu server virtual machines.</p><p>This above part is already available if you are using a cloud environment on today’s infrastructure market. All you have to do is to continue with the second part.</p><h3><strong>SECOND PART: MySQL install and setup</strong></h3><ol><li>You should be having two virtual machine windows places side by side. you can do the following steps simultaneously on both machines.</li><li>Command to input on both machines</li></ol><p>sudo apt-get install mysql-server</p><p>During this process, you will be prompted to provide a password. For practice, you can just leave it blank.</p><p>3. After installation completes, lets move over to the directory in which it is installed.</p><p>cd /etc/mysql/mysql.conf.d/</p><p>4. you should be able to see the configuration files ready to be edited.</p><p>Before we proceed to the MASTER slave setup, lets take another snapshot of these two VMs. At this point you are only left with configuration of MySQL master and slave, you can roll back to this point if something fails.</p><p>and finally…</p><h3><strong>THIRD PART : MySQL MASTER and slave setup.</strong></h3><ol><li>Master server:</li></ol><p>Lets open the configuration file and configure the master server.</p><p>sudo nano /etc/mysql/mysql.conf.d/mysql.cnf</p><p>change the following lines by using nano(simplest text editor):</p><p>sudo nano mysql.cnf</p><p>before change</p><pre>#server-id              = 0</pre><pre>#log_bin                = /var/log/mysql/mysql-bin.log</pre><pre>expire_logs_days        = 10</pre><pre>max_binlog_size         = 100M</pre><pre>#binlog_do_db           = include_database_name</pre><pre>#binlog_ignore_db       = include_database_name</pre><p>After change</p><pre>server-id               = 1</pre><pre>log_bin                 = /var/log/mysql/mysql-bin.log</pre><pre>expire_logs_days        = 10</pre><pre>max_binlog_size         = 100M</pre><pre>#binlog_do_db           = include_database_name</pre><pre>#binlog_ignore_db       = include_database_name</pre><p><em>control key + x</em> and then <em>press y</em> to save changes.</p><pre>sudo service mysql restart</pre><p>2. Slave Server:</p><p>On the slave server you can make the similar configuration except that server-id should be 2 for the slave and bind ip to slave servers IP.</p><p>3. Master server:</p><p>login to MySQL</p><pre>mysql -u root -p</pre><p>create user account</p><pre>mysql&gt; CREATE USER &#39;repl&#39;@&#39;%.example.com&#39; IDENTIFIED BY &#39;supersecretpassword&#39;;</pre><p>Grant privileges to the user account:</p><pre>mysql&gt; GRANT REPLICATION SLAVE ON *.* TO &#39;repl&#39;@&#39;%.example.com&#39;;</pre><p>Flush and apply changes;</p><pre>mysql&gt; FLUSH PRIVILEGES;</pre><p>4. Now lets note down the server status.</p><pre>mysql&gt; show master status;</pre><pre>+------------------+----------+--------------+------------------+</pre><pre>| File             | Position | Binlog_Do_DB | Binlog_Ignore_DB |</pre><pre>+------------------+----------+--------------+------------------+</pre><pre>| mysql-bin.000003 |      107 |              |                  |</pre><pre>+------------------+----------+--------------+------------------+</pre><pre>1 row in set (0.00 sec)</pre><p>exit MySQL console by typing exit.</p><p>5. Slave server:</p><p>lets say to the slave who is the master server.</p><pre>mysql -u root -p</pre><pre>mysql&gt;CHANGE MASTER TO<br>MASTER_HOST=&#39;192.168.0.15&#39;,<br>MASTER_USER=&#39;repl1&#39;,<br>MASTER_PASSWORD=&#39;password&#39;,<br>MASTER_LOG_FILE=&#39;mysql-bin.000003&#39;,<br>MASTER_LOG_POS=107;</pre><p>lets start the slave server,</p><pre>mysql&gt;START SLAVE;</pre><p>6. Finally lets check if slave is talking to master</p><pre>mysql&gt;SHOW SLAVE STATUS\G</pre><p>Here you can see that status shows connected to master.</p><p>If you get the correct status, then you are done with the configuration.</p><h4>Lets summarize, what we just did</h4><p>We installed two Ubuntu server on a virtual environment on your own machine and connected between those two. We also Installed MySQL server on these machines and then finally configured it to behave like a master- slave configuration.</p><p><strong>Note</strong>: <em>Although this practice might be very basic, you really need practice of using a Linux machine in order to setup this configuration. But I guess, if you follow the above practice step by step, you have actually figured it out without any knowledge on operating a Linux machine.</em></p><blockquote>Even more faster setup with very less resource can be done using a new technology called <a href="http://www.docker.com/"><em>Docker</em></a>. There are even ready made configuration of full stack setup of web apps till the back end MySQL, which can be up and running in minutes. If you are interested you can have a <a href="https://github.com/eugeneware/docker-mysql-replication"><em>look</em></a>.</blockquote><p><strong>If you achieved the end result then you can be confident enough to configure an enterprise level database setup and of-course go ahead and like this post!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=676e1fa5d627" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Updating IBM AIX Technology level and Service Pack level]]></title>
            <link>https://medium.com/@bala529/upgrading-ibm-aix-technology-level-and-service-pack-level-81930c72bdfc?source=rss-b9d577ab29fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/81930c72bdfc</guid>
            <category><![CDATA[ibm-power8]]></category>
            <category><![CDATA[unix]]></category>
            <category><![CDATA[ibm]]></category>
            <dc:creator><![CDATA[Balu]]></dc:creator>
            <pubDate>Mon, 19 Oct 2015 15:23:18 GMT</pubDate>
            <atom:updated>2015-11-07T18:51:50.816Z</atom:updated>
            <content:encoded><![CDATA[<p>If you are reading this, then you have a job of upgrading your IBM AIX server OS level. Many of you, who have been looking for upgrade of your AIX machines, would always postpone it, as it may seem very tedious to upgrade the AIX machine. It used to always sound so much technical “Maintenance upgrade, its the job of a System admin! why should I do it!”. The following instructions will make your life much easier, safe and fast upgrade, which anyone can do with simple knowledge of operating in a terminal!</p><p>Lets get started,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*yainXE_7qukzyaUN0oOOVQ.png" /></figure><ol><li>Open terminal/putty and telnet &lt;serverip/serverurl of your AIX server&gt;. And then login into root#. If you want to use ssh, then enable it. Command: <em>startsrc -s sshd</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*W0dpkfLlP4UVkCoEo33XrQ.png" /><figcaption>Welcome Screen of IBM AIX</figcaption></figure><p><strong>2.</strong> Check the operating system level</p><p>command: <em>oslevel -s</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/153/1*YQ23yZZmX3Aya5UgMSX3yw.png" /><figcaption>ServicePack 05 on top of TechnologyLevel 03 on top of BaseOperatingSystem V7.1</figcaption></figure><p><strong>3.</strong> Visit <a href="http://www-933.ibm.com/support/fixcentral/">here</a> for IBM software fix central. And choose the right version of your IBM AIX operating system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/580/1*bBUKl1AFtMXZo6EdVldylQ.png" /><figcaption>OpttionsPage snippet of options to be filled into Fix Central</figcaption></figure><p>After continue.. Select Bulk FTP option as the download method, as there will be a lot of individual files for download, https and java method may not be preferred.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/786/1*HNW35niCoS_GSRniNL9MQQ.png" /><figcaption>Page snippet of Download Options on select page.</figcaption></figure><p><strong>4.</strong> Selecting the right Service pack level and technology level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*-MDqY5Lt5Ei-iulZvNjoTg.jpeg" /><figcaption>Road map of TL and SL upgrades related to current period of Oct 2015.</figcaption></figure><p>which ever service pack you want to upgrade to, there is a pre-requisite that the base technology level has to be upgraded first. For example, if you are moving from TL 2 SP 6 to TL 3 SP 5, select TL3 SP5 on the select page and also include the requisites below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*lyaNzgPCrZlSCPeMS_xoWw.png" /><figcaption>Select the hide requisite fixes, if you are moving from one TL to another.</figcaption></figure><p>By selecting requisite fixes, the previous TL is also included in the download. Please note that this is only in the case where you are moving from a different TL.</p><p>Continue..</p><p>you may be asked for IBM ID, which can be created in 2 mins, by filling out the details asked.</p><p>Note: If you are an IBM employee, you need to link your IBM intranet id with IBM ID.</p><p><strong>5.</strong> Proceeding further you are asked to enter the machine type(4 digits) and machine serial number( 7 digits) which are either available on top of your machine hardware case or on the invoice of the machine purchase.</p><p><strong>6.</strong> Continue..</p><p>You should be able to see the FTP download information. You will need USER ID, PASSWORD and Directory.</p><p><strong>7</strong>. Use <a href="https://filezilla-project.org/">filezilla</a> for FTP download of all the upgrade files into your workstation. provide user name, password and directory into the filezilla application. you should be able to see the directory which contains a lot of files. Transfer all the files into your workstation.</p><p><strong>8</strong>. Now that you have all the files required for AIX upgrade. You need to FTP transfer all the files into the AIX server location “/home/username/aixfix/”. For help on Filezilla and ftp refer <a href="http://www.it.cornell.edu/services/managed_servers/howto/file_transfer/filefilezilla.cfm">here</a>. Pre-requisite here is that aixfix folder already exists. If not, traverse to the path.</p><p>Command:</p><p><strong><em>cd home/&lt;username&gt;/</em></strong></p><p><strong><em>mkdir aixfix</em></strong></p><p><strong><em>ls -lrt</em></strong></p><p>Shows you the folder aixfix created.</p><p><strong>9.</strong> Now back to our AIX terminal..</p><p>Traverse to the aixfix folder from the current folder.</p><p><strong><em>cd home/&lt;username&gt;/aixfix/</em></strong></p><p><strong><em>ls -lrt</em></strong></p><p>You should be able to see all the files in the list(so many)</p><p><strong>10.</strong> command:</p><p><strong><em>inutoc .</em></strong></p><p>This command checks if the upgrade files in the current folder “.” is suitable for the OS and males a toc file(tracker) of all the upgrade files. If everything goes well then, you will not get any response, else you will get error codes which can be referred to <a href="https://www-01.ibm.com/support/knowledgecenter/ssw_aix_61/com.ibm.aix.cmds3/inutoc.htm">here</a>.</p><blockquote><strong>The upgrade begins now!</strong></blockquote><p># <strong><em>smitty update_all</em></strong></p><p>this will open up a new window of options</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1019/1*_7gJpWOgNzybHyZ66dUkCA.png" /><figcaption>Provide “.” in the entry field, since the upgrade files are in the current folder</figcaption></figure><p>Provide “.” in the entry field, since the upgrade files are in the current folder</p><blockquote>Enter..(hit hard)</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/568/1*ydZoEEZxEAHpv1WDOWx64A.png" /><figcaption>Smitty update_all option screen</figcaption></figure><p>COMMIT software updates…. YES (press tab to change)</p><p>ACCEPT new license agreements.. YES</p><p>rest of the options depends on your wish..</p><p>Now..HIT ENTER..very hard!</p><blockquote>Upgrading has begun and it goes on for at-least an hour. Just leave the system, go grab coffee and a krapfen!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DIDdZGcQSizOKZt4aaq59A.jpeg" /><figcaption>Berliner süß!! Krapfen</figcaption></figure><p>How do I know if the upgrade is done?</p><p>You will be seeing all the logs of the installed packages with more option to scroll down the page.</p><p>F10 to exit the smitty interface</p><p>Now Check the oslevel again</p><p><strong><em>oslevel -s</em></strong></p><p>Now it should show the desired and upgraded level. Obviously you have to restart the system.</p><p><strong><em>shudown -Fr</em></strong></p><p>Telnet to your AIX again and check <strong><em>oslevel.</em></strong></p><blockquote><strong><em>You are a Sysadmin now! Bye</em></strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=81930c72bdfc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>