Chinaunix首页 | 论坛 | 博客
  • 博客访问: 660918
  • 博文数量: 109
  • 博客积分: 6081
  • 博客等级: 准将
  • 技术积分: 1318
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-24 10:28
文章分类
文章存档

2011年(8)

2010年(39)

2009年(62)

分类:

2009-11-01 14:28:27


机器 IBM P595 两台
HACMP5.4  + CRS
硬件配置情况: 两个双网口 网卡  一个异步串口卡
网络设置
 
1、进行网卡绑定
# lsslot -c pci
# Slot                    Description                         Device(s)
U5791.001.99B13HK-P2-C05  PCI-X capable, 64 bit, 133MHz slot  fcs0
U5791.001.99B13DH-P2-C05  PCI-X capable, 64 bit, 133MHz slot  fcs1
U5791.001.99B13HK-P2-C06  PCI-X capable, 64 bit, 133MHz slot  ent0 ent1
U5791.001.99B13DH-P2-C06  PCI-X capable, 64 bit, 133MHz slot  ent2 ent3
U5791.001.99B13HK-P2-C07  PCI-X capable, 64 bit, 133MHz slot  sa0
网卡绑定方法:(热备方式)
ent0 + ent2 = ent4
ent1 + ent3 = ent5
#smit etherchannel
                                            EtherChannel / IEEE 802.3ad Link Aggregation
Move cursor to desired item and press Enter.
  List All EtherChannels / Link Aggregations
  Add An EtherChannel / Link Aggregation
  Change / Show Characteristics of an EtherChannel / Link Aggregation
  Remove An EtherChannel / Link Aggregation
  Force A Failover In An EtherChannel / Link Aggregation
                                               Add An EtherChannel / Link Aggregation
Type or select values in entry fields.
Press Enter AFTER making all desired changes.
 
                                                        [Entry Fields]
  EtherChannel / Link Aggregation Adapters            ent0                                                                       +
  Enable Alternate Address                            no                                                                         +
  Alternate Address                                  []                                                                          +
  Enable Gigabit Ethernet Jumbo Frames                no                                                                         +
  Mode                                                standard                                                                   +
  Hash Mode                                           default                                                                    +
  Backup Adapter                                      ent2                                                                       +
       Automatically Recover to Main Channel          yes                                                                        +
       Perform Lossless Failover After Ping Failure   yes                                                                        +
  Internet Address to Ping                           []
  Number of Retries                                  []                                                                          +#
  Retry Timeout (sec)                                [] 
网络参数
#/usr/sbin/no -r -o ipqmaxlen=512
#/usr/sbin/no -p -o rfc1323=1
#/usr/sbin/no -p -o sb_max=1310720
#/usr/sbin/no -p -o tcp_recvspace=65536
#/usr/sbin/no -p -o tcp_sendspace=65536
#/usr/sbin/no -p -o udp_recvspace=655360
#/usr/sbin/no -p -o udp_sendspace=65536
注意:
ipqmaxlen parameter调整方法
网络参数要求:
ipqmaxlen 512
rfc1323 1
sb_max 2*655360
tcp_recvspace 65536
tcp_sendspace 65536
udp_recvspace 655360
Note: The recommended value of this parameter is 10 times the value of the udp_sendspace parameter. The value must be less than the value of the sb_max parameter.
udp_sendspace 65536
Note: This value is suitable for a default database installation. For production databases, the minimum value for this parameter is 4KB plus the value of the database DB_BLOCK_SIZE initialization parameter multiplied by the value of the DB_MULTIBLOCK_READ_COUNT initialization parameter:(DB_BLOCK_SIZE * DB_MULTIBLOCK_READ_COUNT) + 4 KB =(16*8+4)*1024=
 
2、设置IP
#smit tcpip
节点cs_a:
en4:202.116.193.149
en5:192.168.100.1
节点cs_b:
en4:202.116.193.151
en5:192.168.100.2
#vi /etc/hosts
202.116.193.149  csa
202.116.193.150  csa-vip
192.168.100.1  csa_priv
202.116.193.151  csb
202.116.193.152  csb-vip
192.168.100.2    csb_priv
#vi /etc/hosts.equiv
csa      root
csa-vip  root
csa_priv root
csb      root
csb-vip  root
csb_priv root
csa      oracle
csa-vip  oracle
csa_priv oracle
csb      oracle
csb-vip  oracle
csb_priv oracle
root:
#vi .rhosts
csa      root
csa-vip  root
csa_priv root
csb      root
csb-vip  root
csb_priv root
csa      oracle
csa-vip  oracle
csa_priv oracle
csb      oracle
csb-vip  oracle
csb_priv oracle
//测试远程登录
#rlogin csa
#rlogin csb
3、修改系统参数,进行调优
调整交换页空间
#lsps -a
#smit chps   调整为 内存的两倍,内存大于8 G ,则为 内存大小
系统用户数及最大进程数
#smit chgsys
调整为:1024
修改时区
#smit system
启用异步I/O
#smit chaio
MINIMUM number of servers          1   15
MAXIMUM number of servers per cpu  10 30
STATE to be configured at system restart define available
修改文件:/etc/security/limits
#vi /etc/security/limits
default:
        fsize = 2097151
        core = 2097151
        cpu = -1
        data = 262144
        rss = 65536
        stack = 65536
        nofiles = 2000
root:
        fsize = -1
        data = -1
        stack = -1
        core = -1
oracle:
        fsize = -1
        data = -1
        stack = -1
        core = -1

用一下命令验证设置:
#ulimit -a
调整内存参数:
#vmo -p -o parameter=value
调整要求:
lru_file_repage=0
minperm% = 5
maxclient% = 80
maxperm% = 80
命令:
#vmo -p -o lru_file_repage=0
#vmo -p -o minperm%=5
#vmo -p -o maxclient%=80
#vmo -p -o maxperm%=80

4、新建用户和组及相关的文件系统
用户: oracle  组: oinstall(primary group)    dba,hagsuser (second group)
#smit mkgroup
#smit mkuser
#id nobody //确认 nobody 是否存在
配置oracle 用户的shell limits
#smit chuser
soft FILE size -1 (Unlimited)
soft CPU time -1 (Unlimited)
Note:this id the default value
soft DATA segment -1 (Unlimited)
soft STACK size -1 (Unlimited)
配置root 用户的shell limits
#smit chuser
新建软件安装目录
创建 crs 安装目录
#smit crfs
/crs    大小10G
#mkdir -p /crs/app/oracle/product/crs_1
#chown -R root:oinstall /crs
#chmod -R 775 /crs
创建 oracle 安装oracle_base目录
#smit crfs
/oracle  大小 15g
#mkdir -p /oracle/app/oracle/product/10.2.0/db_1
#chown -R oracle:oinstall /oracle
#chmod -R 775 /oracle
对于上传文件进行安装时,最好新建一个文件系统,用于存放 该安装文件
#smit crfs
新建 文件系统 /ptfs : 大小 5G
上传 HACMP   CRS   database  及相关的不订包
#chown -R oracle:oinstall /ptfs/crs
#chmod -R 775 /ptfs/crs
#ls -l /ptfs
-rw-r-----    1 root     system    750959616 Apr 29 13:21 10gr2_aix5l64_cluster.cpio
-rw-r-----    1 root     system   1321110528 Apr 29 13:21 10gr2_aix5l64_database.cpio
drwxr-xr-x    5 root     system          256 Apr 29 13:35 ha53
-rw-r-----    1 root     system   1962784504 Apr 29 13:24 p6810189_10204_AIX5L.zip  //hacmp 补丁
drwxr-x---    3 root     system         4096 Apr 29 13:20 xlc
解压相关的软件包及进行安装
#gunzip  10gr2_aix5l64_cluster.cpio.gz
#cpio -idcmv < 10gr2_aix5l64_cluster.cpio

5、进行相关软件包的安装
需要安装的相关软件包:
Xlc
hacmp5.3
hacmp 补丁包
CRS 及其补丁包
oracle database 及相关软件包。
#inutoc /ptfs/xlc
#smit update_all
HACMP 安装配置
#smit installp  (hacmp)
#smit update_all (安装hacmp 补丁包)

配置 hacmp
串口网络
网卡网络
资源: concurent VG ----  500G
在hacmp同步前,必须启动下面的 clcomdES
#vi /usr/es/sbin/cluster/etc/rhosts
csa     
csa-vip 
csa_priv
csb     
csb-vip
csb_priv
#/usr/bin/startsrc -s clcomdES

安装 CRS 需要准备最少两个 raw disk
/dev/rhdisk2
/dev/rhdisk3
查看 mapping 过来的 lun
#fget_config -Av
#lspv
# fget_config -Av
---dar0---
User array name = 'ds4800_new'
dac0 ACTIVE dac1 ACTIVE
Disk     DAC   LUN Logical Drive
utm             31
hdisk2   dac0    0 R1_L10_2G   
hdisk3   dac0    2 R1_L6_250G  
hdisk4   dac0    3 R2_L10_2G   
hdisk5   dac0    5 R2_L6_250G  
hdisk6   dac0    6 R3_L10_2G   
hdisk7   dac0    7 R4_L10_2G   
hdisk8   dac0    8 R5_L10_2G

OCR盘 (2个)
# chown root:oinstall /dev/rhdisk2
# chown root:oinstall /dev/rhdisk4
# chmod 640 /dev/rhdisk2
# chmod 640 /dev/rhdisk4
Voting disk or database files:(3个)
# chown oracle:dba /dev/rhdisk6
# chown oracle:dba /dev/rhdisk7
# chown oracle:dba /dev/rhdisk8
# chmod 644 /dev/rhdisk6
# chmod 644 /dev/rhdisk7
# chmod 644 /dev/rhdisk8
设置共享裸盘的属性: (共享的数据盘都要使用)
■ SSA and FAStT devices:
# /usr/sbin/chdev -l hdiskn -a reserve_lock=no
■ ESS, EMC, HDS, CLARiiON, and MPIO-capable devices:
# /usr/sbin/chdev -l hdiskn -a reserve_policy=no_reserve

#chdev -l hdisk2  -a pv=yes    \\设置磁盘可用,有pvid
#lsattr -El hdisk2 |grep reserve
#chdev -l hdisk2 -a reserve_policy=no_reserve
#lsattr -El hdisk2 |grep reserve  \\确认是否已经修改
#chdev -l hdisk4 -a reserve_policy=no_reserve
#lsattr -El hdisk4 |grep reserve  \\确认是否已经修改
#chdev -l hdisk6 -a reserve_policy=no_reserve
#lsattr -El hdisk6 |grep reserve  \\确认是否已经修改
#chdev -l hdisk7 -a reserve_policy=no_reserve
#lsattr -El hdisk7 |grep reserve  \\确认是否已经修改
#chdev -l hdisk8 -a reserve_policy=no_reserve
#lsattr -El hdisk8 |grep reserve  \\确认是否已经修改
#chdev -l hdisk2 -a pv=clear    \\撤销磁盘的pvid
#chdev -l hdisk4 -a pv=clear    \\撤销磁盘的pvid
#chdev -l hdisk6 -a pv=clear    \\撤销磁盘的pvid
#chdev -l hdisk7 -a pv=clear    \\撤销磁盘的pvid
#chdev -l hdisk8 -a pv=clear    \\撤销磁盘的pvid

同理在每个节点设置 hdisk4  hdisk6 hdisk7  hdisk8 

 修改 /home/oracle/.profile 文件
#su - oracle
#vi /home/oracle/.profile
umask 022
PS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
ORACLE_BASE=/oracle/app/oracle
export ORACLE_BASE
ORACLE_SID=testdb
export ORACLE_SID
ORACLE_HOME=/oracle/app/oracle/product/10.2.0/db_1
export ORACLE_HOME
ORA_CRS_HOME=/crs/app/oracle/product/crs_1
export ORA_CRS_HOME
CRS_HOME=/crs/app/oracle/product/crs_1
export CRS_HOME
export DISPLAY=202.116.193.200:0.0
NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'
export NLS_LANG
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORA_CRS_HOME/lib:$ORA_CRS_HOME/lib32
export LD_LIBRARY_PATH
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:.
export PATH
PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$PATH
export PATH
AIXTHREAD_SCOPE=S
export AIXTHREAD_SCOPE
使用 oracle 用户登录 Xmanager 图形。
#xclock  测试图形
#vi .dtprofile
true
#export ORACLE_BASE=/crs/app/oracle
#export ORACLE_HOME=/crs/app/oracle/product/crs_1
#umask 022
或者
#. ./.profile
进入目录进行安装,注意两边用root 权限执行 rootpre.sh

安装数据库
安装前cluvfy 检查
#./runcluvfy.sh  stage -pre dbinst -n node_a,node_b -r 10gR2 -osdba dba -verbase
启动CRS 进程
#ORA_CRS_HOME/bin/crsctl start crs 启动crs,需要超级用户操作。
或者
#su - oracle
$crsctl start crs
安装数据库
ASM 下管理数据库
#cd $ORACLE_HOME  查看 oracle ASM 实例的 sid
#export $ORACLE_SID=+ASM2
#sqlplus / as sysdba
SQL〉select group_number,name,state,total_mb from v$asm_diskgroup;  //查看磁盘组
GROUP_NUMBER NAME
------------ ------------------------------------------------------------
STATE                    TOTAL_MB
---------------------- ----------
           2 DGSYSTEM
MOUNTED                    256000
           1 DGRECOVER
MOUNTED                    256000
SQL〉select path from v$asm_disk;
在增加磁盘组之前,应改变磁盘的权限
#chown oracle:dba /dev/rdsk/c2t0d3*
# chmod 660 /dev/rdsk/c2t0d3*
SQL>create diskgroup testdg external redundancy disk '/dev/rdsk/c2t0d3s6'; //创建磁盘组
SQL〉select group_number,name,state,total_mb from v$asm_diskgroup;  //查看磁盘
SQL〉alter diskgroup testdg mount;
SQL〉show parameter control_files;
 
 
 
 
 
彻底 删除 oralce crs
在安装clusterware时假如出现报错现象,需要重新安装时,必须先清除已经安装的cluserware,否则可能会影响到下次安装。一般情况下,只需要在各节点上依次运行目录$ORA_CRS_HOME/install/下的脚本rootdelete.sh和rootdeinstall.sh即可。
我们也可以采用手工删除:
1、在所有节点停止nodeapps

srvctl stop nodeapps -n nodename
2、删除crs自动启动程序
Sun:
rm /etc/init.d/init.cssd
rm /etc/init.d/init.crs
rm /etc/init.d/init.crsd
rm /etc/init.d/init.evmd
rm /etc/rc3.d/K96init.crs
rm /etc/rc3.d/S96init.crs
rm -Rf /var/opt/oracle/scls_scr
rm -Rf /var/opt/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab
Linux:
rm /etc/oracle/*
rm -f /etc/init.d/init.cssd
rm -f /etc/init.d/init.crs
rm -f /etc/init.d/init.crsd
rm -f /etc/init.d/init.evmd
rm -f /etc/rc2.d/K96init.crs
rm -f /etc/rc2.d/S96init.crs
rm -f /etc/rc3.d/K96init.crs
rm -f /etc/rc3.d/S96init.crs
rm -f /etc/rc5.d/K96init.crs
rm -f /etc/rc5.d/S96init.crs
rm -Rf /etc/oracle/scls_scr
rm -f /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab
HP-UX:
rm /sbin/init.d/init.cssd
rm /sbin/init.d/init.crs
rm /sbin/init.d/init.crsd
rm /sbin/init.d/init.evmd
rm /sbin/rc2.d/K960init.crs
rm /sbin/rc2.d/K001init.crs
rm /sbin/rc3.d/K960init.crs
rm /sbin/rc3.d/S960init.crs
rm -Rf /var/opt/oracle/scls_scr
rm -Rf /var/opt/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab
HP Tru64:
rm /sbin/init.d/init.cssd
rm /sbin/init.d/init.crs
rm /sbin/init.d/init.crsd
rm /sbin/init.d/init.evmd
rm /sbin/rc3.d/K96init.crs
rm /sbin/rc3.d/S96init.crs
rm -Rf /var/opt/oracle/scls_scr
rm -Rf /var/opt/oracle/oprocd
rm /etc/inittab.crs
cp /etc/inittab.orig /etc/inittab
IBM AIX:
#rm /etc/init.cssd
#rm /etc/init.crs
#rm /etc/init.crsd
#rm /etc/init.evmd
#rm /etc/rc.d/rc2.d/K96init.crs
#rm /etc/rc.d/rc2.d/S96init.crs
#rm -Rf /etc/oracle/scls_scr
#rm -Rf /etc/oracle/oprocd
#rm /etc/inittab.crs
#cp /etc/inittab.orig /etc/inittab
3、kill css/crs/evm进程,并reboot节点
ps -ef | grep css/crs/evm
kill -9 processid
4、删除/tmp/.oracle或/var/tmp/.oracle
rm -rf /tmp/.oracle 或rm -rf /var/tmp/.oracle
5、删除ocr.loc
rm -f /etc/oracle/orc.loc
6、用oracle universal installer卸载crs
7、删除crs安装目录
rm -Rf crs_install_dir
8、使用dd清除vote disk和ocr(裸设备)
dd if=/dev/zero of=/dev/rhdisk2 bs=8192 count=262144
dd if=/dev/zero of=/dev/rhdisk4 bs=8192 count=262144
dd if=/dev/zero of=/dev/rhdisk6 bs=8192 count=262144
dd if=/dev/zero of=/dev/rhdisk7 bs=8192 count=262144
dd if=/dev/zero of=/dev/rhdisk8 bs=8192 count=262144
dd if=/dev/zero of=/dev/rhdisk3 bs=8192 count=26214400
dd if=/dev/zero of=/dev/rhdisk5 bs=8192 count=26214400
 
RAC1:两台P595的第一个分区
 主机名:ywa/ywb
 oracle用户:oracle
 sid:urp/ywk(oracle的.profile中的ORACLE_SID=urp1/2,如需要启停ywk,需要手动export ORACLE_SID=ywk1/2)
RAC1:两台P595的第一个分区
 主机名:jwa/jwb
 oracle用户:oracle
 sid:jwk
启动crs:/crs/app/oracle/product/bin/crsctl start crs
停止crs:/crs/app/oracle/product/bin/crsctl start crs
检查crs状态:/crs/app/oracle/product/bin/crs_stat -t
启动步骤:hacmp--crs--database
停机步骤:database--crs--hacmp

 
 
 
阅读(1960) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~