최근 포토로그


HP-UX에서 Hostname 변경하기 위한 방법 ▶ Linux & Unix & Windows

HP-UX 가 제공하는 MC-SG설정된 서버의 hostname변경하기 (acc-db1, 2 --> erpdb1, 2)

    * 먼저 양서버에서 오라클을 중지 및 crs를 중지한 이후 진행

 

 root@acc-db1[/]#cmhaltcl -fv   <-- 클러스터를 중지한다  (양서버에 적용됨)
Disabling all packages from starting on nodes to be halted.
Disabling all packages from running on acc-db1.
Disabling all packages from running on acc-db2.
Warning:  Do not modify or enable packages until the halt operation is completed.
Disabling automatic failover for failover packages to be halted.
Halting package orapkg1
Successfully halted package orapkg1
Halting package orapkg2
Successfully halted package orapkg2
Enabling switching for Package orapkg1.
Enabling switching for Package orapkg2.
This operation may take some time.
Waiting for nodes to halt ..... done
Successfully halted all nodes specified.
Halt operation complete.

 

root@acc-db1[/]#cmviewcl

CLUSTER          STATUS      
acc-db_cluster   down        
 
  NODE           STATUS       STATE       
  acc-db1        down         unknown     
  acc-db2        down         unknown     
   
UNOWNED_PACKAGES

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE       
    orapkg1        down             halted           enabled     unowned    
    orapkg2        down             halted           enabled     unowned    
root@acc-db1[/etc/cmcluster]#ls
cdsf                cmclconfig          cmignoretypes.conf  config.lck          modules             scripts
cfs                 cmclconfig.tmp      cmknowncmds         examples            orapkg1             sgeasy
cluster.asc         cmclfiles2check     cmnotdisk.conf      lib                 orapkg2

root@acc-db1[/etc/cmcluster]#cmdeleteconf -c acc-db_cluster <-- 설정삭제(양서버에 적용됨)
Checking current status

Delete cluster acc-db_cluster ([y]/n)? y
Completed the cluster deletion

 

root@acc-db1[/etc/cmcluster]# cmviewcl    <-- 설정삭제됨을 확인
cmviewcl: Cannot view the cluster configuration: No such file or directory.
Either this node is not configured in a cluster, user doesn't have
access to view the cluster configuration, or there is some obstacle
to viewing the configuration. Check the syslog file for more information.
For a list of possible causes, see the Serviceguard manual for cmviewcl.

 

root@acc-db1[/etc/cmcluster]#vi /etc/rc.config.d/netconf
HOSTNAME="accdb1"    <-- hostname을 수정
root@acc-db1[/etc/cmcluster]#vi /etc/hosts   <-- hostname을 수정
10.10.10.17    erpdb1
10.10.10.19    erpdb2


#FOR ORACLE
192.168.203.11   accdb1-priv
192.168.203.12   accdb2-priv

10.10.10.16       accdb1-vip
10.10.10.18       accdb2-vip

10.10.10.20       accdb-scan


root@acc-db1[/etc/cmcluster]#vi /.rhosts     <-- rhosts파일 수정(양쪽 서버에서 수정하며 향후 rshell 계열은 모두 삭제한다.)
erpdb1  root
erpdb2  root
root@acc-db1[/etc/cmcluster]#/sbin/init.d/hostname start    <-- 바로적용시킴(양서버)
root@acc-db1[/etc/cmcluster]# exit    <-- 로그아웃하여 다시 접속시 확인해본다
logout root

 

root@erpdb1[/]#hostname    <-- 재접속하면 변경되있음
erpdb1

root@erpdb1[/etc/cmcluster]#vi cluster.asc   <-- hostname 변경

CLUSTER_NAME            erpdb_cluster
NODE_NAME               erpdb1
NODE_NAME               erpdb2
root@erpdb1[/etc/cmcluster/orapkg1]#vi *conf     <-- hostname 변경
NODE_NAME     erpdb1
root@erpdb1[/etc/cmcluster/orapkg2]#vi *conf      <-- hostname 변경
NODE_NAME       erpdb2

root@erpb1[/etc/cmcluster]#what /usr/lbin/cmcld   <-- 버전확인
/usr/lbin/cmcld:
         Cluster Monitor Product   $Revision: 82.2 $
         Cluster Monitor Product Only  $Revision: 82.2 $
         Daemon   
         Build date:     Mon May 17 21:52:36 PDT 2010
         Build id:       sg_1120_1131
         Build platform: hpux
         A.11.20.00 Date: 05/17/10

root@erpdb1[/etc/cmcluster]#vgchange -a y /dev/vg_lock
Activated volume group.
Volume group "/dev/vg_lock" has been successfully changed.

 

root@erpdb1[/etc/cmcluster]#rcp -rp ./- erpdb2:/etc/cmcluster/ <-- 이웃서버로 파일전송
root@erpdb1[/etc/cmcluster]#cmapplyconf -v -C cluster.asc -P ./orapkg1/orapkg1.conf -P ./orapkg2/orapkg2.conf

           <--컴파일시 이웃서버도함께적용됨

Begin cluster verification...
Checking cluster file: cluster.asc
check_cdsf_group, no cdsf group specified.
Checking nodes ... Done
Checking existing configuration ... Done
Gathering storage information
Found 99 devices on node accdb1
Found 99 devices on node accdb2
Analysis of 198 devices should take approximately 11 seconds
0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
Found 7 volume groups on node accdb1
Found 7 volume groups on node accdb2
Analysis of 14 volume groups should take approximately 1 seconds
0%----10%----20%----30%----40%----50%----60%----70%----80%----90%----100%
Gathering network information
Beginning network probing (this may take a while)
Completed network probing
Begin file consistency checking

 

root@erpdb1[/etc/cmcluster]#cmruncl -fv    <-- 클러스터를 기동
cmruncl: Validating network configuration...
Gathering network information
Beginning network probing (this may take a while)
Completed network probing
cmruncl: Network validation complete
cmruncl: Validating cluster lock disk .... Done
Waiting for cluster to form .... done
Cluster successfully formed.
Check the syslog files on all nodes in the cluster to verify that no warnings occurred during startup.

root@erpdb1[/etc/cmcluster]#cmviewcl  <-- 스타팅이 진행중

CLUSTER         STATUS      
accdb_cluster   up          
 
  NODE           STATUS       STATE       
  accdb1         up           running     

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE       
    orapkg1        starting         starting         enabled     erpdb1     
 
  NODE           STATUS       STATE       
  accdb2         up           running     

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE       
    orapkg2        starting         starting         enabled     erpdb2     
root@erpdb1[/etc/cmcluster]#cmviewcl   <-- 곧 running으로 바뀜

CLUSTER         STATUS      
accdb_cluster   up          
 
  NODE           STATUS       STATE       
  accdb1         up           running     

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE       
    orapkg1        up               running          enabled     erpdb1     
 
  NODE           STATUS       STATE       
  accdb2         up           running     

    PACKAGE        STATUS           STATE            AUTO_RUN    NODE       
    orapkg2        up               running          enabled     erpdb2     
root@erpdb1[/etc/cmcluster]#netstat -in     <-- crs가 실행안되어 있어 vip가 안보임
Name      Mtu  Network         Address         Ipkts              Ierrs Opkts              Oerrs Coll
lo0      32808 127.0.0.0       127.0.0.1       411701752          0     411704277          0     0  
lan901    9000 192.168.203.0   192.168.203.11 22378663           0     22629407           0     0  
lan900    1500 10.10.10.0      10.10.10.17    1683490614         0     809716962          0     0

 

---- swlist의 정합성을 맞춰준다

/root@erpdb1[/var/adm/sw]#swfixrealm erpdb1

/root@erpdb2[/var/adm/sw]#swfixrealm erpdb2

 


덧글

댓글 입력 영역