当前位置: 首页 > INSTALL, RAC > 正文

静默安装11G RAC(1)-主机环境配置

本实验主要用于备用,之前一位兄弟问我相关的笔记,发现做了实验,没有记录笔记,于是重新做一次实验,并记录下来

环境介绍

多路径软件使用MULTIPATH方式,OS的版本为5.8,数据库使用ASM存储方式。

 

 

1,配置MULTIPATH

[root@www.htz.pw slient1 ~]# for i in `cat /proc/partitions | awk {'print $4'} |grep sd`; do echo "### $i: `scsi_id -g -u -s /block/$i`"; done
### sda: 36000c29770cc779a13f69f0025db2820
### sda1:
### sda2:
### sdb: 36000c296d572b1c1007e59395b7a59ff
### sdc: 36000c29ede0a500be4bf48418fd35e7e

[root@www.htz.pw slient2 ~]# for i in `cat /proc/partitions | awk {'print $4'} |grep sd`; do echo "### $i: `scsi_id -g -u -s /block/$i`"; done
### sda: 36000c29770cc779a13f69f0025db2820
### sda1:
### sda2:
### sdb: 36000c296d572b1c1007e59395b7a59ff
### sdc: 36000c29ede0a500be4bf48418fd35e7e

[root@www.htz.pw ~]# cat /etc/multipath.conf |grep -v "^#"
blacklist {
        devnode "*"
}
defaults {
        user_friendly_names yes
}
[root@www.htz.pw ~]# mv /etc/multipath.conf /etc/multipath.conf.20140923
[root@www.htz.pw ~]# vi /etc/multipath.conf
blacklist {
        wwid 36000c29770cc779a13f69f0025db2820
}
defaults {
        user_friendly_names yes
}
multipaths {
        multipath {
                wwid    36000c296d572b1c1007e59395b7a59ff
                alias   ocr
                mode    660
                uid     500
                gid     500
        }
        multipath {
                wwid    36000c29ede0a500be4bf48418fd35e7e
                alias   data
                mode    660
                uid     500
                gid     500
        }
}
[root@www.htz.pw ~]# /etc/init.d/multipathd restart
Stopping multipathd daemon: [FAILED]
Starting multipathd daemon: [  OK  ]
[root@www.htz.pw ~]# multipath -ll
data (36000c29ede0a500be4bf48418fd35e7e) dm-3 VMware,,VMware Virtual
[size=5.0G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=1][active]
 \_ 1:0:1:0 sdc 8:32  [active][ready]
ocr (36000c296d572b1c1007e59395b7a59ff) dm-2 VMware,,VMware Virtual
[size=3.0G][features=0][hwhandler=0][rw]
\_ round-robin 0 [prio=1][active]
 \_ 1:0:0:0 sdb 8:16  [active][ready]
[root@www.htz.pw ~]# ls -l /dev/mapper/*
crw------- 1 root root  10, 60 Sep 23 21:22 /dev/mapper/control
brw-rw---- 1  500  500 253,  3 Sep 23 21:45 /dev/mapper/data
brw-rw---- 1  500  500 253,  2 Sep 23 21:45 /dev/mapper/ocr
brw-rw---- 1 root disk 253,  0 Sep 23 21:23 /dev/mapper/VolGroup00-root_lv01
brw-rw---- 1 root disk 253,  1 Sep 23 21:22 /dev/mapper/VolGroup00-swap_lv01
这里看到用户名与组名都是数字,因为用户还没有创建的原因
2 创建用户
groupadd -g 500 dba
useradd -g dba -u 500 grid
useradd -g dba -u 501 oracle
3,配置环境变量
grid
export ORACLE_BASE=/oracle/app/grid
export ORACLE_HOME=/oracle/app/11.2/grid
export ORACLE_SID=+ASM1
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_OS_CHARSET=ZHS16GBK
export LANG=en_US       
export TEMP=/tmp
export TMP=/tmp
export TMPDIR=/tmp

oracle

export ORACLE_BASE=/oracle/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2/db_1
export ORACLE_SID=silent1
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_OS_CHARSET=ZHS16GBK
export LANG=en_US       
export TEMP=/tmp
export TMP=/tmp
export TMPDIR=/tmp
4 配置资源限制
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 131072
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 131072
#这里我是直接配置成-1的,如果有实际的大小可以把-1替换成大小,单位是KB
oracle soft memlock -1
oracle hard memlock -1
grid   soft memlock -1
grid   hard memlock -1
root   soft memlock -1
root   hard memlock -1
配置profile
if [ $USER = "oracle" ] || [ $USER = "grid" ] || [ $USER = "root" ]; then
        if  [ $SHELL = "/bin/ksh" ];  then
              ulimit -p 16384
              ulimit -n 65536
        else
              ulimit -u 16384 -n 65536
        fi

fi

配置bashrc
export PS1='[\u@www.htz.pw \h \W]\$'

配置sysctl.conf
kernel.shmmni=4096
kernel.shmall = 4294967296
kernel.sem=1024 64000 1024 512
fs.file-max= 6815744
fs.aio-max-nr=1048576
vm.dirty_ratio=5
vm.dirty_background_ratio=1
vm.dirty_writeback_centisecs=100
vm.dirty_expire_centisecs=100
vm.drop_caches=3
vm.swappiness=100
vm.vfs_cache_pressure=163
net.core.rmem_default= 1048576
net.core.wmem_default=262144
net.core.rmem_max= 4194304
net.core.wmem_max=4194304
net.ipv4.ip_local_port_range=9000 65500
#这个是配置大页使用的(值为sga(M)/2+1)
#vm.nr_hugepages=23100
5 软件安装
rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n' \
> binutils \
> compat-libstdc++ \
> compat-libstdc++ \
> elfutils-libelf \
> elfutils-libelf-devel \
> gcc \
> gcc-c++ \
> glibc \
> glibc \
> glibc-common \
> glibc-devel \
> glibc-devel \
> glibc-headers \
> ksh \
> libaio \
> libaio \
> libaio-devel \
> libaio-devel \
> libgcc \
> libgcc \
> libstdc++ \
> libstdc++ \
> libstdc++-devel \
> make \
> sysstat
binutils-2.17.50.0.6-20.el5 (x86_64)
package compat-libstdc++ is not installed
package compat-libstdc++ is not installed
elfutils-libelf-0.137-3.el5 (x86_64)
elfutils-libelf-0.137-3.el5 (i386)
elfutils-libelf-devel-0.137-3.el5 (x86_64)
gcc-4.1.2-52.el5 (x86_64)
gcc-c++-4.1.2-52.el5 (x86_64)
glibc-2.5-81 (x86_64)
glibc-2.5-81 (i686)
glibc-2.5-81 (x86_64)
glibc-2.5-81 (i686)
glibc-common-2.5-81 (x86_64)
glibc-devel-2.5-81 (x86_64)
glibc-devel-2.5-81 (i386)
glibc-devel-2.5-81 (x86_64)
glibc-devel-2.5-81 (i386)
glibc-headers-2.5-81 (x86_64)
ksh-20100621-5.el5 (x86_64)
libaio-0.3.106-5 (x86_64)
libaio-0.3.106-5 (i386)
libaio-0.3.106-5 (x86_64)
libaio-0.3.106-5 (i386)
package libaio-devel is not installed
package libaio-devel is not installed
libgcc-4.1.2-52.el5 (x86_64)
libgcc-4.1.2-52.el5 (i386)
libgcc-4.1.2-52.el5 (x86_64)
libgcc-4.1.2-52.el5 (i386)
libstdc++-4.1.2-52.el5 (x86_64)
libstdc++-4.1.2-52.el5 (i386)
libstdc++-4.1.2-52.el5 (x86_64)
libstdc++-4.1.2-52.el5 (i386)
libstdc++-devel-4.1.2-52.el5 (x86_64)
make-3.81-3.el5 (x86_64)
sysstat-7.0.2-11.el5 (x86_64)
配置yum
echo "
[RHEL5.8]
name = Enterprise Linux 5.8 DVD
baseurl=file:///media/Server/
gpgcheck=0
enabled=1">/etc/yum.repos.d/public-yum-el5.repo
tail -5 /etc/yum.repos.d/public-yum-el5.repo
安装软件
yum -y install libaio-devel compat-libstdc++
主机部分配置结束

本文固定链接: http://www.htz.pw/2014/09/24/%e9%9d%99%e9%bb%98%e5%ae%89%e8%a3%8511g-rac1-%e4%b8%bb%e6%9c%ba%e7%8e%af%e5%a2%83%e9%85%8d%e7%bd%ae.html | 认真就输

该日志由 huangtingzhong 于2014年09月24日发表在 INSTALL, RAC 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: 静默安装11G RAC(1)-主机环境配置 | 认真就输
关键字: , , ,