Monday, May 19, 2014

[GPFS] Adding a disk to the filesystem concurrently

[GPFS] Adding a disk to the GPFS filesystem concurrently It's very simple to add a disk to the filsystem.
We will make it from making nsd to add a disk to the filesystem.

1. Check the disk status on both nodes (check disk number, pvid)
# lspv

2. For adding a 'nsd' to GPFS cluster, making a disk.desc file when we use it before the GPFS configuration

# vi diskadd_desc
hdisk6:::dataAndMetadata:-1:kn_nsd3

3. Adding a nsd using a 'mmcrnsd' command mmcrnsd.

# mmcrnsd -F /diskadd_desc


Check whether the nsd is well made or not

# mmlsnsd

gpfs1

4. Adding the nsd we made to the filesystem.

# mmadddisk filesystem_name nsd_name

Now you can see the changed filesystem using 'mmlsnsd' and 'mmdf' command.

# mmlsnsd
# mmdf filesystem_name
gpfs2

5. Finally, this job will be completed after using 'restripe' command for redistribute data.
  (주의!!! This command can use in operating status but I strongly recommend not to use it at busy operating. It can make a performance issue.)
# mmrestripefs filesystem_name -b

After upper action, you can check the filesystem using below command.
# mmdf filesystem_name

[GPFS] Authenticate ssh, rsh before GPFS configuration

Authenticate ssh, rsh connection using DSA or RSA before GPFS configuration</titile> <meta description="How to jauthenticate ssh, rsh connection using DSA or RSA bfore GPFS configuration"> If you want to make a connection between GPFS nodes, you need to config and authenticte rsh or ssh connection each other. I recommend you ssh connection and DSA authentication for security. (It's the same way to get a RSA authentication.)<br /> <br /> 1. test each server whether ssh authentication is well connected or not<br /> <b>node1# ssh root@node2_name ls</b><br /> <b>node2# ssh root@node1_name ls</b><br /> <br /> If password required when you insert upper command, you need to get a ssh authentication(go to second procedure)<br /> <br /> 2. Generate DSA key on both nodes as a below picture.<br /> Then you will see the path of id_dsa and id_dsa.pub files.<br /> (when enter, just press enter)<br /> <br /> <b># ssh-keygen -t dsa or # ssh-keygen -t rsa</b><br /> <br /> <img alt="ssh1" height="352" src="https://farm3.staticflickr.com/2935/14219962565_ef6b9b2dc3_o.png" width="640" /> <br /> <br /> 3. Change the directory to '.ssh', you can see the '.pub' file generated. Move this file to the other node using scp.<br /> (if you use rsa, you just change the word from dsa to ras.)<br /> <br /> <b># scp /.ssh/id_dsa_pub 상대편노드:/.ssh/id_dsa_pub.본인노드</b><br /> <br /> In this picture<br /> <b>node1 # scp id_dsa.put node2:/.ssh/id_dsa_pub.node1</b><br /> <b>node2 # scp id_dsa.put node1:/.ssh/id_dsa_pub.node2</b><br /> <br /> <br /> <img alt="ssh2" height="343" src="https://farm6.staticflickr.com/5590/14196804356_3ae219dde1_o.png" width="640" /> <br /> <br /> 4. Insert tossed pub key to authorizd_keys it's own, authentication will be completed.<br /> <br /> <b># cat id_dsa_pub_file-name >> authorized_keys</b><br /> <br /> Excute below command at each other<br /> <b>node1# cat id_dsa_pub.node2 >> authorized_keys</b><br /> <b>node2# cat id_dsa_pub.node1 >> authorized_keys</b><br /> <br /> <br /> <img alt="ssh3" height="340" src="https://farm3.staticflickr.com/2895/14219962465_c980530a35_o.png" width="640" /> <br /> <br /> 5. If you complete until number 4, excute number 1 again for confirmation.<br /> <div> <br /></div> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> 작성자: <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/17102480534020975366' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/17102480534020975366' rel='author' title='author profile'> <span itemprop='name'>Unknown</span> </a> </span> </span> <span class='post-timestamp'> 시간: <meta content='http://anymentibm.blogspot.com/2014/05/gpfs-authenticate-ssh-rsh-before-gpfs.html' itemprop='url'/> <a class='timestamp-link' href='http://anymentibm.blogspot.com/2014/05/gpfs-authenticate-ssh-rsh-before-gpfs.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2014-05-19T01:09:00-07:00'>1:09 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='http://anymentibm.blogspot.com/2014/05/gpfs-authenticate-ssh-rsh-before-gpfs.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=799579403798118384&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=799579403798118384&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=799579403798118384&target=twitter' target='_blank' title='Share to X'><span class='share-button-link-text'>Share to X</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=799579403798118384&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=799579403798118384&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> 라벨: <a href='http://anymentibm.blogspot.com/search/label/GPFS' rel='tag'>GPFS</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> <div class="date-outer"> <h2 class='date-header'><span>Friday, May 16, 2014</span></h2> <div class="date-posts"> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://farm8.staticflickr.com/7389/14195564754_2403c09a82_o.png' itemprop='image_url'/> <meta content='1956383988831203730' itemprop='blogId'/> <meta content='677676571748501397' itemprop='postId'/> <a name='677676571748501397'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='http://anymentibm.blogspot.com/2014/05/aix-etherchannel-configuration-and.html'>[AIX] Etherchannel Configuration and Change</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-677676571748501397' itemprop='description articleBody'> Etherchannel is a aix software utility which makes improving network performance and providing availablility using more than 1 adapters.<br /> If you make the adapter being etherchannel, new adapter is generated which can use as an normal ethernet adapter.<br /> <br /> note) If you use the etherchannel to be active-backup mode, you can connect it to different switch devices. But if you want to use Active-Active mode, you should connect same switch.<br /> <br /> 1. Prepare network adapters for making an etherchannel.<br /> <img alt="ether_01" height="53" src="https://farm8.staticflickr.com/7389/14195564754_2403c09a82_o.png" width="623" /> <br /> <br /> <br /> 2. Geneate an etherchannel<br /> You can make the etherchannel easily using smit interface.<br /> <br /> # smitty etherchannel<br /> <br /> <img alt="ether_02" height="385" src="https://farm3.staticflickr.com/2913/14009029577_6c0e5d6c7f_o.png" width="645" /> <br /> <br /> <br /> - Select [Add An EtherChannel / Link Aggregation]<br /> And select an available network adapter for using active channel.<br /> (One or more items can be selected.)<br /> <br /> We will use Active-Backup mode, so select ent0.<br /> <br /> <img alt="ether_03" height="388" src="https://farm6.staticflickr.com/5071/14009029547_3ed7280693_o.png" width="645" /> <br /> <br /> - Next, you can see the below screen, etherchannel config menu.<br /> <br /> <br /> First of all, you should select backup adapter. Move the cursor to 'Backup Adapter', you can see and select available adapter. (Print list : ESC + 4)<br /> <br /> <img alt="ether_04" height="384" src="https://farm8.staticflickr.com/7415/14172487096_ce3a4675a8_o.png" width="645" /> <br /> <br /> There are other option<br /> <br /> - Alternate Address : the made adapter uses default MAC-address, but can use other MAC address using this option<br /> - Enable Gigabit Ethernet ... : carefully use this option because it changes MTU to 9000. If you use gigabit network and all other systems supporte MTU 9000, this option makes performance good but if not the performance being poored.<br /> <br /> - Mode: for selecting ehterchannel mode.<br />           Standard : transfer data on each requested adapter<br />           Round-Robin : transfer data sequentially on each adapter<br /> <br /> - IEEE 802.3ad Interval:  Using link aggregation(wide bandwith)<br />                                   Should use LACP switch.<br /> <br /> - Internet Address to Ping : For finding problem about connection, system tried to send periodic ping request. It needs to be used carefully. Because if other system, receiving requests, is having problem, own system will tried to failover to backup adapter.<br /> In this result, the adapters which is etherchanneled will failover each other until the opposite system is in normal.<br /> <br /> - Number of Retries, Retry Timeout(Sec) : It can used when IP is in Internet Address to Ping and have a backup adapter<br /> <br /> - Now you set the option up and press 'Enter', Etherchannel will be made.<br /> <br /> #lsdev -Ccadapter<br /> <img alt="ether_05" height="68" src="https://farm6.staticflickr.com/5313/14008994260_8e5742509a_o.png" width="639" /> <br /> <br /> - You can use the ent2 adapter as an network adapter.<br />    (Input IP address and just use it)<br /> <br /> 2. You should etherchannel adapter make down and detach status before changing and removing Etherchannel.<br /> <br /> 3. The procedure, Removing an active or a backup adapter<br /> - Check whether the removing adapter is used<br /> <div> <br /></div> <img alt="ether_06" height="244" src="https://farm8.staticflickr.com/7361/14193093092_e87ab0e775_o.png" width="645" /> <br /> <br /> On the picture etherchannel is consisted of Active(ent1), backup(ent0)<br /> <br /> <img alt="ether_07" height="34" src="https://farm8.staticflickr.com/7405/14008969438_5dd169d686_o.png" width="415" /> <br /> <br /> Active channel is primary channel. It means etherchannel is running on ent1.<br /> So you can replace backup channel(ent0). need failover if you want to replace active channel.<br /> <br /> - How to failover<br /> # smitty etherchannel<br /> <br /> Select 5th item on the list at below picture<br /> <img alt="ether_08" height="388" src="https://farm3.staticflickr.com/2935/14193093032_c84dc5c9ac_o.png" width="643" /><br /> <br /> Next<br /> #smitty etherchannel   => Change/Show Characteristics....... =>  Select etherchannel<br /> <div> <br /></div> <img alt="ether_09" height="388" src="https://farm8.staticflickr.com/7361/14008962439_46231bdfe5_o.png" width="642" /><br /> <br /> - Input the adapter you want to remove on 'Delete Backup or Main Adatper'<br /> - If the action is completed, backup adapter will be removed as below picture.<br /> - After removing, replace fault adapter.<br /> <br /> <img alt="ether_10" height="244" src="https://farm8.staticflickr.com/7365/14008994170_2a3d86e6b7_o.png" width="639" /> <br /> <br /> <br /> Replace proceudre of adapter<br /> - rmdev -dl 'Error_Adapter_name'  (Error_Adapter_name: Input fault adapter name)<br /> - Replace it (diag – Task Manager - Hot Plug Task – PCI Hot Plug Manager)<br /> - # cfgmgr -v<br /> <br /> <br /> 4. Add  Active / Backup adapter in the etherchannel<br /> - It's similar to number 3, Remove procedure<br />   Insert the adapter you want to add to Add Main adapter or Backup adapter.<br /> <br /> <img alt="ether_11" height="383" src="https://farm8.staticflickr.com/7361/14008962579_60bd359d7d_o.png" width="641" /><br /> <br /> <br /> That's all<br /> <br /> <div style='clear: both;'></div> </div> <div class='post-footer'> <div class='post-footer-line post-footer-line-1'> <span class='post-author vcard'> 작성자: <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'> <meta content='https://www.blogger.com/profile/17102480534020975366' itemprop='url'/> <a class='g-profile' href='https://www.blogger.com/profile/17102480534020975366' rel='author' title='author profile'> <span itemprop='name'>Unknown</span> </a> </span> </span> <span class='post-timestamp'> 시간: <meta content='http://anymentibm.blogspot.com/2014/05/aix-etherchannel-configuration-and.html' itemprop='url'/> <a class='timestamp-link' href='http://anymentibm.blogspot.com/2014/05/aix-etherchannel-configuration-and.html' rel='bookmark' title='permanent link'><abbr class='published' itemprop='datePublished' title='2014-05-16T00:09:00-07:00'>12:09 AM</abbr></a> </span> <span class='post-comment-link'> <a class='comment-link' href='http://anymentibm.blogspot.com/2014/05/aix-etherchannel-configuration-and.html#comment-form' onclick=''> No comments: </a> </span> <span class='post-icons'> </span> <div class='post-share-buttons goog-inline-block'> <a class='goog-inline-block share-button sb-email' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=677676571748501397&target=email' target='_blank' title='Email This'><span class='share-button-link-text'>Email This</span></a><a class='goog-inline-block share-button sb-blog' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=677676571748501397&target=blog' onclick='window.open(this.href, "_blank", "height=270,width=475"); return false;' target='_blank' title='BlogThis!'><span class='share-button-link-text'>BlogThis!</span></a><a class='goog-inline-block share-button sb-twitter' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=677676571748501397&target=twitter' target='_blank' title='Share to X'><span class='share-button-link-text'>Share to X</span></a><a class='goog-inline-block share-button sb-facebook' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=677676571748501397&target=facebook' onclick='window.open(this.href, "_blank", "height=430,width=640"); return false;' target='_blank' title='Share to Facebook'><span class='share-button-link-text'>Share to Facebook</span></a><a class='goog-inline-block share-button sb-pinterest' href='https://www.blogger.com/share-post.g?blogID=1956383988831203730&postID=677676571748501397&target=pinterest' target='_blank' title='Share to Pinterest'><span class='share-button-link-text'>Share to Pinterest</span></a> </div> </div> <div class='post-footer-line post-footer-line-2'> <span class='post-labels'> 라벨: <a href='http://anymentibm.blogspot.com/search/label/AIX' rel='tag'>AIX</a> </span> </div> <div class='post-footer-line post-footer-line-3'> <span class='post-location'> </span> </div> </div> </div> </div> </div></div> <div class="date-outer"> <h2 class='date-header'><span>Thursday, May 15, 2014</span></h2> <div class="date-posts"> <div class='post-outer'> <div class='post hentry uncustomized-post-template' itemprop='blogPost' itemscope='itemscope' itemtype='http://schema.org/BlogPosting'> <meta content='https://farm3.staticflickr.com/2924/14170185346_6fa2c45ac2.jpg' itemprop='image_url'/> <meta content='1956383988831203730' itemprop='blogId'/> <meta content='3808686585852086755' itemprop='postId'/> <a name='3808686585852086755'></a> <h3 class='post-title entry-title' itemprop='name'> <a href='http://anymentibm.blogspot.com/2014/05/aixhow-to-configure-crontab.html'>[AIX]How to configure Crontab</a> </h3> <div class='post-header'> <div class='post-header-line-1'></div> </div> <div class='post-body entry-content' id='post-body-3808686585852086755' itemprop='description articleBody'> <title> [AIX]How to configure Crontab Crontab configuration.

 It is easy and powerful utility of schuduling jobs.
 And crontab is using variable OS like linux, solaris and so on.

1. Contents of crontab
File Location: /var/spool/cron/crontabs/         # Restoring each file for each account
Log Location: /var/adm/cron/log

Listing current crontab configuration

# crontab -l
cron_1
2. A command for modifying crontab
# crontab -e                # It uses same editor as vi.

3. Control using crontab command
       /var/adm/cron/cron.allow : User lists allow to use it
       /var/adm/cron/cron.deny : User lists not to allow to use it
       If there isn't 'cron.allow, cron.deny'  file, only root user can use it.

4. Form of crontab contents
Minute     hour     day_of_month     month     weekday     command
ex) 30 6 * * 1,3,5 /usr/bin/calendar        # Excute calendar at every 06:30am mon, tue, fri every month
Minute: 30
hour: 6
day of month: *(every day)
month: *(every month)
weekday: 1,3,5 (Sunday through Saturday), mon, tue, fri

4. Kill the crontab daemon

Check crontab daemon 

# ps -ef|grep cron cron_2


Type the below command and check again.
 
# ps -ef |grep cron | grep -v grep | awk '{print "kill -9 "$2}' | sh -x






[AIX] How to make 'alt disk' using alt_disk_install

[AIX] How to make 'alt disk' using alt_disk_install Let me introduce to you about making alt disk for system backup and test server system or new server instead of mksysb.

1. Prepare available disk(hdisk2)

root@test: / # lspv
hdisk0          00ce30ffea377c7b                    rootvg          active
hdisk1          00ce30ff5eac4b0a                    rootvg          active
hdisk2          none                                       none
 

1.1 Making pvid using chpv command

root@test: / # chdev -l hdisk2 -a pv=yes
hdisk2 changed

root@test: / # lspv
hdisk0          00ce30ffea377c7b                    rootvg          active
hdisk1          00ce30ff5eac4b0a                    rootvg          active
hdisk2          00ce30fffea34bc7c                    none

2. 'alt disk' is reference of 'image.data' file smilar with mksysb backup.
So you should modify 'image.data' file when you use it to mirrored rootvg.
It just can use only changing LP, PP and copy contents to 1 of image.data file and using below command.

root@test: / # alt_disk_install -CBO hdisk2 -i image.data_name

The option of alt_disk_install we usually used are listed below.
 

- C : clone
 

- B : Not to change bootlist
  
- O : altinst_rootvg ODM cleaning for using another system

       Cleaning ODM contents  with option O
      - hostname, N/W information,  other device information




Inform)

When you try to use 'alt disk' for other system, you should to input option 'O'.
But remove the option when you use it for same system for system backup.

3. You can see an alt disk after complete upper task.


root@test: / # lspv
hdisk0          00ce30ffea377c7b                    rootvg          active
hdisk1          00ce30ff5eac4b0a                    rootvg          active
hdisk2          00ce30fffea34bc7c                   altint_rootvg

4.Remove the alt disk from system. Type the below command. (Not to use exportvg command)

#alt_disk_install -X altinst_rootvg

If you don't use upper command when moving another system, The system's ODM could be complicated

Sometimes you need to change 'bootlist' because it can be changed to altinst_rootvg


5. You can use a below command not mirrored vg but extended vg.


#smitty alt_clone을 이용하거나
 

Or changing image.data likes number 2 and type below command
 

#alt_disk_install -CBO -i /image.data hdisk2

[aix] time setting on aix using xntp daemon

[AIX] time sync using NTP daemon, xnptd setting
How to make a time sync. between systems

We need to make a time sync. between clustering system and many database(DB) server.
There are big 3-ways that we can make a time sync.

1. This is very simple command using 'setclock'
It makes a time sync only once with host so can be different as time goes by.
you can use 'crontab', schedule daemon, if you want to set up time every time you want to.
I'll introduce to you how to use crontab daemon later


2. Using timed daemon
- Synchronize servers' time on the same network(LAN).
- It can make huge gaps between systems because it ignores under 20ms.
- Having Back server risk, if the client time is faster than server's

3. Using NTP damon
The last way to synchronize time is using NTP daemon. The accurate daemon name is 'xntpd'
It can use the system under the different network
NTP(network time protocol) daemon is using UDP port(port 123), so you can't use if your system isn't open UPD port. Basically timed daemon immediately synchronize time after configuration but ntp daemon is synchronized after 8~10 min.(It's different by distance and drift)

- Configuration 
  1. Env: AIX 6.1
1.1 Making Server(base time) environment configuration
1) /etc/ntp.conf, /etc/ntp.drift, /etc/trace file check
2) /etc/ntp.conf file modify

   # vi /etc/ntp.conf 
==================== /etc/ntp.conf : server===============
server 127.127.1.0 prefer    # local clock as a reference, default setting
fudge 127.127.1.0 stratum 0    # values for local clock, not required
driftfile /etc/ntp.drift    # where to keep drift data
tracefile /etc/ntp.trace
=================================================


3) xntpd daemon start
#startsrc -s xntpd

xnntp daemon check command
#ps -ef|grep xntpd   
 
or
#lssrc -ls xntpd
check xntpd subsystem status is 'active' or not
ntp_2

1.2 Client
1) Check the gap between server and client. xntpd isn't make sync if there are over about 16min gap. so you should change the time smilary(Using # smitty date)
2) Check the below files
/etc/ntp.conf, /etc/ntp.drift, /etc/ntp.trace
3) Modify /etc/ntp.conf file 
==================== /etc/ntp.conf : Client================
server ServerIP prefer    # Input server's IP address where the ServerIP is
driftfile /etc/ntp.drift    # where to keep drift data
tracefile /etc/ntp.trace
==================================================

4) xntpd daemon start
#startsrc -s xntpd -a -X       
// -X option is prevent time backward(It controls time flow)
Check the clinet xntp daemon.
#ps -ef|grep xntpd   
ntp_3
 or
#lssrc -ls xntpd
If service is active normally, the subsystem's status is in 'active'

ntp_2

You can check the process time is synchronizing through below command
# ntpq –p
ntp_5

Most of all systems will be completed when the reach value is 377 but it can be long time up to time gap between server and client

Tip Usually NTP daemon is never starting when the system is reboot.
If you want to active the daemon automatically, insert the below item into /etc/rc.tcpip


start /usr/sbin/xntpd "$src_running" "-x"