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

<channel>
	<title></title>
	<atom:link href="https://www.sohailriaz.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sohailriaz.com</link>
	<description>Linux and Open Source Blog</description>
	<lastBuildDate>Wed, 13 Apr 2016 12:26:11 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.2</generator>

<image>
	<url>https://www.sohailriaz.com/wp-content/uploads/2024/10/cropped-logo21-32x32.png</url>
	<title></title>
	<link>https://www.sohailriaz.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Recover InnoDB tables using .frm and .ibd files</title>
		<link>https://www.sohailriaz.com/recover-innodb-tables-using-frm-and-ibd-files/</link>
					<comments>https://www.sohailriaz.com/recover-innodb-tables-using-frm-and-ibd-files/#comments</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Tue, 12 Apr 2016 16:40:56 +0000</pubDate>
				<category><![CDATA[Hosting / Servers]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming / Scripting]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=561</guid>

					<description><![CDATA[In this article I will show how to recover or restore InnoDB tables using .frm and .ibd files. MySQL server was enabled with innodb_file_per_table which]]></description>
										<content:encoded><![CDATA[<p>In this article I will show how to recover or restore InnoDB tables using .frm and .ibd files. MySQL server was enabled with innodb_file_per_table which means  it stores <code class="literal">InnoDB</code> tables data in a tbl_name.ibd and table information in tbl.name.frm. If you are using MySQL 5.6.x or higher then you are using innodb_file_per_file as a default. This method will work even you lost original ibdata1 file.<span id="more-561"></span></p>
<h3>1- Install MySQL Server and Utilities</h3>
<p>We will require MySQL Server 5.6.x or higher and mysqlfrm from utilities package which manage to extract table information and generate CREATE TABLE query from .frm file.</p>
<p>First enable oracle mysql yum repository for CentOS 7/RHEL 7. Note below rpm is the latest at the time of download, please check for latest everytime.</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">rpm -Uvh&nbsp;http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm.</pre><p>
</p></blockquote>
<p>Install require packages</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">yum -y install mysql-server mysql-utilities</pre><p>
</p></blockquote>
<h3>2- Recover.</h3>
<p>Location for my backup database were <strong>/data-backup/sohail-wp/</strong>. Now I will recover my CREATE TABLE sql queries from .frm files using mysqlfrm utility.</p>
<p><span style="color: #000000;"><strong>a) Recover CREATE TABLE query from one table.</strong></span></p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag"># mysqlfrm --server=root:root123@localhost --port=3307 --user=root /data-backup/sohail_wp/wp_users.frm

# Source on localhost: ... connected.
# Spawning server with --user=root.
# Starting the spawned server on port 3307 ... done.
# Reading .frm files
#
# Reading the wp_users.frm file.
#
# CREATE statement for wp_users.frm:
#

 CREATE TABLE `wp_users` (
 `ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
 `user_login` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
 `user_pass` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
 `user_nicename` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
 `user_email` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
 `user_url` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
 `user_registered` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
 `user_activation_key` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
 `user_status` int(11) NOT NULL DEFAULT '0',
 `display_name` varchar(250) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
 PRIMARY KEY (`ID`),
 KEY `user_login_key` (`user_login`),
 KEY `user_nicename` (`user_nicename`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

#...done.</pre><p>
</p></blockquote>
<p><span style="color: #000000;"><strong>b) Recover CREATE TABLE query from all tables.</strong></span></p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">#mysqlfrm --server=root:root123@localhost --port=3307 --user=root /data-backup/sohail-wp/ &amp;gt; /tmp/create-table.sql</pre><p>
</p></blockquote>
<p><strong><span style="color: #000000;">c) Run following command to replace empty lines with ; (simi-colons) in create-table.sql file . This is a quick and dirty method to make CREATE TABLE sql query executable on mysql prompt by importing the file otherwise you need to enter ; (semi-colon) after every CREATE TABLE sql query end one by one.</span></strong></p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">sed 's/^$/;/' /tmp/create-table.sql &amp;gt; /tmp/create-table-complete.sql</pre><p>
</p></blockquote>
<p><strong><span style="color: #000000;">d) Create database same as original, in my case it is sohail_wp</span></strong></p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">mysql&amp;gt; create database sohail_wp;
Query OK, 1 row affected (0.00 sec)</pre><p>
</p></blockquote>
<p><span style="color: #000000;"><strong>e) Re-create all tables from create-table-complete.sql files inside sohail_wp database.</strong></span></p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">mysql&amp;gt; source /tmp/create-table-complete.sql</pre><p>
</p></blockquote>
<p>The above comamnd will generate all tables inside the default location of mysql datadir i.e /var/lib/mysql/sohail-wp with names tbl_name.frm and tbl_name.ibd.</p>
<p><span style="color: #000000;"><strong>f) As they are newly created empty table, now we will discard tablespace to get import our data from old backup from tbl_name.ibd files.</strong></span></p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">mysql&amp;gt; ALTER TABLE table_name DISCARD TABLESPACE;</pre><p>
</p></blockquote>
<p>You need to run above ALTER TABLE command for each table. It can be scripted through command line.</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">#mysql -u root -p -e&quot;show tables from sohail_wp&quot; | grep -v Tables_in_sohail_wp | while read a; do mysql -u root -p -e &quot;ALTER TABLE sohail_wp.$a DISCARD TABLESPACE&quot;; done</pre><p>
</p></blockquote>
<p>The above command will delete all *.ibd files from /var/lib/mysql/sohail_wp/ directory. Which were having empty data as newly created table. We will replace them with backup.</p>
<p><span style="color: #000000;"><strong>g) Copy only *.ibd files old backup.</strong></span></p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag"># cp&nbsp;/data-backup/sohail_wp/*.ibd /var/lib/mysql/sohail_wp/</pre><p>
</p></blockquote>
<p>Here we copied all the *.ibd files from backup which contains actual table data from our old database.</p>
<p><span style="color: #000000;"><strong>h) Now its time to get import tablespace from copied *.ibd files.</strong></span></p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">mysql&amp;gt; ALTER TABLE table_name IMPORT TABLESPACE;</pre><p>
</p></blockquote>
<p>For all tables you can below script, modified as per your requirements.</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">#mysql -u root -p -e&quot;show tables from sohail_wp&quot; | grep -v Tables_in_sohail_wp | while read a; do mysql -u root -p -e &quot;ALTER TABLE sohail_wp.$a IMPORT TABLESPACE&quot;; done</pre><p>
</p></blockquote>
<p>This helps me to restore/recover my InnoDB Database. It might help others, please comment for questions.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/recover-innodb-tables-using-frm-and-ibd-files/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Auto-Reply for Exim Mail Server</title>
		<link>https://www.sohailriaz.com/auto-reply-for-exim-mail-server/</link>
					<comments>https://www.sohailriaz.com/auto-reply-for-exim-mail-server/#comments</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Tue, 29 Mar 2016 07:25:08 +0000</pubDate>
				<category><![CDATA[Hosting / Servers]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=553</guid>

					<description><![CDATA[Exim mail server have auto-reply or vacation autoresponder feature missing in default configuration.  It can be easily achieved by providing right Router and Transport configuration using]]></description>
										<content:encoded><![CDATA[<p>Exim mail server have auto-reply or vacation autoresponder feature missing in default configuration.  It can be easily achieved by providing right Router and Transport configuration using Exim configuration.</p>
<p>Our setup contains exim + dovecot running imap on CPanel/WHM dedicated server. Dovecot imap using maildir format and default location for storing mail is /home/vmail/$domain/$user.<span id="more-553"></span></p>
<h3>1- Exim Router Configuration.</h3>
<p>Following lines should be inserted in Router configuration area inside /etc/exim/exim.conf</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">######################################################################
#                  ROUTERS CONFIGURATION                             #
#
#..
# This router delivers an auto-reply &quot;vacation&quot; message if a file called 'vaction.msg'
# exists in the home directory.

uservacation:
  driver = redirect
  domains = +local_domains
  allow_filter
  user = vmail
  group = vmail
  file = /home/vmail/${domain}/${local_part}/.vacation.msg
  require_files = /home/vmail/${domain}/${local_part}/.vacation.msg
  # do not reply to errors or lists
  condition = ${if or { \
  {match {$h_precedence:} {(?i)junk|bulk|list}} \
  {eq {$sender_address} {}} \
  } {no} {yes}}
  # do not reply to errors or bounces or lists
  senders = ! ^.*-request@.*:\
  ! ^bounce-.*@.*:\
  ! ^.*-bounce@.*:\
  ! ^owner-.*@.*:\
  ! ^postmaster@.*:\
  ! ^webmaster@.*:\
  ! ^listmaster@.*:\
  ! ^mailer-daemon@.*:\
  ! ^root@.*
  no_expn
  reply_transport = uservacation_transport
  unseen
  no_verify</pre><p>
</p></blockquote>
<p>Above configuration will instruct exim to route any message if you found .vacation.msg file in the home maildir of user. You can edit the maildir location to match yours user maildir.</p>
<h3>2- Exim Transport Configuration</h3>
<p>Following lines should be inserted in Transport configuration area inside /etc/exim/exim.conf</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">######################################################################
#                TRANSPORTS CONFIGURATION                            #
#...
uservacation_transport:
  driver = autoreply
  user = vmail
  group = vmail
  file = /home/vmail/${domain}/${local_part}^/.vacation.msg
  file_expand
  once = /home/vmail/${domain}/${local_part}^/.vacation.db
  # to use a flat file instead of a db specify once_file_size
  #once_file_size = 2K
  once_repeat = 14d
  from = ${local_part}@${domain}
  to = ${sender_address}
  subject = &quot;Re: $h_subject&quot;</pre><p>
</p></blockquote>
<p>.vacation.db will save all the mail addresses to whom it auto-replied the messages. You can edit the maildir location to match yours user maildir.</p>
<h3>3- Maildir Vacation files</h3>
<p>Following files inside your maildir needs to be there to send reply back to the sender. In my situation is /home/vmail/$domain/$user/</p>
<p>.vacation.msg</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag"># Exim filter
if ($h_subject: does not contain &quot;SPAM?&quot; and personal) then
mail
##### This is the only thing that a user can set when they #####
##### decide to enable vacation messaging. The vacation.msg.txt #####
expand file /home/vmail/${domain}/${local_part}/.vacation.msg.txt
log /home/vmail/${domain}/${local_part}/.vacation.log
to $reply_address
from $local_part\@$domain
subject &quot;Unmonitored Mailbox [Re: $h_subject:]&quot;
endif</pre><p>
</p></blockquote>
<p>.vacation.msg.txt</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">Hi,

This is test reply.

Regards,</pre><p>
</p></blockquote>
<p>These two files in any user maildir will makes it auto-reply.</p>
<p>Please use comments for any questions.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/auto-reply-for-exim-mail-server/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Update Cobbler Signature File</title>
		<link>https://www.sohailriaz.com/update-cobbler-signature-file/</link>
					<comments>https://www.sohailriaz.com/update-cobbler-signature-file/#comments</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Sun, 25 Oct 2015 07:34:33 +0000</pubDate>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=513</guid>

					<description><![CDATA[One of our cluster running cobbler provisioning software required to install several nodes with RHEL 7.1. When I tried to upload an ISO image of]]></description>
										<content:encoded><![CDATA[<p>One of our cluster running cobbler provisioning software required to install several nodes with RHEL 7.1. When I tried to upload an ISO image of RHEL 7.1 to the cobbler, it stops and shows an error that RHEL 7.1 is not available in signatures. Signatures defines which OS cobbler can support for provisioning. By running following command you can list available signatures available for your cobbler installation.<span id="more-513"></span></p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">sudo cobbler signature report
Currently loaded signatures:
 debian:
    squeeze
 freebsd:
    8.2
    8.3
    9.0
 generic:
    (none)
 redhat:
    fedora16
    fedora17
    fedora18
    rhel4
    rhel5
    rhel6
 suse:
    opensuse11.2
    opensuse11.3
    opensuse11.4
    opensuse12.1
    opensuse12.2
 ubuntu:
    oneiric
    precise
    quantal
 unix:
    (none)
 vmware:
    esx4
    esxi4
    esxi5
 windows:
    (none)

9 breeds with 21 total signatures loaded</pre><p></p><pre class="urvanov-syntax-highlighter-plain-tag">sudo cobbler signature report --name=redhat
Currently loaded signatures:
 redhat:
    fedora16
    fedora17
    fedora18
    rhel4
    rhel5
    rhel6

Breed 'redhat' has 3 total signatures</pre><p>
</p></blockquote>
<p>If your cluster is connected to internet, you can update signatures files straight away using following command, it will update it with latest</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">sudo cobbler signature update
 task started: 2015-10-21_222926_sigupdate
 task started (id=Updating Signatures, time=Wed Oct 21 22:29:26 2015)
 Successfully got file from http://cobbler.github.com/signatures/latest.json
 *** TASK COMPLETE ***</pre><p>
</p></blockquote>
<p>But like me if your cluster is not connected to internet directly then you will required to download latest signatures files from following website and upload to proper location. Following steps should be follow to do it</p>
<h3>1 .Download Signature file</h3>
<p>Download signature file on your workstation</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">wget&nbsp;http://cobbler.github.com/signatures/latest.json</pre><p>
</p></blockquote>
<h3>2. Upload to cluster</h3>
<p>Upload the signature to the cobbler management server</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">scp latest.json /var/lib/cobbler/distro_signatures.json</pre><p>
</p></blockquote>
<h3>3. Restart Service</h3>
<p>Restart the cobbler service to take effect.</p>
<blockquote><p>
</p><pre class="urvanov-syntax-highlighter-plain-tag">sudo /etc/init.d/cobblerd restart</pre><p></p><pre class="urvanov-syntax-highlighter-plain-tag">sudo cobbler signature report --name=redhat
Currently loaded signatures:
 redhat:
    cloudlinux6
    fedora16
    fedora17
    fedora18
    fedora19
    fedora20
    fedora21
    fedora22
    fedora23
    rhel4
    rhel5
    rhel6
    rhel7 

Breed 'redgat' has 3 total signatures</pre><p>
</p></blockquote>
<p>RHEL 7 version are available and you can go with your install.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/update-cobbler-signature-file/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>HowTo Edit Initrd.img in RHEL/CentOS 6.x</title>
		<link>https://www.sohailriaz.com/howto-edit-initrd-img-in-rhelcentos-6-x/</link>
					<comments>https://www.sohailriaz.com/howto-edit-initrd-img-in-rhelcentos-6-x/#comments</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Thu, 16 Apr 2015 07:40:36 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=501</guid>

					<description><![CDATA[In this howto I will describe how to edit initrd.img from iso file to add new drivers in RHEL 6.x. We face an issue to]]></description>
										<content:encoded><![CDATA[<p>In this howto I will describe how to edit initrd.img from iso file to add new drivers in RHEL 6.x. We face an issue to add 40G t4_tom chelsio card driver inside initrd.img to start kickstart installation from Network. The initrd.img comes with RHEL 6.x ISO doesn&#8217;t contain this driver and hence we were unable to start kickstart installation from network. Chelsio provided DriverDisk but it doesn&#8217;t work because it require to provide it using any dvd or usb drive, which is impossible if you installing large number of nodes and away from your DataCenter. This method can work for any add/edit initrd.img file. For my work I used RHEL 6.5. Before doing it you should have one server running with RHEL 6.5 and updated driver.<span id="more-501"></span></p>
<h3>1. Get Initrd.img from ISO</h3>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">mkdir /mnt/{image,work}
mount -o loop RHEL6.5-server.x86_64.iso /mnt/image/
cp /mnt/image/isolinux/initrd.img /mnt/work</pre><p></p>
<h3> 2. Extract Initrd.img</h3>
<p>Before extract rename initrd.img to initrd.img.xz because its compressed with xz and will remove its extension and rename again with initrd.img</p><pre class="urvanov-syntax-highlighter-plain-tag">cd /mnt/work
mkdir initrd-new
mv initrd.img initrd.img.xz
xz --format=lzma initrd.img.xz –decompress
cd initrd-new
cpio -ivdum &lt; ../initrd.img</pre><p></p>
<h3> 3. Copy Required Driver</h3>
<p>I will used already installed chelsio driver from chelsio script. We were using same directory tree,</p><pre class="urvanov-syntax-highlighter-plain-tag">cp  /lib/modules/2.6.32.431.el6.x86_64/updates/drivers/ /mnt/work/initrd-new/modules/2.6.32.431.el6.x86_64/updates/</pre><p></p>
<h3> <span style="font-size: 1.17em;">4. Update driver information from modules.* to initrd.img modules.* files.</span></h3>
<p>I will used chelsio driver information here and it can be different for you. You need to confirm which hardware driver you will used to insert in initrd.img and its information from modules.* files.</p><pre class="urvanov-syntax-highlighter-plain-tag">cd /lib/modules/2.6.32.431.el6.x86_64/
egrep 'cxgb4|toecore|t4_tom' modules.symbols &amp;nbsp;&gt;&gt; /mnt/work/initrd-new/modules/2.6.32-431.el6.x86_64/modules.symbols
egrep 'cxgb4|toecore|t4_tom' modules.alias &gt;&gt; /mnt/work/initrd-new/modules/2.6.32-431.el6.x86_64/modules.alias
egrep 'cxgb4|toecore|t4_tom' modules.dep &gt;&gt; /mnt/work/initrd-new/modules/2.6.32-431.el6.x86_64/modules.dep</pre><p></p>
<h3><span style="font-size: 1.17em;">5. Generate modules.*.bin files inside initrd.img</span></h3>
<p>This will recreate all modules.*.bin files using required driver information using modules.* files. This required because without this initrd.img will unable to load newly inserted driver.</p><pre class="urvanov-syntax-highlighter-plain-tag">chroot /mnt/work/initrd-new
depmod -a -v
exit</pre><p></p>
<h3> 6. Generate updated Initrd.img</h3>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">cd /mnt/work/initrd-new
find . -print |cpio -o -H newc | xz --format=lzma &gt; ../initrd.img</pre><p>Your initrd.img is ready and you can used this new initrd.img to replaced stock initrd.img to start kickstart installation or network boot.</p>
<p>If you have any question please use comments.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/howto-edit-initrd-img-in-rhelcentos-6-x/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Bridged Networking with KVM in CentOS/RHEL 6.x</title>
		<link>https://www.sohailriaz.com/bridged-networking-with-kvm-in-centosrhel-6-x/</link>
					<comments>https://www.sohailriaz.com/bridged-networking-with-kvm-in-centosrhel-6-x/#respond</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Fri, 13 Jun 2014 05:38:09 +0000</pubDate>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=495</guid>

					<description><![CDATA[In this howto we will setup bridged networking to dedicate physical network device to KVM virtual machines/servers. Its best way to have local network between]]></description>
										<content:encoded><![CDATA[<p>In this howto we will setup bridged networking to dedicate physical network device to KVM virtual machines/servers. Its best way to have local network between virtual machines  and provide better performance.<span id="more-495"></span></p>
<h3>1. Create a Bridge</h3>
<p>Before it was all manual to create bridge device but now KVM provide single command to do all. To create a bridge (br0) using eth0, you need to execute following command</p><pre class="urvanov-syntax-highlighter-plain-tag">virsh iface-bridge eth0 br0</pre><p>This will create bridge (br0) device file in /etc/sysconfig/network-scripts/ and take all settings from eth0 to configure itself with configure eth0 to use br0.</p>
<h3>2. Stop NetworkManager</h3>
<p>You will also need to do following in all ifcfg-* file in /etc/sysconfig/network-scripts/ to disable NetworkManager. Edit all files and make sure to have following value</p>
<p><strong><code>NM_CONTROLLED=no</code></strong></p>
<p>After this stop NetworkManager and start network service to start bridge at startup.</p><pre class="urvanov-syntax-highlighter-plain-tag">chkconfig NetworkManager off
chkconfig network on
service NetworkManager stop
service network start</pre><p>You can now create or edit your virtual machine to use bridge network device (br0).</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/bridged-networking-with-kvm-in-centosrhel-6-x/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>GlusterFS HowTo on CentOS 6.x</title>
		<link>https://www.sohailriaz.com/glusterfs-howto-on-centos-6-x/</link>
					<comments>https://www.sohailriaz.com/glusterfs-howto-on-centos-6-x/#comments</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Sat, 25 May 2013 12:38:10 +0000</pubDate>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=489</guid>

					<description><![CDATA[In this howto we will describe in detail how to install / configure GlusterFS 3.3.1 (latest stable) on CentOS 6.3. GlusterFS is an open source,]]></description>
										<content:encoded><![CDATA[<p>In this howto we will describe in detail how to install / configure GlusterFS 3.3.1 (latest stable) on CentOS 6.3.</p>
<p>GlusterFS is an open source, powerful clustered file system capable of scaling to several petabytes of storage which is available to user under a single mount point. It uses already available disk filesystems like ext3, ext4, xfs etc to store data and client will able to access the storage as local filesystem. GlusterFS cluster aggregates storage blocks over Infiniband RDMA and/or TCP/IP interconnect in a single global namespace.<span id="more-489"></span></p>
<p>We will discuss following terms later on in this howto, so it require you to understand them before proceed.</p>
<dl>
<dt><strong>brick</strong></dt>
<dd>The brick is the storage filesystem that has been assigned to a volume. e.g /data on server</dd>
<dt><strong>client</strong></dt>
<dd>The machine which mounts the volume (this may also be a server).</dd>
<dt><strong>server</strong></dt>
<dd>The machine (physical or virtual or bare metal) which hosts the actual filesystem in which data will be stored.</dd>
<dt><strong>volume</strong></dt>
<dd>A volume is a logical collection of bricks where each brick is an export directory on a server . A volume can be of several types and you can create any of them in storage pool for a single volume.</dd>
<dd><em><strong>Distributed</strong></em> &#8211; Distributed volumes distributes files throughout the bricks in the volume. You can use distributed volumes where the requirement is to scale storage and the redundancy is either not important or is provided by other hardware/software layers.</dd>
<dd><em><strong>Replicated</strong></em> – Replicated volumes replicates files across bricks in the volume. You can use replicated volumes in environments where high-availability and high-reliability are critical.</dd>
<dd><em><strong>Striped</strong></em> – Striped volumes stripes data across bricks in the volume. For best results, you should use striped volumes only in high concurrency environments accessing very large files.</dd>
<dd></dd>
</dl>
<h3>1. Setup</h3>
<p><strong><span style="text-decoration: underline;">Hardware</span></strong></p>
<p>I will use three servers and one client for my GlusterFS installation/configuration. These can be a physical machines or virtual machines. I will be using my virtual environment for this and IP/hostname will be as follow.</p><pre class="urvanov-syntax-highlighter-plain-tag">host1.example.com 192.168.0.101
host2.example.com 192.168.0.102
host3.example.com 192.168.0.103
client1.example.com 192.168.0.1</pre><p>Two partition require on each server because 1 will be using for OS install and 2nd will be using for our storage.</p>
<p><strong><span style="text-decoration: underline;">Software</span></strong></p>
<p>For OS I will be using CentOS 6.3 and GlusterFS 3.3.1. In EPEL repository 3.2.7 is available but we will go with latest version i.e 3.3.1. This is available through GlusterFS own repository.</p>
<h3>2. Installation</h3>
<p>First we will add GlusterFS repo in our yum repositories. To do this execute following command.</p><pre class="urvanov-syntax-highlighter-plain-tag">wget -P /etc/yum.repos.d http://download.gluster.org/pub/gluster/glusterfs/LATEST/EPEL.repo/glusterfs-epel.repo</pre><p></p>
<h3> 2.1 Installation on Servers:</h3>
<p>On Servers (host1, host2, host3) execute following command to install glusterfs server side packages.</p><pre class="urvanov-syntax-highlighter-plain-tag">yum -y install glusterfs glusterfs-fuse glusterfs-server</pre><p>Start glusterfs services on all servers with enable them to start automatically on startup.</p><pre class="urvanov-syntax-highlighter-plain-tag">/etc/init.d/glusterd start
chkconfig glusterfsd on</pre><p></p>
<h3> 2.2 Installation on Client:</h3>
<p>On Client execute following command to install clusterfs client side packages.</p><pre class="urvanov-syntax-highlighter-plain-tag">yum -y install glusterfs glusterfs-fuse</pre><p>This we will later on use to mount the glusterfs on client.</p>
<h3> 3. Creating Trusted Storage Pool.</h3>
<p>Trusted storage pool are the servers which are running as gluster servers and will provide bricks for volumes. You will need to probe all servers to server1 (dont probe server1 or localhost).</p>
<p>Note: turn off your firewall using iptables -F command.</p>
<p>We will now create all three servers in a trusted storage pool and probing will be done on server1.</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster peer probe host2
Probe successful

gluster peer probe host3
Probe successful</pre><p>Confirm your server status.</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster peer status
Number of Peers: 2

Hostname: host2
Uuid: b65874ab-4d06-4a0d-bd84-055ff6484efd
State: Peer in Cluster (Connected)

Hostname: host3
Uuid: 182e3214-44a2-46b3-ae79-769af40ec160
State: Peer in Cluster (Connected)</pre><p></p>
<h3>4. Creating Glusterfs Server Volume</h3>
<p>Now its time to create glusterfs server volume. A volume is a logical collection of bricks where each brick is an export directory on a server in the trusted storage pool.</p>
<p>Glusterfs gives many types in storage to create the volumes within: I will demonstrate three of them defined above and it will gives you enough knowledge to create remaining by yourself.</p>
<h3>4.1 Distributed</h3>
<p>Use distributed volumes where you need to scale storage because in a distributed volumes files are spread randomly across the bricks in the volume.</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume create dist-volume host1:/dist1 host2:/dist2 host3:/dist3
Creation of volume dist-volume has been successful. Please start the volume to access data.</pre><p>Start the dist-volume</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume start dist-volume
Starting volume dist-volume has been successful</pre><p>Check status of volume</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume info

Volume Name: dist-volume
Type: Distribute
Volume ID: b842b03f-f8db-47e9-920a-a04c2fb24458
Status: Started
Number of Bricks: 3
Transport-type: tcp
Bricks:
Brick1: host1:/dist1
Brick2: host2:/dist2
Brick3: host3:/dist3</pre><p></p>
<h3> 4.1.1 Accessing Distributed volume and testing.</h3>
<p>Now on client1.example.com we will access and test distributed volume functionality. To mount gluster volumes to access data, first we will mount it manually then add in /etc/fstab to mount it automatically whenever server restart.</p>
<p>Use mount command to access gluster volume.</p><pre class="urvanov-syntax-highlighter-plain-tag">mkdir /mnt/distributed
mount.glusterfs host1.sohailriaz.com:/dist-volume /mnt/distributed/</pre><p>Check it using mount command.</p><pre class="urvanov-syntax-highlighter-plain-tag">mount
/dev/sda on / type ext4 (rw,errors=remount-ro)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
host1.sohailriaz.com:/dist-volume on /mnt/distributed type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)</pre><p>Now add following line at the end of /etc/fstab file to make it available to server on every reboot.</p><pre class="urvanov-syntax-highlighter-plain-tag">host1.example.com:/dist-volume /mnt/distributed glusterfs defaults,_netdev 0 0</pre><p>save the file.</p>
<p>Now to test create following files in the mounted directory.</p><pre class="urvanov-syntax-highlighter-plain-tag">touch /mnt/distributed/file1
touch /mnt/distributed/file2
touch /mnt/distributed/file3
touch /mnt/distributed/file4
touch /mnt/distributed/file5
touch /mnt/distributed/file6
touch /mnt/distributed/file7
touch /mnt/distributed/file8</pre><p>Check on the servers for distributed functionality</p><pre class="urvanov-syntax-highlighter-plain-tag">[root@host1 ~]# ls -l /dist1
total 0
-rw-r--r-- 2 root root 0 May 9 10:50 file5
-rw-r--r-- 2 root root 0 May 9 10:51 file6
-rw-r--r-- 2 root root 0 May 9 10:51 file8

[root@host2 ~]# ls -l /dist2
total 0
-rw-r--r-- 2 root root 0 May 9 10:50 file3
-rw-r--r-- 2 root root 0 May 9 10:50 file4
-rw-r--r-- 2 root root 0 May 9 10:51 file7

[root@host3 ~]# ls -l /dist3
total 0
-rw-r--r-- 2 root root 0 May 9 10:50 file1
-rw-r--r-- 2 root root 0 May 9 10:50 file2</pre><p>All of the files created in mounted volume are distributed to all the servers.</p>
<h3>4.2 Replicated</h3>
<p>Use replicated volumes in storage where high-availability and high-reliability are critical because replicated volumes create same copies of files across multiple bricks in the volume.</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume create rep-volume replica 3 host1:/rep1 host2:/rep2 host3:/rep3
Creation of volume rep-volume has been successful. Please start the volume to access data.</pre><p>Where replica 3 is a value to create number of copies on multiple servers, so here we need same copy on all servers.</p>
<p>Start the dist-volume</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume start rep-volume
Starting volume rep-volume has been successful</pre><p>Check status of volume</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume info rep-volume

Volume Name: rep-volume
Type: Replicate
Volume ID: 0dcf51bc-376a-4bd2-8759-3d47bba49c3d
Status: Started
Number of Bricks: 1 x 3 = 3
Transport-type: tcp
Bricks:
Brick1: host1:/rep1
Brick2: host2:/rep2
Brick3: host3:/rep3</pre><p></p>
<h3>4.2.1 Accessing Replicated Volume and tests.</h3>
<p>Now same as distributed volume access using mount command. To mount gluster replicated volumes to access data, first we will mount it manually then add in /etc/fstab to mount it automatically whenever server restart.</p>
<p>Use mount command to access gluster volume.</p><pre class="urvanov-syntax-highlighter-plain-tag">mkdir /mnt/replicated
mount.glusterfs host1.sohailriaz.com:/rep-volume /mnt/replicated/</pre><p>Check it using mount command.</p><pre class="urvanov-syntax-highlighter-plain-tag">mount
/dev/sda on / type ext4 (rw,errors=remount-ro)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
host1.sohailriaz.com:/dist-volume on /mnt/distributed type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)
host1.sohailriaz.com:/rep-volume on /mnt/replicated type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)</pre><p>Now add following line at the end of /etc/fstab file to make it available to server on every reboot.</p><pre class="urvanov-syntax-highlighter-plain-tag">host1.example.com:/rep-volume /mnt/replicated glusterfs defaults,_netdev 0 0</pre><p>Now to test create following files in the mounted directory.</p><pre class="urvanov-syntax-highlighter-plain-tag">touch /mnt/replicated/file1
touch /mnt/replicated/file2
touch /mnt/replicated/file3
touch /mnt/replicated/file4
touch /mnt/replicated/file5
touch /mnt/replicated/file6
touch /mnt/replicated/file7
touch /mnt/replicated/file8</pre><p>Check on the servers for replicated functionality</p><pre class="urvanov-syntax-highlighter-plain-tag">[root@host1 ~]# ls -l /rep1
total 0
-rw-r--r-- 2 root root 0 May 9 11:16 file1
-rw-r--r-- 2 root root 0 May 9 11:16 file2
-rw-r--r-- 2 root root 0 May 9 11:16 file3
-rw-r--r-- 2 root root 0 May 9 11:16 file4
-rw-r--r-- 2 root root 0 May 9 11:16 file5
-rw-r--r-- 2 root root 0 May 9 11:16 file6
-rw-r--r-- 2 root root 0 May 9 11:16 file7
-rw-r--r-- 2 root root 0 May 9 11:16 file8

[root@host2 ~]# ls -l /rep2
total 0
-rw-r--r-- 2 root root 0 May 9 11:16 file1
-rw-r--r-- 2 root root 0 May 9 11:16 file2
-rw-r--r-- 2 root root 0 May 9 11:16 file3
-rw-r--r-- 2 root root 0 May 9 11:16 file4
-rw-r--r-- 2 root root 0 May 9 11:16 file5
-rw-r--r-- 2 root root 0 May 9 11:16 file6
-rw-r--r-- 2 root root 0 May 9 11:16 file7
-rw-r--r-- 2 root root 0 May 9 11:16 file8

[root@host3 ~]# ls -l /rep3
total 0
-rw-r--r-- 2 root root 0 May 9 11:16 file1
-rw-r--r-- 2 root root 0 May 9 11:16 file2
-rw-r--r-- 2 root root 0 May 9 11:16 file3
-rw-r--r-- 2 root root 0 May 9 11:16 file4
-rw-r--r-- 2 root root 0 May 9 11:16 file5
-rw-r--r-- 2 root root 0 May 9 11:16 file6
-rw-r--r-- 2 root root 0 May 9 11:16 file7
-rw-r--r-- 2 root root 0 May 9 11:16 file8</pre><p>All of the files created in mounted volume are replicated to all the servers.</p>
<h3>4.3 Stripped</h3>
<p>Use striped volumes only in high concurrency environments accessing very large files because striped volumes stripes data across bricks in the volume.</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume create strip-volume strip 3 host1:/strip1 host2:/strip2 host3:/strip3
Creation of volume strip-volume has been successful. Please start the volume to access data.</pre><p>Start the dist-volume</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume start strip-volume
Starting volume strip-volume has been successful</pre><p>Check status of volume</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume info strip-volume

Volume Name: strip-volume
Type: Stripe
Volume ID: 2b21ad4b-d464-408b-82e8-df762ef89bcf
Status: Started
Number of Bricks: 1 x 3 = 3
Transport-type: tcp
Bricks:
Brick1: host1:/strip1
Brick2: host2:/strip2
Brick3: host3:/strip3</pre><p></p>
<h3>4.3.1 Accessing Stripped Volume and tests.</h3>
<p>Now same as distributed and replicated volume access stripped volume using mount command. To mount gluster stripped volumes to access data, first we will mount it manually then add in /etc/fstab to mount it automatically whenever server restart.</p>
<p>Use mount command to access gluster volume.</p><pre class="urvanov-syntax-highlighter-plain-tag">mkdir /mnt/stripped
mount.glusterfs host1.sohailriaz.com:/strip-volume /mnt/stripped/</pre><p>Check it using mount command.</p><pre class="urvanov-syntax-highlighter-plain-tag">mount
/dev/sda on / type ext4 (rw,errors=remount-ro)
none on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
host1.sohailriaz.com:/dist-volume on /mnt/distributed type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)
host1.sohailriaz.com:/rep-volume on /mnt/replicated type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)
host1.sohailriaz.com:/strip-volume on /mnt/stripped type fuse.glusterfs (rw,default_permissions,allow_other,max_read=131072)</pre><p>Now add following line at the end of /etc/fstab file to make it available to server on every reboot.</p><pre class="urvanov-syntax-highlighter-plain-tag">host1.example.com:/strip-volume /mnt/stripped glusterfs defaults,_netdev 0 0</pre><p>Save the file.</p>
<p>Now to test create following large file in the mounted directory on client1.</p><pre class="urvanov-syntax-highlighter-plain-tag">dd if=/dev/zero of=/mnt/stripped/file.img bs=1024k count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 61.5011 s, 17.0 MB/s</pre><p></p><pre class="urvanov-syntax-highlighter-plain-tag">ls -l /mnt/stripped/
total 1024120
-rw-r--r-- 1 root root 1048576000 May 9 11:31 file.img</pre><p>Check on the servers for stripped functionality</p><pre class="urvanov-syntax-highlighter-plain-tag">[root@host1 ~]# ls -l /strip1/
total 341416
-rw-r--r-- 2 root root 1048444928 May 9 11:31 file.img

[root@host2 ~]# ls -l /strip2/
total 341416
-rw-r--r-- 2 root root 1048576000 May 9 11:31 file.img

[root@host3 ~]# ls -l /strip3/
total 341288
-rw-r--r-- 2 root root 1048313856 May 9 11:31 file.img</pre><p>The large file is stripped across volume successfully.</p>
<h3>5. Managing Gluster Volumes.</h3>
<p>Now we will see some of the common operations/maintenance you might do on gluster volumes.</p>
<h3>5.1 Expanding Volumes.</h3>
<p>As per need we can add volume to already online volumes. Here for example we will going to add new brick to our distributed volume. To do this task we will need to do following:</p>
<p>First probe a new server which will offer new brick to our volume. This has to be done on host1</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster peer probe host4
Probe successful</pre><p>Now add the new brick from new probed host4.</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume add-brick dist-volume host4:/dist4
Add Brick successful</pre><p>Check the volume information using the following command.</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume info

Volume Name: dist-volume
Type: Distribute
Volume ID: b842b03f-f8db-47e9-920a-a04c2fb24458
Status: Started
Number of Bricks: 4
Transport-type: tcp
Bricks:
Brick1: host1:/dist1
Brick2: host2:/dist2
Brick3: host3:/dist3
Brick4: host4:/dist4</pre><p></p>
<h4>5.2 Shrinking Volume</h4>
<p>As needed you can shrink volumes even the gluster fs is online and available. Due to some hardware failure or network unreachable one of your brick is unable in volume, you need to remove it then first start the process of removing,</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume remove-brick dist-volume host2:/dist2 start
Remove Brick start successful</pre><p>Check the status should be completed.</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume remove-brick dist-volume host2:/dist2 status

Node      Rebalanced-files size        scanned     failures    status
--------- -----------      ----------- ----------- ----------- ------------
localhost 0                0Bytes      0           0           not started
host3     0                0Bytes      0           0           not started
host2     0                0Bytes      4           0           completed</pre><p>commit the removing brick operation</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume remove-brick dist-volume host2:/dist2 commit
Removing brick(s) can result in data loss. Do you want to Continue? (y/n) y
Remove Brick commit successful</pre><p>Check the volume information for confirmation.</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume info dist-volume

Volume Name: dist-volume
Type: Distribute
Volume ID: b842b03f-f8db-47e9-920a-a04c2fb24458
Status: Started
Number of Bricks: 2
Transport-type: tcp
Bricks:
Brick1: host1:/dist1
Brick2: host3:/dist3</pre><p></p>
<h3>5.3 Rebalancing Volume</h3>
<p>Rebalancing need to be done after expanding or shrinking the volume, this will rebalance the data amount other servers. To do this you need to issue following command</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume rebalance dist-volume start
Starting rebalance on volume dist-volume has been successful</pre><p></p>
<h3>5.4 Stopping the Volume.</h3>
<p>To stop a volume</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume stop dist-volume
Stopping volume will make its data inaccessible. Do you want to continue? (y/n) y
Stopping volume dist-volume has been successful</pre><p>To delete a volume</p><pre class="urvanov-syntax-highlighter-plain-tag">gluster volume delete dist-volume
Deleting volume will erase all information about the volume. Do you want to continue? (y/n) y
Deleting volume dist-volume has been successful</pre><p>Be remember to unmount the mounted directory on your clients.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/glusterfs-howto-on-centos-6-x/feed/</wfw:commentRss>
			<slash:comments>14</slash:comments>
		
		
			</item>
		<item>
		<title>How To Enable SSH Key Based Authentication on Dell CMC IDRAC</title>
		<link>https://www.sohailriaz.com/how-to-enable-ssh-key-based-authentication-on-dell-cmc-idrac/</link>
					<comments>https://www.sohailriaz.com/how-to-enable-ssh-key-based-authentication-on-dell-cmc-idrac/#respond</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Sat, 25 May 2013 11:42:45 +0000</pubDate>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=484</guid>

					<description><![CDATA[In this howto I will describe how you can enable ssh key based authentication on Dell Blades CMC IDRAC. This will help to manage large]]></description>
										<content:encoded><![CDATA[<p dir="ltr">In this howto I will describe how you can enable ssh key based authentication on Dell Blades CMC IDRAC. This will help to manage large number of Dell Blades CMC’s in Datacenter specially in Cluster Environment. You might be using root/calvin or your defined user/pass to login in CMC for management work using web or ssh but to access Dell CMC on ssh key based authentication (password less), you need to use only service account. Dell CMC has limitation, you can only use svcacct (user=service) for ssh key based authentication.<span id="more-484"></span></p>
<h3>1) Setup SSH Key on Linux</h3>
<p dir="ltr">First you need to create an ssh key for your user</p>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">ssh-keygen -t dsa -b 1024</pre><p>-t it can be either dsa or rsa, passphrase is optional, its depends on you whether you give or not. I will choose no passphrase.</p>
<p>Confirm you have generated the public key.</p><pre class="urvanov-syntax-highlighter-plain-tag">ls ~/.ssh/
id_dsa   id_dsa.pub</pre><p>where id_dsa is your private key and id_dsa.pub is your public key. You will need public key to upload to Dell CMC.</p>
<h3 dir="ltr">2) Managing SSH Public Key on CMC using RACADM</h3>
<p dir="ltr">Fist assure you have install latest version of racadm package on your machine to do the task. The user for ssh key based authentication on CMC should be svcacct (service), others will not work.</p>
<p dir="ltr">Check before upload your ssh key to Dell CMC that it has no other keys already define, you can have 6 different keys at one time for svcacct.</p>
<p>To view all keys on your CMC</p><pre class="urvanov-syntax-highlighter-plain-tag">racadm -r dell-cmc1 -u root -p calvin sshpkauth –i svcacct –k all –v
Key 1=UNDEFINED
Key 2=UNDEFINED
Key 3=UNDEFINED
Key 4=UNDEFINED
Key 5=UNDEFINED
Key 6=UNDEFINED
Privilege 1=0x0
Privilege 2=0x0
Privilege 3=0x0
Privilege 4=0x0
Privilege 5=0x0
Privilege 6=0x0</pre><p>To view only key at a time, replace all with number (1 &#8211; 6) using -k switch,</p><pre class="urvanov-syntax-highlighter-plain-tag">racadm -r dell-cmc1 -u root -p calvin sshpkauth -i svacct -k 1 -v
Key=UNDEFINED
Privilege=0x0</pre><p>To add a Public Key use follwing command</p><pre class="urvanov-syntax-highlighter-plain-tag">racadm -r dell-cmc1 -u root -p calvin sshpkauth –i svcacct –k 1 –p 0xfff –f ~/.ssh/id_dsa.pub
PK SSH Authentication Key file successfully uploaded to the RAC</pre><p>where p is for privilege (here we are giving full) and -f for the ssh public key file.</p>
<p>You can also add public key using key text instead of file</p><pre class="urvanov-syntax-highlighter-plain-tag">racadm -r dell-cmc1 -u root -p calvin sshpkauth –i svcacct –k 1 –p 0xfff –t "ssh-dss AAAAB3NzaC1kc3MAAACBAKnPsk+000MqdXpZdq0jPiMD1g5/Y5RRXcalAeantBs5HPoWUhLW10P0LH3lpZRs6niQ33C3mYPw2E40pGMC280CH0ChHZ/eU4z5RJfRZGSfvS+uB17rxJfV0rJYGX9mZl6xTY8Y8XaENW3db5uWsAm/BnopNmsrZrFwTvhK1tOLAAAAFQDCTSvMnmAWVwCEUgqesjs/35v7vwAAAIBKYv47cxWcN3i8XIWPrVs1B/1cAZcHV7X5D6m2ZHYVP/lzIl2JRWKspZT6EO/PWMaoxISsOdu0htj9yVVh/1BkQ90J7DJCtxSL6SN4arsfgrdkuC5ILkktYCERD/0LOOaIVns3f/yTHXd13lQufRziXJPw5YQhuqFMCJiXCJ9G9wAAAIBQYPiujpAEXgt5nkGBkYBp15BhhkSDIpvwhJPa3kzDixLKDr0tCdADCP+soV6ADZAmNWzlMn1Tswp51IswsyfyemrzNGubOAvHCFxCs/Z4mfeTkjbwpLf+Zpy2C7qBketOAkOFD/aP1Wm4GH62KKg/PXPqgDn3zla1ulf0fk2Vew== root@server1”
PK SSH Authentication Key file successfully uploaded to the RAC</pre><p>Reconfirm the public key has added using following command,</p><pre class="urvanov-syntax-highlighter-plain-tag">racadm -r dell-cmc1 -u root -p calvin sshpkauth -i svacct -k 1 -v
Key=ssh-dss AAAAB3NzaC1kc3MAAACBAKnPsk+000MqdXpZdq0jPiMD1g5/Y5RRXcalAeantBs5HPoWUhLW10P0LH3lpZRs6niQ33C3mYPw2E40pGMC280CH0ChHZ/eU4z5RJfRZGSfvS+uB17rxJfV0rJYGX9mZl6xTY8Y8XaENW3db5uWsAm/BnopNmsrZrFwTvhK1tOLAAAAFQDCTSvMnmAWVwCEUgqesjs/35v7vwAAAIBKYv47cxWcN3i8XIWPrVs1B/1cAZcHV7X5D6m2ZHYVP/lzIl2JRWKspZT6EO/PWMaoxISsOdu0htj9yVVh/1BkQ90J7DJCtxSL6SN4arsfgrdkuC5ILkktYCERD/0LOOaIVns3f/yTHXd13lQufRziXJPw5YQhuqFMCJiXCJ9G9wAAAIBQYPiujpAEXgt5nkGBkYBp15BhhkSDIpvwhJPa3kzDixLKDr0tCdADCP+soV6ADZAmNWzlMn1Tswp51IswsyfyemrzNGubOAvHCFxCs/Z4mfeTkjbwpLf+Zpy2C7qBketOAkOFD/aP1Wm4GH62KKg/PXPqgDn3zla1ulf0fk2Vew== root@vaio
Privilege=0xfff</pre><p></p>
<h3> 3) Access CMC</h3>
<p>Now issue ssh command to access with user service</p><pre class="urvanov-syntax-highlighter-plain-tag">ssh service@dell-cmc1

Welcome to the CMC firmware version 4.30.A00.201210301401

$</pre><p>It will help you to manage large of CMC’s you have in your Data Center specially in Cluster Environment.</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/how-to-enable-ssh-key-based-authentication-on-dell-cmc-idrac/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Node Health Check Script in Cluster</title>
		<link>https://www.sohailriaz.com/node-health-check-script-in-cluster/</link>
					<comments>https://www.sohailriaz.com/node-health-check-script-in-cluster/#respond</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Fri, 26 Apr 2013 12:12:53 +0000</pubDate>
				<category><![CDATA[Clusters]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programming / Scripting]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=470</guid>

					<description><![CDATA[Node health (hardware/software) is very critical in cluster environment. Whether you run a lot of web servers in load balancer or having compute node in]]></description>
										<content:encoded><![CDATA[<p>Node health (hardware/software) is very critical in cluster environment. Whether you run a lot of web servers in load balancer or having compute node in High Performance Computing setup, each node is critical which is been used for any type of work. It has to be healthy to run processes we need to run. This script created to check node health before using as a compute node or any service in load balancer. If all checks run fine then node will be mark good and will available to run in production.<span id="more-470"></span></p>
<h3>1. License</h3>
<p>GPL. You can add/edit/delete script to fit your need. Please do share your edit to enhance the script.</p>
<h3>2. Functions</h3>
<p>Script is created using functions. Every check is based on function, so to perform any check or not is depends on whether you call the function or not. Just make to call function or not in the Main Section of the script and it will run as per your need. Even you can add/edit/delete as per your need to make changes in script.</p>
<h3>3. Checks</h3>
<p>Following checks are made as per my need.</p>
<ul>
<li><span style="line-height: 13px;">Loadavg</span></li>
<li>Memory / Swap</li>
<li>CPU</li>
<li>Ethernet Speed</li>
<li>Infiniband</li>
<li>NFS Mounts</li>
<li>NIS Server</li>
<li>MCELog (Machine Check Event, hardware error reporting)</li>
</ul>
<p>You can create your own checks and add to the script for enhance checking.</p>
<h3>4. Script</h3>
<p>Here it is</p><pre class="urvanov-syntax-highlighter-plain-tag">#!/bin/bash
#
# Script: Node Health Script 
# Created By: Sohail Riaz (sohaileo@gmail.com) www.sohailriaz.com
# Created On: 9th April 2013
# Detail: To Check Single Node Health. 
# HowTo Run: chmod +x nodecheck.sh; ./nodecheck.sh
# Checks: loadavg, memory, cpu, ehternet, infiniband, infiniband ipath test, cpu test, nfs mounts, nis, mcelog
# Functions: You can load/unload any function you need to run or not to run.
# License: GPL
#

## LoadAvg Function
loadavg() {
LoadAvg=`uptime | awk -F "load average:" '{print $2}' | cut -f 1 -d,`
echo "LoadAvg = $LoadAvg" &gt;&gt; $Report
}

## Memory Function
memory() {
TOTAL_MEM=`grep "MemTotal:" /proc/meminfo | awk '{msum+=($2/1024)/1024} END {printf "%.0f",msum}'`
FREE_MEM=`grep "MemFree:" /proc/meminfo | awk '{mfree+=($2/1024)/1024} END {printf "%.0f",mfree}'`
TOTAL_SWAP=`grep "SwapTotal:" /proc/meminfo | awk '{ssum+=($2/1024)/1024} END {printf "%.0f",ssum}'`
FREE_SWAP=`grep "SwapFree:" /proc/meminfo | awk '{sfree+=($2/1024)/1024} END {printf "%.0f",sfree}'`

echo "TotalMemory = $TOTAL_MEM GB ($FREE_MEM GB Free)" &gt;&gt; $Report
echo "TotalSwap = $TOTAL_SWAP GB ($FREE_SWAP GB Free)" &gt;&gt; $Report
}

## CPU Function
cpu() {
PROCESSOR=`grep processor /proc/cpuinfo | wc -l`
CPU_MODEL=`grep "model name" /proc/cpuinfo | head -n 1 | awk '{print $7 " " $8 " " $9}'`

echo "Processors = $PROCESSOR" &gt;&gt; $Report
echo "ProcessorModel = $CPU_MODEL" &gt;&gt; $Report
}

## Ethernet Function (eth1 for me, you can edit for yours)
ethernet() {
ETHER_SPEED=`ethtool eth1 | grep "Speed:" | awk '{print $2}'`

echo "EthernetSpeed = $ETHER_SPEED" &gt;&gt; $Report
}

## IB Function
ib() {
IB_STATE=`cat /sys/class/infiniband/*/ports/1/state | awk -F ":" '{print $2}'`
IB_PHYS_STATE=`cat /sys/class/infiniband/*/ports/1/phys_state | awk -F ":" '{print $2}'`
IB_RATE=`cat /sys/class/infiniband/*/ports/1/rate`

echo "IB_STATE = $IB_STATE" &gt;&gt; $Report
echo "IBLink = $IB_PHYS_STATE" &gt;&gt; $Report
echo "IBRate = $IB_RATE" &gt;&gt; $Report
}

## IB Test Function
ibtest() {
IB_TEST=`ipath_pkt_test -B | awk -F ":" '{print $2}'`
echo "IPathTest = $IB_TEST" &gt;&gt; $Report
}

## NFS Mounts Function
nfs() {
NFS_MOUNTS=`mount -t nfs,panfs,gpfs | wc -l`

echo "NFS_MOUNTS = $NFS_MOUNTS" &gt;&gt; $Report
}

## NIS Function
nis() {
NIS_TEST=`ypwhich`

echo "NIS_SERVER = $NIS_TEST" &gt;&gt; $Report
}

## MCELog Test Function
mcelog() {
MCELog=`if [ -s /var/log/mcelog ]; then echo "Check MCELog"; else echo "No MCELog"; fi`

echo "MCE Log = $MCELog" &gt;&gt; $Report
}

### MAIN SCRIPT

## Get Node Name
Hostname=`hostname -s`
touch ./$Hostname-checks.txt
Report=./$Hostname-checks.txt
echo " " &gt; $Report
echo "Node = ${Hostname}" &gt;&gt; $Report
echo "----------------" &gt;&gt; $Report

## Get Cluster Name
Cluster=`echo $Hostname | cut -c1-4`

## Call Function
loadavg
memory
cpu
ethernet
ib
ibtest
nfs
nis
mcelog

## Generate Report
echo " " &gt;&gt; $Report
cat $Report</pre><p>or press to download.     [button link=&#8221;https://www.sohailriaz.com/downloads/nodecheck.sh&#8221; bg_color=&#8221;orange&#8221;]Download Script[/button]</p>
<p>To run the script run following command.</p><pre class="urvanov-syntax-highlighter-plain-tag">chmod +x nodecheck.sh
./nodecheck.sh</pre><p></p>
<h3> 5. Enhancement</h3>
<p>You can add/edit/delete any function inside script to meet your need but do share your edits to let us improve the script for maximum checks.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/node-health-check-script-in-cluster/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How To Enable NTFS Support in CentOS 6.3</title>
		<link>https://www.sohailriaz.com/how-to-enable-ntfs-support-in-centos-6-3/</link>
					<comments>https://www.sohailriaz.com/how-to-enable-ntfs-support-in-centos-6-3/#comments</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Sun, 20 Jan 2013 17:40:58 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=378</guid>

					<description><![CDATA[In this how to I will describe how to enable NTFS support in CentOS 6.3. By default CentOS 6.x doesnt comes with NTFS support to]]></description>
										<content:encoded><![CDATA[<p>In this how to I will describe how to enable NTFS support in CentOS 6.3. By default CentOS 6.x doesnt comes with NTFS support to mount NTFS partition either on hard disk or usb drives. Fedora provies EPEL repository for Red Hat Enterprise Linux. EPEL (Extra Packages for Enterprise Linux) is a volunteer-based community effort from the Fedora project to create a repository of high-quality add-on packages that complement the Fedora-based Red Hat Enterprise Linux (RHEL) and its compatible spinoffs, such as CentOS and Scientific Linux. NTFS drivers ntfs-3g is available through EPEL repository. <span id="more-378"></span></p>
<h3><span style="font-size: 1.17em;">1) Preparation</span></h3>
<p>Enable EPEL repository using following command.</p><pre class="urvanov-syntax-highlighter-plain-tag">rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm</pre><p></p>
<h3><span style="font-size: 1.17em;">2) Install NTFS Drivers.</span></h3>
<p></p><pre class="urvanov-syntax-highlighter-plain-tag">yum -y install ntfs-3g</pre><p>The above command will install ntfs-3g package which bring NTFS support to your CentOS 6.3 installation. Just plug in your ntfs usb drives or use mount command to enable ntfs hard drive partitions.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/how-to-enable-ntfs-support-in-centos-6-3/feed/</wfw:commentRss>
			<slash:comments>42</slash:comments>
		
		
			</item>
		<item>
		<title>How To Install ATI Radeon Drivers in Fedora 18</title>
		<link>https://www.sohailriaz.com/how-to-install-ati-radeon-drivers-in-fedora-18/</link>
					<comments>https://www.sohailriaz.com/how-to-install-ati-radeon-drivers-in-fedora-18/#comments</comments>
		
		<dc:creator><![CDATA[Sohail Riaz]]></dc:creator>
		<pubDate>Sun, 20 Jan 2013 06:49:03 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<guid isPermaLink="false">http://www.sohailriaz.com/?p=372</guid>

					<description><![CDATA[In this how to I will describe how to install ATI Radeon Drivers in Fedora 18. Fedora 18 fresh out and ATI latest driver version]]></description>
										<content:encoded><![CDATA[<p>In this how to I will describe how to install ATI Radeon Drivers in Fedora 18. Fedora 18 fresh out and ATI latest driver version 13.1 dont support it. I also checked the older version i.e 12.8 and 12.6 but all of them unable to install on Fedora 18. In future they will provide right drivers for Fedora 18 but for now you can install akmod-catalyst beta driver from rpmfusion repository.<span id="more-372"></span></p>
<h3>1) Preparation.</h3>
<p>After installing from Live image to hard driver, first update your kernel and then install Development Tools group to provide all necessary tools for your system.</p><pre class="urvanov-syntax-highlighter-plain-tag">yum -y update kernel
yum -y groupinstall "Development Tools"</pre><p>We will require rpmfusion for driver installation so enable rpmfusion repository for Fedora 18 using following command.</p><pre class="urvanov-syntax-highlighter-plain-tag">rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-18.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-18.noarch.rpm</pre><p><span style="font-size: 1.17em;">2) Installation.</span></p>
<p>Install ATI driver using rpmfusion repository.</p><pre class="urvanov-syntax-highlighter-plain-tag">yum -y install akmod-catalyst</pre><p>The above command will install akmod-catalyst with all dependencies require for it to run. After this you need to run following command to create new initial ram filesystem with updated ATI beta drivers.</p><pre class="urvanov-syntax-highlighter-plain-tag">new-kernel-pkg --kernel-args=nomodeset --mkinitrd --dracut --update $(rpm -q --queryformat="%{version}-%{release}.%{arch}\n" kernel | tail -n 1)</pre><p>Reconfigure xorg using aticonfig to use ATI drivers.</p><pre class="urvanov-syntax-highlighter-plain-tag">aticonfig --initial -f</pre><p>you are all set, just reboot and enjoying your new Fedora 18 running ATI Graphics Driver. Dont be amaze by seeing AMD Testing use only at right bottom of your screen. Its a beta driver and soon ATI will update there drivers for Fedora 18</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sohailriaz.com/how-to-install-ati-radeon-drivers-in-fedora-18/feed/</wfw:commentRss>
			<slash:comments>40</slash:comments>
		
		
			</item>
	</channel>
</rss>
